An image processing apparatus for detecting a road surface, comprising: a plurality of image capturing units; a generating unit configured to generate, from a disparity image including disparity values, each corresponding to a distance to a road surface, obtained from a plurality of captured images respectively captured by the plurality of image capturing units, a frequency distribution of disparity values in the disparity image for each of a plurality of vertical positions in the disparity image transverse to a spacing direction of the image capturing units; a selecting unit configured to select candidate road surface points from the generated frequency distribution of disparity values; a sample point extracting unit configured to extract sample points from the candidate road surface points; an out-of-range point removing unit configured to remove points from the sample points extracted by the sample point extracting unit; and a detecting unit configured to detect a road surface based on sample points extracted by the sample point extracting unit that have not been removed by the out-of-range point removing unit, wherein the selecting unit selects the candidate road surface points by, for each of a plurality of horizontal buffer ranges in the frequency distribution which are shifted in disparity value with respect to each other, for a given vertical position in the frequency distribution, adding up the frequencies of a plurality of disparity values included in the horizontal buffer range to form a respective addition value, and selecting the candidate road surface points as the horizontal buffer ranges for which the addition value is highest; and wherein the sample point extracting unit is operative to set a search range in the frequency distribution and to extract sample points from candidate points in the search range, by extracting one or more points with respect to each disparity value in the search range, and wherein the out-of-range point removing unit is operative to calculate an approximate straight line in the frequency distribution using the sample points extracted by the sample point extracting unit and to remove sample points lying further than a threshold value from the calculated straight line. a plurality of image capturing units; a generating unit configured to generate, from a disparity image including disparity values, each corresponding to a distance to a road surface, obtained from a plurality of captured images respectively captured by the plurality of image capturing units, a frequency distribution of disparity values in the disparity image for each of a plurality of vertical positions in the disparity image transverse to a spacing direction of the image capturing units; a selecting unit configured to select candidate road surface points from the generated frequency distribution of disparity values; a sample point extracting unit configured to extract sample points from the candidate road surface points; an out-of-range point removing unit configured to remove points from the sample points extracted by the sample point extracting unit; and a detecting unit configured to detect a road surface based on sample points extracted by the sample point extracting unit that have not been removed by the out-of-range point removing unit,