A position detecting program on a non-transitory computer-readable medium for causing a computer, which includes a goal-image storing unit that stores, according to sensitivity represented by an amount of change of a pixel value at the time when the target aligned with a goal position in image data at a pixel level is displaced by a displacement amount at a sub-pixel level, goal image data in a state in which the target is arranged, to execute:
- a calculation step of calculating a coincidence evaluation value of the target on the basis of comparison of image data including images of the target and the goal image data stored by the goal-image storing unit;
- and
- a detecting step of detecting positional deviation of the target with respect to the goal position on the basis of the calculated coincidence evaluation value.