1. An image processing apparatus comprising: a determining unit configured to detect a plurality of candidate points being candidates of a contour of a subject based on distance image information of the subject in an image, and to determine an inspection-target area in the image based on the detected candidate points; and a specifying unit configured to detect line segments existing in the inspection-target area determined by the determining unit, based on luminance information of the inspection-target area, and to specify the line segment being the contour of the subject based on the candidate point from the detected line segments.