Acta Optica Sinica, Volume. 43, Issue 9, 0912001(2023)

Sharpness Evaluation Function for Line Patterns in Focal Length Measurement

Jihao Liu, Rongsheng Lu*, Zilong Zhang, and Ailin Zhang
Author Affiliations
  • School of Instrument Science and Opto-Electronics Engineering, Hefei University of Technology, Hefei 230009, Anhui, China
  • show less

    Objective

    When the focal length of a lens is measured by the magnification method, a microscope is used to obtain a line pattern image of the Perot plate. Line pair spacing is then measured to determine the focal length of the lens and the coordinates of its focal point. Consequently, the sharpness of the line pattern image, namely, the focusing accuracy, affects the measurement accuracy of the focal length and focal coordinates of the lens. Due to its poor accuracy, inefficiency, and subjectivity, manual focusing has been gradually replaced by autofocusing. Currently, a grayscale-based evaluation function is frequently employed to determine the sharpness of a microscopic image. Although increasing the calculable directions of the evaluation function in a haphazard manner may improve the robustness of the function to some degree, it considerably prolongs the focusing time. To address the aforementioned issue, this study, starting from a line pattern's grayscale distribution, designs an evaluation function that retains favorable robustness and focusing accuracy without extending the focusing time when the angle of the line pattern varies.

    Methods

    The direction of the line pattern is correlated with the grayscale distribution of the line pattern's edges. Grayscale variation is not apparent in the direction along the line pattern. In contrast, the grayscale value varies drastically in the direction perpendicular to the line pattern. A larger amplitude of the grayscale operator in the evaluation function corresponds to a smaller effect of noise on the evaluation function. Consequently, obtaining the angle of the line pattern and introducing the evaluation function are applicable to the autofocusing of line patterns. Specifically, Hough transform-based line detection is performed on the first image acquired (the image with a large defocusing amount). Being highly resistant to interference, Hough transform-based line detection is able to overcome negative effects, such as edge loss due to defocusing and more precisely determine the angle of a blurred line pattern. With due consideration given to the angle of the line pattern, a Hough transform-based sharpness evaluation function for line patterns is constructed to ensure that the direction of the grayscale operator in the function is always perpendicular to that of the line pattern. The proposed function is utilized for autofocusing under various angles of the line pattern to quantitatively evaluate the performance of the evaluation function and to investigate the effect of the angle of the line pattern on the performance of the evaluation function.

    Results and Discussions

    To accommodate the strong directionality and uncertain direction of the line pattern, this study presents a Hough transform-based sharpness evaluation function for line patterns without sacrificing focusing efficiency. The proposed function improves the robustness of focusing and ensures high focusing efficiency. For line patterns with different defocusing amounts, Hough transform-based line detection can obtain their angles accurately. Moreover, the deviation of the angle of the line pattern obtained is invariably smaller than 2° (Table 2), indicating that the performance of the evaluation function is essentially unaffected. For line patterns at different angles, the Hough transform-based grayscale function exhibits small fluctuations in the smooth area, strong noise immunity, and favorable stability when the image is heavily defocused (Fig. 6). Additionally, the mean of the smooth area of the evaluation curve is 0.051, and its maximum fluctuation rate is 16.60%. The standard deviation of this area is 0.037 (Tables 3-7). Near the in-focus position, the focusing error is small, and the device has high focusing accuracy (Fig. 6), with a deviation smaller than 0.1 steps from the in-focus position (Tables 3-7). The Hough transform-based grayscale function also outperforms the conventional evaluation function (Fig. 6) in that it reduces the mean of the smooth area, the standard deviation, and the focusing deviation by 59.85%, 46.05%, and 92.63%, respectively, on average. Since the function has just one gradient operator, the computational effort is saved markedly, and the average running time is reduced by as much as 36.37% (Tables 3-7). In the measurement of a lens' focal length, the relative error in the focal length is reduced by 62.12% (Table 8).

    Conclusions

    In this study, a Hough transform-based sharpness evaluation function for line patterns is constructed. This function can be used to accurately detect the angle of defocused line patterns by Hough transform-based line detection, and it incorporates the angle of the line pattern into the construction of the evaluation function. The grayscale operator in the evaluation function is perpendicular to the direction of the line pattern, and the grayscale value of the pixels perpendicular to the line pattern changes drastically with a large amplitude of the gradient operator. The grayscale value and distribution of the noise in the image of the line pattern are random, and the proposed evaluation function does not amplify the effect of the noise. The noise immunity is thereby enhanced. The experimental results show that the focusing accuracy and stability of the Hough transform-based grayscale function are not affected by the angle of the line pattern in the Perot plate. This function can prevent the search algorithm from falling into the trap of local extremes. Its focusing accuracy and focusing speed are also superior to those of the conventional focusing function, enabling it to meet the need for rapid and accurate focusing. In the measurement of a lens' focal length, the improvement of focusing accuracy ensures the measurement accuracy of line pair spacing, which in turn improves the measurement accuracy of focal length. As a result, the relative error in the focal length is reduced by 62.12%. The proposed Hough transform-based sharpness evaluation function for line patterns can effectively improve the accuracy and operational efficiency of autofocusing in focal length measurement. It has practical significance for images with obvious directionality, such as those in defect detection, microscopic workpiece measurement, and pathological analysis.

    Tools

    Get Citation

    Copy Citation Text

    Jihao Liu, Rongsheng Lu, Zilong Zhang, Ailin Zhang. Sharpness Evaluation Function for Line Patterns in Focal Length Measurement[J]. Acta Optica Sinica, 2023, 43(9): 0912001

    Download Citation

    EndNote(RIS)BibTexPlain Text
    Save article for my favorites
    Paper Information

    Category: Instrumentation, Measurement and Metrology

    Received: Oct. 12, 2022

    Accepted: Dec. 5, 2022

    Published Online: May. 9, 2023

    The Author Email: Lu Rongsheng (rslu@hfut.edu.cn)

    DOI:10.3788/AOS221813

    Topics