An image processing apparatus or the like, which is able to accurately distinguish a residue region from an intraluminal image, is provided. An image processing apparatus 1 includes, in an image processing apparatus that distinguishes from an intraluminal image obtained by imaging inside of a lumen of a subject a residue region where a residue is photographed: a residue candidate distribution determination unit 120 that determines color feature data distributed on a side comparatively strong in redness to be a mucosa distribution and determines color feature data distributed on a side comparatively weak in redness to be a residue candidate distribution, from among a distribution of color feature data of each pixel in the intraluminal image and a residue distribution determination unit 130 that determines a residue candidate distribution distributed on a side strong in yellowness with reference to the mucosa distribution to be a residue distribution.