A computer readable storage medium storing instructions of a computer
program which when executed by a computer results in performance of steps
including inputting a first image and a second image from two cameras,
respectively, transforming the first image to a transformed image,
obtaining a degree of similarity D indicating similarity between an image
in a processing region established in the second image and an image in a
corresponding processing region established in the first image, obtaining
a degree of similarity P indicating a similarity between an image in the
processing region established in the second image and an image in a
corresponding processing region established in the transformed image,
detecting the obstacle based on of the degree of similarity D and the
degree of similarity P on a reference plane region, obtaining a
difference K between the degree of similarity D and the degree of
similarity P both obtained as being on the reference plane region,
judging that the obstacle is at a position where the difference K is
large, judging that there is no obstacle when there is no difference K of
degree of similarity equal to or greater than a threshold value set
beforehand about the vertical directions of all of the images, and
detecting that there is the obstacle when there is the difference K of
degree of similarity equal to or more than the threshold value in the
vertical direction of the image.