1. An image processing apparatus comprising: a gradient strength calculating unit that calculates gradient strength of a pixel value of each pixel of an intraluminal image that is a captured image of an intralumen; a closed region extracting unit that extracts a closed region from the intraluminal image, the closed region satisfying conditions that the pixel of which gradient strength is a predetermined value or more is not included in the closed region and a boundary of the closed region does not bend with predetermined curvature or higher toward an inner side of the closed region; and an abnormal portion detecting unit that detects an abnormal portion located inside the closed region, wherein the closed region extracting unit includes an initial closed region setting unit that sets an initial closed region having an initial shape of the closed region based on the gradient strength; an energy calculating unit that calculates values of a plurality of types of energy that at least include energy determined based on an outer shape of the closed region and energy determined based on the gradient strength on the boundary of the closed region; and an energy weighted-sum calculating unit that calculates a weighted sum of the plurality of types of energy, the closed region is extracted by transforming the initial closed region based on the weighted sum, and the initial closed region setting unit includes a range determining unit that determines a set range of the initial closed region based on the gradient strength.