A method for minimising error in ambient light corrected image due to motion, the method comprising: capturing a plurality of primary images with controlled intensity of illumination varying over time; estimating an error value due to motion for each of a plurality of sub-sets of the plurality of primary images; and performing ambient light correction on an error minimised sub-set of primary images having the lowest estimated error value to generate an ambient light corrected image with a minimised error; wherein estimating the error value for each sub-set of the plurality of primary images (30, 40) comprises: identifying a pair of primary images in the sub-set including a first primary image and a second primary image, wherein the first primary image is captured temporally before the second primary image; determining a displacement vector matrix between the pair of primary images, including: dividing the first primary image into a plurality of first grid elements and dividing the second primary image into a plurality of second grid elements, matching first grid elements to second grid elements which correspond to the same position on the object, and determining a displacement vector between each matched first grid element and second grid element to determine a displacement vector matrix describing the displacement vector of each grid element; and estimating the error value for the sub-set of primary images based on the displacement vector matrix between the pair of primary images. capturing a plurality of primary images with controlled intensity of illumination varying over time; estimating an error value due to motion for each of a plurality of sub-sets of the plurality of primary images; and performing ambient light correction on an error minimised sub-set of primary images having the lowest estimated error value to generate an ambient light corrected image with a minimised error; wherein estimating the error value for each sub-set of the plurality of primary images (30, 40) comprises: identifying a pair of primary images in the sub-set including a first primary image and a second primary image, wherein the first primary image is captured temporally before the second primary image; determining a displacement vector matrix between the pair of primary images, including: dividing the first primary image into a plurality of first grid elements and dividing the second primary image into a plurality of second grid elements, matching first grid elements to second grid elements which correspond to the same position on the object, and determining a displacement vector between each matched first grid element and second grid element to determine a displacement vector matrix describing the displacement vector of each grid element; and estimating the error value for the sub-set of primary images based on the displacement vector matrix between the pair of primary images. identifying a pair of primary images in the sub-set including a first primary image and a second primary image, wherein the first primary image is captured temporally before the second primary image; determining a displacement vector matrix between the pair of primary images, including: dividing the first primary image into a plurality of first grid elements and dividing the second primary image into a plurality of second grid elements, matching first grid elements to second grid elements which correspond to the same position on the object, and determining a displacement vector between each matched first grid element and second grid element to determine a displacement vector matrix describing the displacement vector of each grid element; and estimating the error value for the sub-set of primary images based on the displacement vector matrix between the pair of primary images. dividing the first primary image into a plurality of first grid elements and dividing the second primary image into a plurality of second grid elements, matching first grid elements to second grid elements which correspond to the same position on the object, and determining a displacement vector between each matched first grid element and second grid element to determine a displacement vector matrix describing the displacement vector of each grid element; and estimating the error value for the sub-set of primary images based on the displacement vector matrix between the pair of primary images.