Provided is an image processing apparatus, or the like, capable of obtaining high-accuracy depth information without drastically increasing the data processing amount on an imaging unit and data communication amount with the imaging unit. The image processing apparatus is configured to perform image processing based on image data representing an image of a subject and ranging data representing a distance to the subject output from the imaging unit. The image processing apparatus includes: an illumination light distribution characteristic calculation unit 332 that calculates a parameter of illumination light emitted onto the subject based on the ranging data; a reflected light distribution characteristic calculation unit 334, that calculates a parameter of reflected light of the illumination light reflected from the subject, based on a gradient of a depth on a point on the subject calculated from the ranging data; and a subject distance calculation unit 340 that calculates a depth from the imaging unit to the subject in an optical axis direction of a collection optical system, based on the image data, the parameter of the illumination light calculated the illumination light distribution characteristic calculation unit 332, and the parameter of the reflected light calculated by the reflected light distribution characteristic calculation unit 334.