A method for obtaining an ambient light correction image having a minimised error due to motion, the method comprising: capturing a plurality of primary images of an object over a time window, with controlled illumination of the object varying in intensity over time; performing ambient light correction on at least a portion of the plurality of primary images, which have been captured with different illumination intensity, to generate a plurality of ALC images, each ALC image being generated based on demodulating a sub-set of the plurality of primary images which are temporally adjacent by determining, from the sub-set of temporally adjacent primary images with differing controlled illumination, an intensity of ambient light, and generating the ALC image by removing the ambient light intensity from at least one image in the sub-set of temporally adjacent primary images; and characterized in that the method further comprises: calculating an error value for pairs of ALC images, each pair of ALC images including a first ALC image and a second ALC image, wherein the first ALC image and the second ALC image are temporally adjacent; comparing the error values for each pair of ALC images and determining a pair of ALC images which has the lowest error value within the time window; and selecting an ALC image as an error-minimised image from the determined pair of ALC images having the lowest error value within the time window, wherein calculating the error value comprises: comparing each pixel of the first ALC image with a corresponding pixel of the second ALC image, and determining a change in intensity for each pixel between the first ALC image and the second ALC image, and calculating an error value for the pair of ALC images based on the change in intensity over a plurality of pixels. capturing a plurality of primary images of an object over a time window, with controlled illumination of the object varying in intensity over time; performing ambient light correction on at least a portion of the plurality of primary images, which have been captured with different illumination intensity, to generate a plurality of ALC images, each ALC image being generated based on demodulating a sub-set of the plurality of primary images which are temporally adjacent by determining, from the sub-set of temporally adjacent primary images with differing controlled illumination, an intensity of ambient light, and generating the ALC image by removing the ambient light intensity from at least one image in the sub-set of temporally adjacent primary images; and characterized in that the method further comprises: calculating an error value for pairs of ALC images, each pair of ALC images including a first ALC image and a second ALC image, wherein the first ALC image and the second ALC image are temporally adjacent; comparing the error values for each pair of ALC images and determining a pair of ALC images which has the lowest error value within the time window; and selecting an ALC image as an error-minimised image from the determined pair of ALC images having the lowest error value within the time window, wherein calculating the error value comprises: comparing each pixel of the first ALC image with a corresponding pixel of the second ALC image, and determining a change in intensity for each pixel between the first ALC image and the second ALC image, and calculating an error value for the pair of ALC images based on the change in intensity over a plurality of pixels. calculating an error value for pairs of ALC images, each pair of ALC images including a first ALC image and a second ALC image, wherein the first ALC image and the second ALC image are temporally adjacent; comparing the error values for each pair of ALC images and determining a pair of ALC images which has the lowest error value within the time window; and selecting an ALC image as an error-minimised image from the determined pair of ALC images having the lowest error value within the time window, wherein calculating the error value comprises: comparing each pixel of the first ALC image with a corresponding pixel of the second ALC image, and determining a change in intensity for each pixel between the first ALC image and the second ALC image, and calculating an error value for the pair of ALC images based on the change in intensity over a plurality of pixels. comparing each pixel of the first ALC image with a corresponding pixel of the second ALC image, and determining a change in intensity for each pixel between the first ALC image and the second ALC image, and calculating an error value for the pair of ALC images based on the change in intensity over a plurality of pixels.