1. An image processing apparatus comprising: an image input device that receives an input of an image obtained by image pickup of a living mucous membrane having a three-dimensional structure; an extraction device that extracts pixels corresponding to the structure appearing as a continuous pattern in the image from pixels included in the image inputted to the image input device; a divarication portion identifying device that identifies a divarication portion from the pixels corresponding to the structure extracted by the extraction device; a segment division device that divides the pixels corresponding to the structure into a plurality of segments each including the divarication portion at an end; a calculating device that calculates information on at least one of contrast and color tone for each of the segments divided by the segment division device from pixels corresponding to the structure extracted by the extraction device; and a region division device that specifies a combination of segments that provides minimum information variation in each segment calculated by the calculating device, and extracts pixels corresponding to a structure that is continuous in a three-dimensional space from the specified combination of segments.