An image processing apparatus includes a distance information calculator that calculates distance information corresponding to a distance to an imaging object at each of portions in an image a feature data calculator that calculates feature data at each portion in the image a feature data distribution calculator that calculates a distribution of the feature data in each of regions that are classified according to the distance information in the image a reliability determining unit that determines the reliability of the distribution of the feature data in each of the regions and a discrimination criterion generator that generates, for each of the regions, a discrimination criterion for discriminating a specific region in the image based on a determination result of the reliability and the distribution of the feature data in each of the regions.