A High Precision Laser-Based Autofocus Method Using Biased Image Plane for Microscopy

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.


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 timeconsuming 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, opticbased autofocus methods adopt auxiliary optical paths for defocus detection, which have also been widely researched [6][7][8][9][10][11]. 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 fourquadrant 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. [8][9][10][11] 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.

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 f 1 is focal length of the objective lens, f 2 is the focal length of tube lens, δ is the defocus distance, L 1 ′ and L 1 are equivalent object distance and image distance of the objective system, L 2 ′ and L 2 are equivalent object distance and image distance of the tube lens system, U 1 ′ , U 1 , U 2 ′ , and U 2 are related maximum angles of incidence and emergence of the laser beam, R is the radius of the laser beam, and S 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 r is the radius of the laser spot, l = f 2 + d − L 2 , d is the offset distance between image plane and focal plane, and C 2 = Rd/f 2 = r 0 , r 0 is the radius of the laser spot when the sample is in focus.Notably, C 1 and C 2 are both constant values, which are only determined by optic parameters when the defocus value δ is small.

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 highspeed 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.

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 i ≤ n/3, n 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 T P i = P 1 i , P 2 i , P 3 i , in which P 1 i = X i , Y i , P 2 i = X i+ n/3 , Y i+ n/3 , and P 3 i = X i+ 2n/3 , Y i+ 2n/3 ; the following equation can be obtained using circumradius formula of triangle: where CR i is the circumradius value obtained from TP i , which is also the radius of the laser spot, l 1 i = norm 2 P 1 i , P 2 i , l 2 i = norm 2 P 2 i , P 3 i , and l 3 i = norm 2 P 1 i , P 3 i .
Then, a group of radiuses for the laser spot can be obtained, denoted with CR = CR i | i = 1, 2, 3, … , in which most are around the real value of laser spot's radiuses.However, there are still some odd values in CR that far from Objective lens Image plane Tube lens Laser beam

Inner focus
In focus Outer focus 3 Journal of Sensors statistics.Hence, the following section presents a K-meansbased clustering method to eliminate these odd values.

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 CR, μ 1 , where k is the total number of CR, μ 1 < μ 2 < μ 3 , and the corresponding clusters are named as C 1 , C 2 , and C 3 .
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.

Experiment and Analysis
An experimental device is constructed to test the proposed methods.The experimental device is composed of an infinity  ... 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   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.

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.

r 0 RFigure 4 :
Figure 4: Schematic diagram of the optical path of the proposed autofocusing method.

Figure 5 :
Figure 5: Procedures of the proposed laser spot processing algorithm.

Figure 8 :
Figure 8: Demonstration graph of the variation of the spot images at different defocuses.

Figure 9 :
Figure 9: Experimental results of the relationship between laser spot radius and defocus.