Provided is an image processing apparatus or the like capable of accurately performing discrimination on whether or not an area where a subject is in a specific state is included in an image with respect to images acquired by capturing the inside of a living body, with simple arithmetic processing. An image processing apparatus that performs image processing based on image data representing an image of a subject output from an imaging unit and distance measurement data representing a distance to the subject, the image processing apparatus including: a depth image creation unit 337 that calculates a depth from the imaging unit to the subject based on the distance measurement data a subject distance calculation unit 336 that calculates a subject distance between the imaging unit and the subject based on the image data a difference calculation unit 338 that calculates a difference between the depth calculated by the depth image creation unit 337 and the subject distance calculated by the subject distance calculation unit 336 and a discrimination unit 339 that discriminates whether or not an area where a surface of the subject is in a specific state is included in an image in which the subject is imaged based on the difference calculated by the difference calculation unit 338.