1. An image inspection apparatus for performing visual inspection of a moving workpiece, the apparatus comprising: three or more illumination sections for illuminating the workpiece from mutually different illumination directions; an illumination controlling section for turning on the three or more illumination sections one by one in a predetermined turning-on order or simultaneously turning on the three or more illumination sections; an imaging section for capturing an image of the workpiece from a certain direction at illumination timing for turning on each of the illumination sections by the illumination controlling section, to capture a plurality of partial illumination images with different illumination direction, a first reference image by simultaneously turning on the three or more illumination sections, and a second reference image at imaging timing temporally after the first reference image; a tracking target image designating section for designating a tracking target image which is included in the first reference image and is used for tracking a position of the workpiece; a corresponding position estimating section for searching a position of the tracking target image designated by the tracking target image designating section from the second reference image, and specifying a position including the tracking target image in the second reference image, to estimate a corresponding relation of pixels that correspond among each of the partial illumination images based on the specified position; and an inspection image generating section for generating an inspection image for photometric stereo based on the corresponding relation of each of the pixels of the partial illumination images estimated by the corresponding relation estimating section.