We propose an edge-based depth-from-focus technique for high-precision non-contact industrial inspection and metrology
applications. In our system, an objective lens with a large numerical aperture is chosen to resolve the edge details of the
measured object. By motorizing this imaging system, we capture the high-resolution edges within every narrow depth
of field. We can therefore extend the measured range and keep a high resolution at the same time. Yet, on the surfaces
with a large depth variation, a significant amount of data around each measured point are out of focus within the captured
images. Then, it is difficult to extract the valuable information from these out-of-focus data due to the depth-variant blur.
Moreover, these data impede the extraction of continuous contours for the measurement objects in high-level machine
vision applications. The proposed approach however makes use of the out-of-focus data to synthesize a depth-invariant
smoothed image, and then robustly locates the positions of high contrast edges based on non-maximum suppression and
hysteresis thresholding. Furthermore, by focus analysis of both the in-focus and the out-of-focus data, we reconstruct the
high-precision 3D edges for metrology applications.