Abstract

This study designs and accomplishes a high precision and robust laser-based autofocusing system, in which a biased image plane is applied. In accordance to the designed optics, a cluster-based circle fitting algorithm is proposed to calculate the radius of the detecting spot from the reflected laser beam as an essential factor to obtain the defocus value. The experiment conduct on the experiment device achieved novel performance of high precision and robustness. Furthermore, the low demand of assembly accuracy makes the proposed method a low-cost and realizable solution for autofocusing technique.

1. Introduction

Autofocus is an important function of an autoscanning microscope. There have been countless camera-based products with autofocusing function, but most of these instruments adopt the image sharpness-based method to estimate the focal position. These methods are rather time-consuming since the prefocus process is a searching process over the whole focusing range with steps of different intervals [1, 2]. The focusing accuracy is often limited by the image content in the microscopic view [3]. Recent years, new methods have been developed with ingenious imaging skills and illumination designs. Chang et al. [4] proposed a defocus detection method using a bevel-axis imaging sensor, which stretches defocus images at the tilting direction. Liao et al. [5] developed a novel focus map surveying method using additional LED illumination and autocorrelation image analysis, which promised a turnkey solution for the most whole slide imaging (WSI) system.

Distinguished from the image-based methods, optic-based autofocus methods adopt auxiliary optical paths for defocus detection, which have also been widely researched [611]. Hsu’s team developed a laser-based autofocus system that had fast response characteristics [6]. The autofocus microscope system embedded an astigmatic lens to convert focus error signal to differential laser intensity on a four-quadrant photodiode. Rhee et al. improved the astigmatism method using two cylindrical lenses to enhance the astigmatic imaging and a circuitry controller for larger detection range and higher speed performance [7]. Laser-based method is less sensitive to contents in the field of view, but requires high reflective surface, which means it is more suitable for industrial inspections, such as glass surface and TFT-LCD inspection.

Liu et al. [811] proposed a laser-based autofocusing method using geometric optics to achieve fast and precise autofocus performance. In Liu et al.’s method, a knife was used to bisect the detecting laser beam for bidirectional defocus detection. The shortage of the bisected laser-based autofocusing method is that when the defocus is small, serious diffraction effects make the detected laser spot an irregular round spot. Liu et al. developed a centroid-based algorithm to weaken the diffraction effects. However, high precise assembly is still preferred to obtain a high linear accuracy near the neighborhood of focal position, which means high cost is required.

In the bisected laser-based autofocusing method, when defocus value varies from “inner focus,” “outer focus,” and “in focus,” the semicircular laser spot can theoretically image in three different states as illustrated in Figure 1. However, there are distortions and diffractions on the knife edge, which means a perfect semicircle can never be obtained. The diffraction effects seriously intensify when the defocus is near to zero. As a result, the laser spot will never be an ideal point. The linearity decreases when the scanning plane is near the ideal focal plane, which means low precision and bad performance. High cost is needed to improve the diffraction effects for high precision assembly and calibration.

To overcome the shortages of bisected laser-based autofocusing method, we modified the optical structure of the laser-based autofocus system and developed a high robust image processing method to achieve high precision autofocus performance. The remaining of the paper is organized as follows: Section 2 introduces characterized structure of the laser-based autofocus system, as well as the improved optical path using biased image plane adopted in this paper, Section 3 presents a laser spot processing algorithm using the laser spot radius for defocus value measurement, and Section 4 provides experiments of the proposed method.

2. The Proposed Method

Figure 2 illustrates the basic structure of the proposed autofocus system. Compared with the bisected laser-based autofocusing method, the knife used to blank the beam is removed to ensure that the beam image on the CCD is a complete circular spot. Apart from that, image plane of the focusing CCD does not have to be set on the focal plane but with an offset distance. Different from the conventional method, the spot is a complete round with different radiuses according to different defocuses as shown in Figure 3.

According to the geometric principle of the optical path illustrated in Figure 4, the following mathematical relationship in (1) can be obtained: where is focal length of the objective lens, is the focal length of tube lens, is the defocus distance, and are equivalent object distance and image distance of the objective system, and are equivalent object distance and image distance of the tube lens system, , , , and are related maximum angles of incidence and emergence of the laser beam, is the radius of the laser beam, and is the optic axis distance between objective lens and tube lens.

Then, an equation about the laser spot on image plane of focusing CCD can be obtained as follows: where is the radius of the laser spot, , is the offset distance between image plane and focal plane, , and , is the radius of the laser spot when the sample is in focus. Notably, and are both constant values, which are only determined by optic parameters when the defocus value is small.

3. Laser Spot Processing Algorithm

The proposed optics provides a promising linear relationship between defocus value and radius of the detected laser spot. However, processing of the laser spot is still an important issue that has impact on autofocus performances, because of the image noise, nonuniform lighting, assembly tolerances, and optical interferometry. In this section, a robust and high-speed laser spot processing algorithm is proposed.

As shown in Figure 5, there are several steps, from raw image to the result radius, including channel selection, binarization, border point extraction, triad point matching, radius calculation, and result clustering. Channel selection, binarization, and border point extraction could be taken as raw image preprocessing procedures in calculation of the radius of the laser spot; triad point matching and radius calculation compute a serial of spot radiuses from perspective of triangle circumcircle radius problem; and result clustering eliminates noise results with K-means clustering.

3.1. Raw Image Preprocessing

Filtering: use the median filter to remove some isolated points at the edge of the spot.

Binarization: converting the laser to a black and white image using the Otsu’s algorithm. When the light intensity distribution of the laser spot or the background is uneven, gamma correction could be used to obtain a balanced laser spot and background.

Border point extraction: retrieving the border points of the laser spot using a traversal method.

3.2. Triangle Circumcircle Radius Problem

Triad point matching: construct a series of triangles with the border points as shown in Figure 5. Note that the triangles should approximate equilateral triangle to weaken the noise sensitivity of side length, since the border points are not ideally distributed on the circumcircle. Hence, trisection intervals are preferred in triad point matching as illustrated in Figure 6, which means the matched triad points could be expressed with a triple as follows: where , is the total number of the border point list. In this research, a systematic sampling method is applied to reduce the computational cost.

Radius calculation: for each matched point triangle , in which , , and ; the following equation can be obtained using circumradius formula of triangle: where is the circumradius value obtained from , which is also the radius of the laser spot, , , and .

Then, a group of radiuses for the laser spot can be obtained, denoted with , in which most are around the real value of laser spot’s radiuses. However, there are still some odd values in that far from statistics. Hence, the following section presents a K-means-based clustering method to eliminate these odd values.

3.3. K-Means-Based Result Denoising

Based on the assumption that there are totally three kinds of distribution of border points extracted from the raw image, that is, outer border, on border and inner border, which lead to the spot results smaller, approximate, and larger than real spot radius, we apply three clusters in K-means-based result denoising and adopt medium cluster to filter the large deviation results. A brief description of K-means-based denoising is as follows: (1)Initialize 3 cluster centroids from data set , , where is the total number of , , and the corresponding clusters are named as , , and .(2)Repeat until convergence:{For each spot radius result , set . For each , set }(3)The denoised laser spot radius , the centroid of .

Figure 7 illustrates the effect of K-means-based result denoising, in which noise in the results that obviously offset from the final results has been eliminated, leaving only blue points in the diagram effective results.

4. Experiment and Analysis

An experimental device is constructed to test the proposed methods. The experimental device is composed of an infinity objective lens (10x, 0.25) and imaging optical path, autofocus optical path and lens driver (0.5 μm resolution), laser detection CCD (2/3, 1360 × 1024, 20 fps), computer, and control system.

A serial of experiment is designed and implemented to test the performance of the proposed method. In this experiment, image sharpness-based autofocus method is applied to obtain the focal plane of the objective lens, which is assigned to be the initial position of defocus detection. Then, lens driver is controlled to generate high accuracy displacement at an interval of about 2.5 μm, leading to a high accuracy defocus that is much less than the depth of field of the objective lens (at about 3.6 μm). Raw images of the detected laser spot are captured at each defocus, and the radius value of the laser spot is calculated. Then, a relationship between laser spot diameter and defocus value can be obtained.

Figure 8 proposes a group of raw image data in the experiment. It is necessary to point out that the proposed method also requires high refractive surface as other laser-based methods. When the refractive surface is not flat or the surface is not perpendicular to the optical path, distortions of laser spots will occur. Figure 9 illustrates the curve of the relationship between the laser spot radius and the defocus value. Standard calibration slice and image-based autofocus method are applied to determine the in focus position and the radius of the laser spot at in focus position. The experiment results demonstrate good linear characteristics. The linear sensitivity of the experiment device is about 0.65 pixels/μm. The maximum linearity error is at about 1.46 pixel (about 0.95 μm) with a linear accuracy at about 0.37%. The linearity error distribution is shown in Figure 10, and the average detection error is 0.44 pixels (about 0.3 μm). What is more, the experiment results also propose a good performance (about 0.6 μm detection error), when the defocus is at about zero, which means influences of diffraction effects near the focal position have been effectively weakened. The image processing is implemented on a MATLAB platform, Win7 x64 environment, Intel® Core™ i7-3770 CPU; the average time cost for defocus calculation is about 21.2 ms in 400 tests. That means the proposed method can support 50 cycles of autofocus operation per second, which is much higher than the most CCD frame rate. The performance will be much better if the program is transplanted to C language.

5. Conclusion

This study proposes a high precision and robust laser-based autofocusing system, in which a biased image plane is applied. Compared to the bisected laser-based autofocusing method, the laser spot used for defocus detecting is circular, since there is no knife edge in the optical path. The proposed method utilizes the radius of the circular laser spot for defocus value measurement, and the distortions and diffractions on the knife edge have been eliminated. Diffraction effects near the focal position which serious influences the autofocus accuracy is significantly weakened as well, because the laser spot has a considerable radius value when the objective is in focus. The relationship between the laser spot radius and defocus value has been presented, which shows that they are linearly correlated with each other when the defocus is small. A laser spot processing algorithm has been also proposed, in which K-means-based denoising is applied. An experimental device has been constructed. The experiment results show that the proposed method proposes good linear characteristics and requires low assembly accuracy, which means low costs and robust performances.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work was supported by National Instrument Development Special Program of China under the Grant 2013YQ030651 and National Natural Science Foundation of China under the Grant 61503243.