A method and system for detecting autofocus accuracy of fully automatic microscopic imaging instrument
Through multiple focusing methods and clarity evaluation algorithms, the convenience of focusing accuracy detection of fully automatic microscope imager is solved, and fast and simple focusing accuracy detection and evaluation is achieved, reducing cost and operational complexity.
Patent Information
- Application Number
- CN202411254156.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2044-09-09
AI Technical Summary
In the prior art, the automatic focus accuracy detection of fully automatic microscope images relies on high-precision measurement instruments, which are expensive and complex in operation, making it difficult to achieve instant and convenient accuracy verification in industrial production lines or on-site.
The multi-focusing method is adopted, and the focusing technology of the fully automatic microscope imager itself is used to calculate the focus accuracy through the multi-focus and clarity evaluation algorithm, including the determination of the focus interval, the multi-focus and the acquisition of the focus position, and finally calculate the focus accuracy.
It enables rapid and simple detection and evaluation of the focus accuracy of fully automatic microscope images without the help of additional equipment, improving the convenience and economicality of detection.
Smart Images

Figure CN119043156B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of instrument detection, and more particularly to an automatic focusing accuracy detection method and system for a fully automatic microscopic imaging instrument. Background Art
[0002] With the rapid advancement of science and technology, fully automated microscopes have become indispensable in diverse fields of modern society, including biomedical research, materials science analysis, semiconductor testing, precision manufacturing, and military reconnaissance. Their core technology—autofocus, a prominent example of optomechanical integration—has not only significantly improved imaging quality and efficiency but also promoted advancements in automation and intelligence. This technology precisely controls the movement of the imaging device in the Z-axis, combined with efficient image clarity assessment algorithms, to achieve rapid and precise focusing on target samples.
[0003] However, although autofocus technology has matured in theory and is widely used in various microscopy imaging systems, its real-time detection and evaluation mechanism for focusing accuracy faces many challenges. Traditional detection methods often rely on high-precision measuring instruments such as laser interferometers and high-precision translation stages. These devices are not only expensive but also complex to operate, making it difficult to achieve instant and convenient accuracy verification in actual working environments. In addition, for industrial production lines or on-site inspection tasks that are far away from laboratory environments and require rapid response, frequently using external detection instruments to verify focus accuracy is obviously impractical.
[0004] Therefore, it is an urgent problem for those skilled in the art to provide a simple and efficient method and system for detecting the autofocus accuracy of a fully automatic microscope imager. Summary of the Invention
[0005] In view of this, the present invention provides an automatic focusing accuracy detection method and system for a fully automatic microscopic imager, which utilizes the focusing technology of the fully automatic microscopic imager itself (whether based on the built-in OpenCV algorithm such as Canny, Tenengrad or other clarity evaluation algorithms, or the focusing algorithm / method developed by the fully automatic microscopic imager manufacturer itself) and adopts a multiple focusing method to calculate the focusing accuracy of the fully automatic microscopic imager without the need for additional focusing accuracy equipment.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for detecting the autofocus accuracy of a fully automatic microscopic imaging instrument comprises the following steps:
[0008] Performing automatic focusing on the fully automatic microscopic imaging instrument to obtain a precise focusing range of the fully automatic microscopic imaging instrument;
[0009] Selecting multiple different step lengths to perform multiple autofocuses in the precise focus interval to obtain multiple focus positions;
[0010] Calculating the automatic focusing accuracy of the fully automatic microscopic imager according to the multiple focus positions;
[0011] Evaluate whether the fully automatic microscopic imager meets the standards based on the autofocus accuracy, and output the evaluation result.
[0012] Preferably, performing automatic focusing on the fully automatic microscopic imager to obtain a precise focusing range of the fully automatic microscopic imager comprises:
[0013] Obtaining a sharpness value curve within the focus range of a fully automatic microscopic imaging instrument;
[0014] Dividing the clarity value curve into a number of equal parts;
[0015] Obtain the sharpness values of the equally divided positions, and select several equally divided intervals adjacent to the maximum sharpness value on both sides to form a precise focus interval.
[0016] Preferably, obtaining a sharpness value curve within a focus range of a fully automatic microscopic imager includes:
[0017] Imaging is performed at a certain step length within the focus range of the fully automatic microscopic imager, and a clarity curve is generated according to the imaging position and the corresponding clarity value.
[0018] Preferably, calculating the automatic focusing accuracy of the fully automatic microscopic imager according to the multiple focus positions includes:
[0019] Calculate the average value of the Z-axis positions of the multiple focus positions
[0020]
[0021] Where n is the number of autofocus times; P i is the Z-axis position of the focus after the i-th autofocus;
[0022] The relative deviation S is calculated according to the Bessel formula:
[0023]
[0024] According to the average value of the Z-axis position The focusing accuracy CV of the automatic microscopic imager autofocus is calculated using the relative deviation S:
[0025]
[0026] In another aspect, the present invention provides an automatic focusing accuracy detection system for a fully automatic microscopic imaging instrument, comprising:
[0027] A focus interval determination module, configured to automatically focus the fully automatic microscopic imager once to obtain a precise focus interval of the fully automatic microscopic imager;
[0028] A focusing module, configured to select a plurality of different step lengths to perform multiple autofocuses in the precise focusing interval to obtain a plurality of focus positions;
[0029] A focusing accuracy calculation module, configured to calculate the automatic focusing accuracy of the fully automatic microscopic imaging instrument according to a plurality of focus positions;
[0030] An output report module is used to evaluate whether the fully automatic microscopic imager meets the standards based on the autofocus accuracy and output the evaluation result.
[0031] Preferably, the focusing module includes:
[0032] A clarity curve acquisition unit, used to obtain a clarity value curve within a focus range of the fully automatic microscopic imaging instrument;
[0033] an equal division unit, configured to divide the clarity value curve into a plurality of equal parts;
[0034] The interval selection unit is used to obtain the clarity value of the equally divided position and select several equally divided intervals adjacent to the maximum clarity value on both sides to form a precise focus interval.
[0035] As can be seen from the above technical solution, compared with the prior art, the present invention provides a method and system for detecting the autofocus accuracy of a fully automatic microscopic imaging instrument. This method uses a multiple focus method to quickly find the camera's focus and, through repeated autofocus cycles, calculates the device's focus accuracy. This method can automatically detect and evaluate the focus accuracy of a fully automatic microscopic imaging instrument using simple tools, without the need for other instruments. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0037] Figure 1 A flow chart of the method provided by the present invention;
[0038] Figure 2 It is a clarity curve graph;
[0039] Figure 3 This is a structural diagram provided by the present invention. DETAILED DESCRIPTION
[0040] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0041] The embodiment of the present invention discloses a method for detecting the autofocus accuracy of a fully automatic microscopic imaging instrument, such as Figure 1 As shown, the following steps are included:
[0042] Use a commonly used tool such as a stage ruler to place it on the stage of the fully automated microscope. Using the microscope's own focusing algorithm / method, perform an automatic focus on the fully automated microscope to obtain the precise focus range. The selected precise focus range includes the focal point and its vicinity.
[0043] Select multiple different step sizes to perform multiple autofocuses in the precise focus interval to obtain multiple focus positions. Specifically, the fully automatic microscope imager selects different step sizes within the autofocus interval (the step size can be selected from different values according to the size of the precise focus interval), obtains the clarity value each time, and finally selects the maximum clarity value as the origin, selects multiple step sizes around the origin as the interval for refocusing, and then starts focusing. The above steps can be repeated many times, and finally the minimum step size of the fully automatic microscope imager is used for precise focusing, which can locate the optimal clarity value position, that is, the focus position. The above focusing process can select the step size and the number of focuses based on the Z-axis travel of the fully automatic microscope imager, so as to quickly find the focus.
[0044] The autofocus accuracy of the fully automatic microscope is calculated based on multiple focus positions. Under the same camera parameters and light intensity, the Z-axis position after autofocus is theoretically the same. In practice, under the same conditions, there is still a certain deviation in the focus position of the autofocus. Then the coefficient of variation of the focus data of the Z axis after autofocus is used as the accuracy of the autofocus. According to the above method, the autofocus is repeated n times, and the single Z-axis data obtained by the test is P i .
[0045] Whether the fully automatic microscopic imager meets the standards is evaluated based on the autofocus accuracy, and the evaluation result is output to achieve the detection and evaluation of the fully automatic microscopic imager.
[0046] In this embodiment, the device has a Z-axis travel of 10,000 microns, with a minimum step of 1 micron. Autofocus is performed using a secondary focus method, with the initial focus step size being 60 microns. After 166 movements, a position with maximum sharpness is obtained. Secondary focus is then performed within a range of 120 microns, selecting two positions before and after this position. This is followed by 240 movements to obtain the optimal sharpness. Repeating these steps, the average Z-axis value and focus accuracy after autofocus can be calculated.
[0047] Specifically, the fully automatic microscopic imager is automatically focused once to obtain a precise focusing range of the fully automatic microscopic imager, including:
[0048] Obtain the clarity value curve within the focus range of the fully automatic microscope; Figure 2 Shown is a clarity curve of the fully automatic microscope at the corresponding positions from the starting point of the Z axis to the end point of the Z axis. In the figure, the x-axis represents the Z-axis position data of the fully automatic microscope, and the y-axis represents the clarity value.
[0049] Divide the clarity value curve into several equal parts; there is a Z-axis position corresponding to the maximum value between the starting point and the end point of the Z-axis of the fully automated microscope, which is called the imaging focus. As can be seen from the above figure, if the starting point and the end point of the above figure are divided into several equal parts on the x-axis, and the values are taken at the equal parts, the maximum value obtained will definitely be the position closest to the peak.
[0050] Obtain the sharpness values at the equal-division positions and select several equal-division intervals adjacent to the maximum sharpness value on either side to form a precise focus interval. Select multiple equal-division lengths (typically two equal-division lengths) on either side of the maximum value to include the maximum value, and repeat the above steps within the selected interval. Finally, using the minimum accuracy of the fully automated microscope's Z axis as the step size, the focus position corresponding to the peak value can be obtained.
[0051] In another embodiment, obtaining a sharpness value curve within a focus range of a fully automatic microscopic imaging instrument includes:
[0052] Imaging is performed at a certain step length within the focus range of the fully automatic microscope, and a clarity curve is generated based on the imaging position and the corresponding clarity value.
[0053] Specifically, the instrument's minimum step (usually 1 μm) is used to capture the distance from -1 mm (starting position) to +1 mm (end position) of the focus. A crosshair, C-shaped ruler, or standard circle is used as an imaging display element. The imaging element is placed on the stage for imaging. The image is taken every 1 μm, and the image is plotted according to the clarity value. Figure 2The clarity curve shown shows that there is no repeatability error because the Z-axis uses minimum step and continuous displacement.
[0054] Furthermore, the autofocus accuracy of the fully automatic microscopic imager is calculated based on multiple focus positions, including:
[0055] Calculate the average Z-axis position of multiple focus positions
[0056]
[0057] Where n is the number of autofocus times; P i is the Z-axis position of the focus after the i-th autofocus;
[0058] The relative deviation S is calculated according to the Bessel formula:
[0059]
[0060] According to the average value of the Z-axis position The focus accuracy CV of the fully automatic microscopic imaging instrument is calculated using the relative deviation S:
[0061]
[0062] On the other hand, Figure 3 As shown, the present invention provides an automatic focusing accuracy detection system for a fully automatic microscopic imaging instrument, comprising:
[0063] A focus interval determination module is used to automatically focus the fully automatic microscopic imager once to obtain a precise focus interval of the fully automatic microscopic imager;
[0064] A focusing module is used to select multiple different step lengths to perform multiple autofocuses in a precise focusing range to obtain multiple focus positions;
[0065] A focus accuracy calculation module is used to calculate the autofocus accuracy of the fully automatic microscopic imager based on multiple focus positions;
[0066] The output report module is used to evaluate whether the fully automatic microscopic imager meets the standards based on the autofocus accuracy and output the evaluation results.
[0067] Furthermore, the focusing module includes:
[0068] A clarity curve acquisition unit, used to obtain a clarity value curve within a focus range of the fully automatic microscopic imaging instrument;
[0069] An equal division unit is used to divide the clarity value curve into several equal parts;
[0070] The interval selection unit is used to obtain the clarity value of the equally divided position and select several equally divided intervals adjacent to the maximum clarity value on both sides to form a precise focus interval.
[0071] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0072] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting the autofocus accuracy of a fully automatic microscopic imaging instrument, characterized in that: The following steps are involved: Performing automatic focusing on the fully automatic microscopic imaging instrument to obtain a precise focusing range of the fully automatic microscopic imaging instrument; Selecting multiple different step lengths to perform multiple autofocuses in the precise focus interval to obtain multiple focus positions; Calculating the autofocus accuracy of the fully automatic microscopic imager according to the multiple focus positions; Calculating the autofocus accuracy of the fully automatic microscope imager according to the plurality of focus positions includes: Calculate the average value of the Z-axis positions of the multiple focus positions Where n is the number of autofocus cycles; Pi is the Z-axis position of the focus after the i-th autofocus cycle; The relative deviation S is calculated according to the Bessel formula: According to the average value of the Z-axis position The focusing accuracy CV of the automatic microscopic imager autofocus is calculated using the relative deviation S: Evaluate whether the fully automatic microscopic imager meets the standards based on the autofocus accuracy, and output the evaluation result.
2. The method for detecting the autofocus accuracy of a fully automatic microscopic imager according to claim 1, wherein: Performing an automatic focusing operation on the fully automatic microscopic imager to obtain a precise focusing range of the fully automatic microscopic imager includes: Obtaining a sharpness value curve within the focus range of a fully automatic microscopic imaging instrument; Dividing the clarity value curve into a number of equal parts; Obtain the sharpness values of the equally divided positions, and select several equally divided intervals adjacent to the maximum value of the sharpness value on both sides to form a precise focus interval.
3. The method for detecting the autofocus accuracy of a fully automatic microscopic imager according to claim 2, wherein: Obtain the sharpness value curve within the focus range of the fully automatic microscope imager, including: Imaging is performed at a certain step length within the focus range of the fully automatic microscopic imager, and a clarity curve is generated according to the imaging position and the corresponding clarity value.
4. An automatic focus accuracy detection system for a fully automatic microscopic imaging instrument, characterized in that: include: A focus interval determination module, configured to automatically focus the fully automatic microscopic imager once to obtain a precise focus interval of the fully automatic microscopic imager; A focusing module, configured to select a plurality of different step lengths to perform multiple autofocuses in the precise focusing interval to obtain a plurality of focus positions; A focusing accuracy calculation module, configured to calculate the automatic focusing accuracy of the fully automatic microscopic imaging instrument according to a plurality of focus positions; Calculating the autofocus accuracy of the fully automatic microscope imager according to the plurality of focus positions includes: Calculate the average value of the Z-axis positions of the multiple focus positions Where n is the number of autofocus cycles; Pi is the Z-axis position of the focus after the i-th autofocus cycle; The relative deviation S is calculated according to the Bessel formula: According to the average value of the Z-axis position The focusing accuracy CV of the automatic microscopic imager autofocus is calculated using the relative deviation S: An output report module is used to evaluate whether the fully automatic microscopic imager meets the standards based on the autofocus accuracy and output the evaluation result.
5. The automatic focusing accuracy detection system for a fully automatic microscopic imaging instrument according to claim 4, characterized in that: The focusing module includes: A clarity curve acquisition unit, used to obtain a clarity value curve within a focus range of the fully automatic microscopic imaging instrument; an equal division unit, configured to divide the clarity value curve into a plurality of equal parts; The interval selection unit is used to obtain the clarity value of the equally divided position and select several equally divided intervals adjacent to the maximum clarity value on both sides to form a precise focus interval.
Citation Information
Patent Citations
Automatic focusing method and device for microscopic instrument, intelligent terminal and storage medium
CN113777769A