A vehicle-mounted detecting device and corresponding method for detecting
a distance between the vehicle and an object outside the vehicle. The
detecting device extracts edge intersection points from images of
individual frames photographed by a camera. A set of edge intersection
points for which the relative position in images does not change between
frames is then specified as an observation point group; the movement of
the specified observation point group in images is observed; and pitching
by the vehicle is detected. Any two points with differing heights on an
object present in an image are extracted as feature points, and after the
effect of pitching is eliminated from the feature points, the position of
a vanishing line in the image is calculated based on the ratio of the
velocities of the feature points in images after the length between the
two feature points and the effects of pitching are eliminated.