1. An apparatus for measuring a distance to a target object and a shape of said target object with a range image obtained beforehand containing information of distances to objects including said target object, the improvement of the apparatus comprising: a range image obtaining means which obtains said range image, presenting signal levels changing according to said distances to the objects, by irradiating light onto the objects and receiving reflected light from the objects by a light receiving device; and a range image processing means which divides said obtained range image into a number of unit-range-images so as to discard every unit-range-image as noise if variation of a signal level in the unit-range-image exceeds a predetermined threshold, and to save every unit-range-image as usable range image if variation of signal levels in the unit-range-image dose not exceed the threshold.