1. An image processing apparatus comprising: a processor; and a memory storing computer readable instructions that, when executed by the processor, implement: an image acquisition section that acquires a plurality of images that differ in in-focus state through an objective lens; a reference point setting section that performs a reference point setting process on each of the plurality of images, the reference point setting process setting a reference point that is set to an attention area; a contrast information calculation section that calculates a contrast of each of at least two images among the plurality of images in an area corresponding to the reference point; a distance estimation section that estimates distance information about a distance to a corresponding point based on the contrast of each of the at least two images, and a contrast curve that indicates a relationship between a distance from the objective lens and a contrast of the objective lens at an arbitrary spatial frequency, the corresponding point being a point in real space that corresponds to the reference point; and an additional information generation section that generates additional information based on the estimated distance information, the additional information being information that is added to the attention area to which the reference point is set.