An image processing apparatus comprising: a first image acquisition section that acquires a first image obtained by taking an image of an object to be imaged at illumination-off time at which the object is not illuminated; a second image acquisition section that acquires a second image obtained by taking an image of the object at illumination-on time at which the object is illuminated; a difference image generation section that generates a difference image based on a difference between luminance of each of pixels constituting the first image acquired by the first image acquisition section and luminance of each of pixels constituting the second image acquired by the second image acquisition section; characterized by a high-luminance area extraction section that extracts an image area constituted by pixels having a luminance value which is equal to or more than a predetermined luminance value from the difference image generated by the difference image generation section; and a movement determination section that determines, based on the image area extracted by the high-luminance area extraction section, a movement amount of the object between image take timing of the first image and image take timing of the second image; an object area extraction section that extracts a pixel area corresponding to pixels having luminance value exceeding a predetermined threshold from the difference image, stores the extracted pixel area as an object-to-be-imaged mask, and extracts, from one of the first image and the second image, based on the object-to-be imaged mask, a pixel area corresponding to the object; and a correction processing section that corrects, based on the movement amount determined by the movement amount determination section, the position and the dimension of the area in the image from which the pixel area corresponding to the object was extracted, whereby said area corresponds to said extracted area, so that the position and dimension of said area become substantially the same as those of a pixel area corresponding to the object in the other one of the first and second image than the one from which the pixel area corresponding to the object was extracted, wherein the difference image generation section generates a corrected difference image between the first and second images after one of the images has been subjected to correction processing performed by the correction processing section. a first image acquisition section that acquires a first image obtained by taking an image of an object to be imaged at illumination-off time at which the object is not illuminated; a second image acquisition section that acquires a second image obtained by taking an image of the object at illumination-on time at which the object is illuminated; a difference image generation section that generates a difference image based on a difference between luminance of each of pixels constituting the first image acquired by the first image acquisition section and luminance of each of pixels constituting the second image acquired by the second image acquisition section; a high-luminance area extraction section that extracts an image area constituted by pixels having a luminance value which is equal to or more than a predetermined luminance value from the difference image generated by the difference image generation section; and a movement determination section that determines, based on the image area extracted by the high-luminance area extraction section, a movement amount of the object between image take timing of the first image and image take timing of the second image; an object area extraction section that extracts a pixel area corresponding to pixels having luminance value exceeding a predetermined threshold from the difference image, stores the extracted pixel area as an object-to-be-imaged mask, and extracts, from one of the first image and the second image, based on the object-to-be imaged mask, a pixel area corresponding to the object; and a correction processing section that corrects, based on the movement amount determined by the movement amount determination section, the position and the dimension of the area in the image from which the pixel area corresponding to the object was extracted, whereby said area corresponds to said extracted area, so that the position and dimension of said area become substantially the same as those of a pixel area corresponding to the object in the other one of the first and second image than the one from which the pixel area corresponding to the object was extracted, wherein the difference image generation section generates a corrected difference image between the first and second images after one of the images has been subjected to correction processing performed by the correction processing section.