In order to acquire height information regarding a subject disposed on the internal surface of an elongated tubular member, an image processing apparatus according to the present disclosure, includes a processor the processor including hardware and configured to perform the steps of receiving a first image and a second image acquired from a subject using an optical system having a field of view in a direction of at least about 90° to a central axis of the optical system, the first image acquired at a first position, the second image acquired at a second position, the second position different from the first position along the central axis; and calculating a distance between the subject and the central axis of the optical system, based on a distance between the first position and the second position, and based on the corresponding points in the third image and in the fourth image.