1. An image processing apparatus comprising: a line-candidate identifying unit that identifies a plurality of candidates of lines that constitute a contour of a subject region, on the basis of a captured image including an image of a subject captured with an imaging apparatus, the subject region corresponding to the image of the subject; a line-probability calculating unit that calculates, for each of the plurality of candidates identified by the line-candidate identifying unit, line probability information representing a probability that the candidates are a line that constitutes the contour of the subject region, on the basis of feature values that are determined on the basis of the captured image and that are of positions located at or within a reference distance from the candidates; a region-probability calculating unit that calculates region probability information representing a probability that a target region surrounded by a predetermined number of candidates chosen from the plurality of candidates identified by the line-candidate identifying unit is the subject region, on the basis of pieces of line probability information of the predetermined number of candidates; and a subject-region detecting unit that detects the subject region on the basis of the region probability information calculated by the region-probability calculating unit, wherein the region-probability calculating unit obtains, for one side of two adjacent sides that constitute a target region, feature values that are determined on the basis of the captured image and that are of positions located at or within a threshold distance from the side, and calculates the region probability information of the target region on the basis of the pieces of line probability information of the predetermined number of candidates and the obtained feature values, and wherein the region-probability calculating unit generates information regarding similarity between the feature values obtained for one of the two adjacent sides and the feature values obtained for the other of the two adjacent sides, and calculates the region probability information on the basis of the pieces of the line probability information of the predetermined number of candidates and the generated information.