To provide an image processing apparatus and the like capable of accurately determining the residual range from the intraluminal image. The image processing apparatus 1, from the intraluminal image obtained by imaging the lumen of the subject, an image processing apparatus for determining a remaining gamut residue was photographed, the distribution of the color characteristic amounts for each pixel in the intraluminal image Among them, the color feature distributed in the strong side of the relatively redness determined that the mucosa distribution, and judges residue candidate distribution determination section 120 color feature that relatively redness is distributed to the weak side as a residue candidates distribution, The residue candidate distribution distributed in the strong side of the yellowish mucosal distribution as a reference and a determined residue distribution determination section 130 as the remaining cloth.管腔内画像から残渣領域を精度良く判別することができる画像処理装置等を提供する。画像処理装置1は、被検体の管腔内を撮像した管腔内画像から、残渣が写った残渣領域を判別する画像処理装置において、管腔内画像内の各画素の色特徴量の分布のうち、相対的に赤みの強い側に分布する色特徴量を粘膜分布と判定し、相対的に赤みが弱い側に分布する色特徴量を残渣候補分布として判定する残渣候補分布判定部120と、粘膜分布を基準として黄みの強い側に分布する残渣候補分布を残渣分布として判定する残渣分布判定部130とを備える。