1. An obstacle detecting apparatus comprising: a distance image obtaining section having a distance sensor, for measuring the distance of each measurement point of objects existing in a visual field in front of the distance sensor and obtaining a three-dimensional coordinate value for each measurement point, and generating a distance image based on the three-dimensional coordinate values of the measurement points; a histogram generating section for: projecting each measurement point of the objects onto a predetermined plane which is divided into grid cells; and calculating the number of the measurement points projected onto each grid cell in the plane, and generating a three-dimensional histogram indicating the distribution of the measurement points in the grid cells; and an obstacle map generating section for extracting one or more obstacles and generating an obstacle map based on the histogram, where the positional relationship between the distance sensor and each obstacle is determined by the obstacle map.