1. An image processing apparatus comprising: an image input section via which a medical image picked up of a mucous surface of a living body, the medical image including a plurality of pixels, is inputted; a region setting section that sets a first region including one or more pixels in the medical image; a feature value calculating section that calculates a degree of linearity representing a degree of the first region having a characteristic of a linear shape and a degree of circularity representing a degree of the first region having a characteristic of a circular shape based on a luminance value of the first region set by the region setting section and a luminance value of a region in a periphery of the first region; and the region setting section further setting a second region which includes one or more pixels in a peripheral portion of the first region based on the degree of linearity and the degree of circularity calculated by the feature value calculating section, the feature value calculating section further calculating a degree of linearity representing a degree of the second region having a characteristic of a linear shape and a degree of circularity representing a degree of the second region having a characteristic of a circular shape based on the luminance value of the second region, a basic shape matching section that matches the first region with a predetermined shape based on distributions of the degree of linearity and the degree of circularity of the first region and the degree of linearity and the degree of circularity of the second region calculated by the feature value calculating section.