Stereo matching involves searching for a corresponding point corresponding to each point of target image data that is stereo image data captured by one lens among stereo image data obtained by capturing a target object by means of a stereo camera incorporating two lenses from a search area of reference image data that is stereo image data captured by the other lens. The corresponding point determination method generally used is a method whereby a small area centered on a target point that is a target image data point is extracted, the extracted small area and a small area within a search area are compared, and whether or not image brightness patterns of the small areas are similar is determined using an evaluation value criterion such as an image brightness sum of absolute differences (SAD), sum of squared differences (SSD), normalized cross correlation (NCC), or the like.
However, if target objects include an object that includes consecutive similar patterns, such as a crosswalk, railing, or the like in which a bar-shaped or rectangular pattern is repeated, with SAD, SSD, or NCC a plurality of corresponding point candidates are calculated, and it is difficult in principle to calculate a true corresponding point.
As a conventional countermeasure even in a case in which a plurality of corresponding point candidates are calculated, there is a method whereby a corresponding point of the target point is considered to be unknown, and is not output (see Patent Literature 1, for example). There is also a method whereby a corresponding point is selected according to a control mode of applications, such as pre-crash control, inter-vehicle distance control involving a vehicle ahead, parking assist control, and so forth (see Patent Literature 2, for example). FIG. 12 shows a conventional stereo matching system described in Patent Literature 2.
In FIG. 12, stereo image data acquisition section 1202 acquires target image data captured by one lens and reference image data captured by another lens as a pair of image data captured simultaneously by a stereo camera incorporating two lenses.
Stereo matching section 1203 calculates a degree of difference between each point of target image data and a search point within a reference image data search area by means of SAD, and calculates a set of degrees of difference within the search area as an evaluation value distribution. Corresponding point candidate plurality presence determination section 1204 determines from the evaluation value distribution whether or not a plurality of corresponding point candidates are present.
Minimal evaluation value corresponding point calculation section 1205 calculates a search point for which an evaluation value that is a degree of difference of image brightness is minimal as a corresponding point candidate for a target point for which a plurality of corresponding point candidates are determined not to be present. Control mode data acquisition section 1206 acquires control mode data denoting a control mode.
For a target point for which a plurality of corresponding point candidates are determined to be present, control mode corresponding point calculation section 1207 selects the most distant corresponding point candidate if the control mode is pre-crash control, selects the nearest corresponding point candidate if the control mode is inter-vehicle distance control, and selects the nearest corresponding point candidate if the control mode is parking assist control.
Disparity data output section 1208 substitutes a corresponding point with the smallest evaluation value for a target point for which a plurality of corresponding point candidates are determined not to be present, substitutes a corresponding point selected according to the control mode for a target point for which a plurality of corresponding point candidates are determined to be present, and calculates disparity data for the target image data.