Patent ID: 8358424

Claim:
A distance measuring apparatus for measuring a distance between a front end part of a probe and a surface of a work, the apparatus comprising: the probe; a first light source for irradiating a light toward the probe; an imaging device; and a holding part which movably holds the probe, the first light source and the imaging device; wherein the imaging device is a device for obtaining an image of the probe and a secondary portrait of the probe, the secondary portrait being a shadow of the probe or a reflection of the probe shown at the surface of the work, and the distance measuring apparatus further comprises: a specifying device which specifies the front end part of the probe in the image; an inserting device which inserts, onto the image, a first straight line along an external edge of the secondary portrait in the image; a determining device which determines whether the front end part specified by the specifying device and the first straight line inserted by the inserting device overlap or not; and a calculating device that calculates the distance between the front end part and the surface of the work, wherein the calculating device calculates the distance as 0 when the determining device determines that the front end part and the first straight line overlap and calculates the distance based on a distance from the front end part in the image to the straight line in the image.