Automatic focusing method of self-adaptive device

By calculating the clarity of the four corners and centers of the image and calibrating it, combined with the adaptive adjustment unit to drive the focus lens to move, the automatic focus of the PCR instrument is realized, solving the problem of cumbersome and inefficient manual focus operation, and improving fluorescence detection Accuracy and reliability.

CN119421054AActive Publication Date: 2025-02-11XIAN TIANLONG SCI & TECH
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411975611.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-02-11
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The manual focus operation of existing PCR instruments is cumbersome, inefficient, insufficient accuracy and poor adaptability, resulting in low image acquisition efficiency and unstable quality.

Method used

By calculating the clarity of the four corners of the image and comparing it with the center, the horizontal tilt calibration of the image is achieved, and combined with the adaptive adjustment unit, the focus lens is driven to move in the Z-axis direction, realizing automatic vertical calibration of the sampling target .

Benefits of technology

It significantly improves the accuracy and reliability of fluorescence detection, ensures the global sharpness of the image, reduces focus time, improves work efficiency, and reduces the error of human operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119421054A_ABST
    Figure CN119421054A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic focusing method for a self-adaptive device, relates to the technical field of image focusing, and solves the problems of complicated manual focusing operation, low efficiency, insufficient precision and poor adaptability of an existing PCR instrument. According to the method, the optical inspection consumables of different specifications can be quickly and accurately focused, particularly, the global definition of the image is ensured through the horizontal calibration step, and the situation that the overall image quality is affected due to blurred edges is avoided. The overall design not only simplifies the operation process and improves the working efficiency, but also remarkably improves the accuracy and reliability of fluorescence detection, and is particularly suitable for the fields of medical diagnosis, gene detection and the like with extremely high requirements on the global definition of images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image focusing, and in particular to a method for automatic focusing of an adaptive device. Background Art

[0002] Polymerase Chain Reaction (PCR) is an extremely important experimental technique in modern molecular biology, which is used to quickly amplify specific DNA fragments. In recent years, with the rapid development of biotechnology, PCR technology has been widely used in medical diagnosis, genetic testing, forensic identification, food safety testing and other fields. In these applications, monitoring the PCR reaction process and qualitative and quantitative analysis of the results are crucial, and fluorescence detection technology is one of the most commonly used methods. The basic principle of fluorescence detection is to emit excitation light from a light source to illuminate the processed sample to be tested. The fluorescent markers in the sample will emit fluorescence, that is, emit light, under the action of the excitation light. The detection instrument collects these fluorescences, and by analyzing the fluorescence intensity and distribution, the sample can be qualitatively and quantitatively analyzed.

[0003] During the PCR detection process, the acquisition of fluorescence depends on the image sampling and analysis device. In order to obtain accurate fluorescence images, focusing technology is required to ensure the clarity of the image. At present, most PCR instruments use the traditional method of manual focusing. This focusing method has the following problems: cumbersome operation: Every time the consumables are replaced, the operator needs to manually adjust the focus position, which is not only time-consuming and labor-intensive, but also prone to errors. Inefficiency: Manual focusing requires a lot of time and effort, reducing work efficiency, especially in high-throughput detection. Insufficient accuracy: When the height difference of the consumables is small, it is difficult to accurately adjust the focus position with manual focus, resulting in poor image acquisition accuracy. Poor adaptability: Manual focus is difficult to adapt to consumables of various specifications, especially in application scenarios with high throughput and versatility requirements.

[0004] With the development of PCR detection technology, higher requirements are placed on the throughput, versatility and automation of PCR instruments. In particular, the accuracy of fluorescence acquisition directly affects the reliability of the test results. Due to natural phenomena caused by the optical system and focusing lens design, such as astigmatism, field curvature and distortion, the four corners of the image are usually the most prone to blur. If horizontal calibration is not performed, although the center of the image may be very clear, the blur in the four corners will seriously affect the overall image quality. In fields such as industry, scientific research, and medical imaging that require extremely high global image clarity, this problem of edge blur is particularly obvious. Therefore, it is particularly important to develop a focusing method that can automatically focus on the entire image and adapt to consumables of various specifications. Summary of the invention

[0005] The purpose of the present invention is: In view of the above-mentioned problems, the present invention provides a method for automatic focusing of an adaptive device, aiming to solve the problems of cumbersome manual focusing operation, low efficiency, insufficient precision and poor adaptability of existing PCR instruments. By calculating the clarity of the four corners of the image and comparing it with the clarity of the center, the horizontal tilt problem of the image can be effectively detected and corrected, and the global clarity of the image can be ensured to avoid affecting the overall image quality due to edge blur; at the same time, the focusing lens is driven to move in the Z-axis direction through the adaptive adjustment unit, and combined with the contrast image clarity, automatic vertical calibration of the sampling target is achieved; the present invention can significantly improve the accuracy and reliability of fluorescence detection, and is particularly suitable for medical diagnosis, gene detection and other fields that require extremely high global image clarity.

[0006] The technical solution adopted by the present invention is as follows: A method for automatic focusing of an adaptive device is applied to an image sampling and analysis device, wherein the image sampling and analysis device comprises a sampling unit, an adaptive adjustment unit, and a loading unit for loading a target sample, wherein the adaptive adjustment unit can drive the sampling unit to move so that the sampling unit and the target sample are focused, and comprises the following steps: Sampling target loading step: open the image analysis device, load the target sample into the loading unit of the image sampling analysis device, put the target sample in a state to be sampled, and establish an XYZ axis coordinate system with the center point of the sampling unit as the origin; Vertical calibration steps: Start the adaptive adjustment unit, and use the adaptive adjustment unit to drive the sampling unit along the Z axis in the range of motion. After each movement stops, the sampling unit samples the target sample and transmits the sampled image data to the control device; the clarity sampling frame is used to select the data source for clarity evaluation at the center of the image data, and the center clarity is obtained by comparison. The highest image data is used as the vertical calibration image; Horizontal calibration step: Use the clarity sampling boxes to select the data sources for clarity evaluation at the four corners of the vertical calibration image, and the control device calculates the clarity of the upper left corner of the image data based on the data sources selected by the four corner boxes of the image data. , upper right corner clarity , Lower left corner clarity And the lower right corner clarity , according to the central clarity , upper left corner clarity , upper right corner clarity , Lower left corner clarity And the lower right corner clarity Calculate the overall clarity of the four corners and the center , judge the overall clarity Whether it does not exceed the set horizontal calibration threshold, if so, the horizontal calibration is completed, otherwise, the sampling unit is controlled to rotate along the X-axis and / or along the Y-axis to perform horizontal tilt calibration until the overall clarity is Converges within the set threshold.

[0007] Furthermore, the vertical calibration step includes a rough calibration sampling step: starting the adaptive adjustment unit, driving the sampling unit to move along the Z axis within the range of motion through the adaptive adjustment unit The sampling unit performs image sampling on the target sample after each movement stops, and transmits the sampled image data to the control device; the step of coarse calibration focus: the data source for clarity evaluation is selected with a clarity sampling frame at the center position of the image data, and the control device calculates the center clarity of each image data according to the data source selected at the center position of the image data. , compare and select the center clarity The highest image data is used as the coarse calibration image, and the position corresponding to the coarse calibration image is used as the coarse focus position. ; Fine calibration sampling step: use the coarse focus position of the coarse calibration image Initial focal length and clarity as the fine calibration sample as the baseline clarity , in the range of motion Within, a new focal length is randomly generated according to the fine calibration step size , the fine calibration step is smaller than the coarse calibration step, the adaptive adjustment unit is started, and the sampling unit is driven to move to the focal length through the adaptive adjustment unit , sample the target sample, and transmit the sampled image data to the control device; fine calibration focus step: the control device calculates the new center clarity ,like > , then accept the new focal length, otherwise with probability Accepts poor focal length, where T is the current temperature, e is the base of the natural logarithm, and the probabilistic selection is introduced to prevent falling into the local optimum; fine calibration convergence step: repeat the fine calibration sampling step and the fine calibration focusing step to iterate, and gradually reduce the temperature during the iteration process T To the set temperature threshold, until the iterative data converges, the vertical calibration image is obtained, and the vertical calibration adjustment is completed.

[0008] Furthermore, during the water calibration step, the overall clarity If the horizontal calibration threshold is exceeded, the left clarity metric value is calculated. , Right clarity measure , upper clarity metric value , the clarity metric value , and then get the left and right clarity difference value And the difference between upper and lower clarity ; If the left and right clarity difference If the value is less than the set threshold, it means that the left and right sides of the fine calibration image are level. Otherwise, according to the left and right clarity difference value Control the sampling unit to deflect with the Y axis as the rotation axis to perform left and right tilt calibration; if the upper and lower clarity difference value If the value is less than the set threshold, it means that the upper and lower levels of the fine calibration image are level. Otherwise, according to the upper and lower clarity difference value Control the sampling unit to deflect with the X-axis as the rotation axis to perform up and down tilt calibration; repeat this step until the overall clarity is Converges within the set threshold.

[0009] Furthermore, the overall clarity metric for: (1).

[0010] Furthermore, the clarity calculation method of the data source selected by any of the sampling frames for clarity evaluation is as follows: Calculation data source Gradient in the X direction : (2) in is the convolution kernel of the gradient in the X direction, for: (3) Calculation data source Gradient in the Y direction : (4) in is the convolution kernel of the gradient in the Y direction, for: (5) Calculation data source The gradient amplitude of each pixel : (6) Calculation data source Clarity S : (7) in, The first The gradient magnitude of pixels.

[0011] Furthermore, the target sample is an optical inspection consumable, and the image sampling and analysis device includes an optical excitation unit that can act on the target sample to make it produce a fluorescent reaction. The loading unit is provided with a temperature control module that can adjust the temperature of the target sample. In the sampling target loading step, after the target sample is assembled on the loading unit of the image sampling and analysis device, the temperature control module is started to adjust the temperature of the target sample, and the optical excitation unit is started. The optical excitation unit acts on the target sample to make it produce a fluorescent reaction. At this time, the target sample is in a state to be sampled.

[0012] Furthermore, the target sample is provided with fluorescent holes arranged in an array. Before using the clarity sampling frame to select the data source, the original image is first binarized to highlight the difference between the target object and the background, and then the canny edge search algorithm is used to detect potential circular targets in the image, so as to determine the center position and circular outline of each fluorescent hole, and then set the area suitable for the fluorescent hole as the clarity sampling frame.

[0013] Furthermore, the image sampling and analysis device also includes a reference unit, the sampling unit includes an image sampling component and a focusing lens, the image sampling component is assembled on the reference unit, the focusing lens is coaxially arranged with the image sampling component, the focusing lens can be moved along the Z axis relative to the reference unit through an adaptive adjustment unit, and the sampling unit and the adaptive adjustment unit are respectively signal-connected and controlled by the control device.

[0014] Furthermore, the adaptive adjustment unit includes a driving device, a transmission device and a focus connection block, the driving device can drive the focus connection block to move along the Z-axis direction, the focus connection block is provided with a cantilever structure, one end of the cantilever structure is connected to the focus connection block, and the other end is provided with a lens support block, and the focus lens is assembled in the lens support block.

[0015] Furthermore, a guide rail is provided on the reference unit along the Z-axis direction, a cantilever structure is provided on one side of the focus connecting block, and the other side matches the guide rail; the driving device can drive the focus connecting block to slide along the guide rail through a transmission device, thereby driving the cantilever structure to move up and down; it also includes a light-shielding sleeve, which is coaxially arranged with the image sampling component, and a movable guide groove matching the light-shielding sleeve is provided on the cantilever structure, and the movable guide groove is arranged outside the lens support block; one end of the light-shielding sleeve is connected to the reference unit, and the other end matches the movable guide groove, and when the cantilever structure moves, the light-shielding sleeve at least partially extends into the movable guide groove to prevent external light from entering the focusing lens.

[0016] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: The present invention ensures that both the center and the edge of the image can achieve high definition through the combination of vertical calibration and horizontal calibration, thereby improving the accuracy and reliability of fluorescence detection.

[0017] The present invention combines coarse calibration and fine calibration to ensure that the clarity of the vertical calibration image is optimal and converges stably. The coarse calibration step is used to quickly find the approximate focus position, reduce the search range, and improve efficiency. In this step, the focus position is preliminarily determined by selecting the data source with the highest clarity at the center of the image. Fine adjustments are made through fine calibration steps to ensure high precision of the focus position. New focal lengths are randomly generated and poor focal lengths are accepted with probability. Probabilistic selection is introduced to prevent falling into local optimality, ensuring the global optimality of the final focus position. By iterating and gradually reducing the temperature T , ensuring that the clarity of the vertical calibration image is optimal and converges stably, avoiding stopping the focusing process prematurely.

[0018] The present invention accurately evaluates the overall clarity of the image by calculating the clarity of the four corners of the vertical calibration image and comparing it with the clarity of the center. This step can detect the horizontal tilt problem of the image. According to the left and right clarity difference values ​​and the upper and lower clarity difference values, the target sample is controlled to rotate along the X-axis and / or Y-axis to perform left and right and upper and lower tilt calibration to ensure the horizontal consistency of the image. This step ensures the global clarity of the image by repeatedly calibrating until the overall clarity converges within the set threshold.

[0019] The automated focusing method of the present invention significantly reduces the focusing time each time the consumables are replaced, especially in high-throughput detection, which greatly improves the work efficiency. The operator does not need to manually adjust the focus position, which simplifies the operation process, reduces the workload, and reduces the error of human operation, improves the accuracy and reliability of focusing, and ensures that the focus position of each detection is optimal.

[0020] The present invention improves the flexibility and stability of the focus lens through the design of the cantilever structure and the lens support block, and ensures the precise movement of the focus lens during the horizontal calibration process.

[0021] The shading sleeve of the present invention is coaxially arranged with the image sampling component, and the movable guide groove matches the shading sleeve, ensuring that the shading sleeve can prevent external light from entering the focusing lens during the focusing process, thereby improving the purity of the image and the accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic flow chart of the method for automatic focusing of an adaptive device of the present invention; Figure 2 It is a schematic diagram of the process of obtaining clarity of the present invention; Figure 3It is a diagram of the processing process of acquiring a picture during horizontal calibration of the present invention; Figure 4 It is a schematic diagram of the clarity of the picture of the rough calibration process of the present invention; Figure 5 It is a schematic diagram of the clarity of the picture of the fine calibration process of the present invention; Figure 6 It is a schematic diagram of the clarity of the picture after horizontal calibration of the present invention; Figure 7 It is a structural schematic diagram of the image sampling and analysis device of the present invention; Figure 8 is a cross-sectional view of the image sampling and analysis device of the present invention; Fig. 9 This is the effect picture without using the light-shielding sleeve; Fig.10 It is a rendering of the present invention using a light-shielding sleeve.

[0023] Markings in the figure: 1-sampling unit, 2-adaptive adjustment unit, 4-reference unit, 5-fixed plate, 6-movable guide groove, 7-light shielding sleeve, 8-lens support block, 11-image sampling component, 12-focusing lens, 21-driving device, 22-screw rod, 23-focusing connecting block, 24-cantilever structure. DETAILED DESCRIPTION

[0024] A method for automatic focusing of an adaptive device, such as Figure 1-10 As shown, it is applied to an image sampling and analysis device, which includes a sampling unit 1, an adaptive adjustment unit 2, and a loading unit for loading a target sample. The adaptive adjustment unit 2 can drive the sampling unit 1 to move so that the sampling unit 1 and the target sample are focused, including the following steps: Sampling target loading step: open the image analysis device, load the target sample into the loading unit of the image sampling analysis device, put the target sample in a state to be sampled, and establish an XYZ axis coordinate system with the center point of the sampling unit 1 as the origin; Rough calibration sampling steps: start the adaptive adjustment unit 2, and drive the sampling unit 1 along the Z axis in the range of motion through the adaptive adjustment unit 2 The sampler moves for multiple times according to the coarse calibration step length, the coarse calibration step is 0.01 mm, and after each movement stops, the sampler unit 1 samples the target sample and transmits the sampled image data to the control device; Rough calibration focus step: Use the clarity sampling frame to select the data source for clarity evaluation at the center position of the image data, and the control device calculates the center clarity of each image data based on the data source selected at the center position of the image data. , compare and select the center clarity The highest image data is used as the coarse calibration image, and the position corresponding to the coarse calibration image is used as the coarse focus position. ; Fine calibration sampling step: use the coarse focus position of the coarse calibration image Initial focal length and clarity as the fine calibration sample as the baseline clarity , in the range of motion Within, a new focal length is randomly generated according to the fine calibration step size The fine calibration step length is smaller than the coarse calibration step length, and can be 1 / 2, 1 / 4, etc. of the coarse calibration step length. In this application, the fine calibration step length is selected to be 1 / 2 of the coarse calibration step length. The adaptive adjustment unit 2 is started, and the sampling unit 1 is driven by the adaptive adjustment unit 2 to move to the focal length , performing image sampling on the target sample, and transmitting the sampled image data to the control device; Fine focus calibration step: The control calculates the new center sharpness ,like > , then accept the new focal length, otherwise with probability Accepts poor focal length, where T is the current temperature, e is the base of the natural logarithm, and the probabilistic selection is introduced to prevent falling into the local optimum; fine calibration convergence step: repeat the fine calibration sampling step and the fine calibration focusing step to iterate, and gradually reduce the temperature during the iteration process T To the set temperature threshold, until the iterative data converges, the vertical calibration image is obtained, and the vertical calibration adjustment is completed.

[0025] Horizontal calibration step: Use the clarity sampling boxes to select the data sources for clarity evaluation at the four corners of the vertical calibration image, and the control device calculates the clarity of the upper left corner of the image data based on the data sources selected by the four corner boxes of the image data. , upper right corner clarity , Lower left corner clarity And the lower right corner clarity , according to the central clarity , upper left corner clarity , upper right corner clarity , Lower left corner clarity And the lower right corner clarity Calculate the overall clarity of the four corners and the center , judge the overall clarity Does it exceed the set horizontal calibration threshold? If so, the horizontal calibration is completed. Otherwise, the left clarity measurement value is calculated. , Right clarity measure , upper clarity metric value , the clarity metric value , and then get the left and right clarity difference value And the difference between upper and lower clarity ; If the left and right clarity difference If the value is less than the set threshold, it means that the left and right sides of the fine calibration image are level. Otherwise, according to the left and right clarity difference value Control the sampling unit 1 to deflect with the Y axis as the rotation axis to perform left and right tilt calibration; if the upper and lower clarity difference values If the value is less than the set threshold, it means that the upper and lower levels of the fine calibration image are level. Otherwise, according to the upper and lower clarity difference value Control the sampling unit 1 to deflect with the X axis as the rotation axis to perform up and down tilt calibration; repeat this step until the overall clarity is Converges within the set threshold.

[0026] Overall clarity measure for: (1).

[0027] The clarity calculation method of the data source selected by any of the sampling frames for clarity evaluation is as follows: Calculation data source Gradient in the X direction : (2) in is the convolution kernel of the gradient in the X direction, for: (3) Calculation data source Gradient in the Y direction : (4) in is the convolution kernel of the gradient in the Y direction, for: (5) Calculation data source The gradient amplitude of each pixel : (6) Calculation data source Clarity S : (7) in, The first The gradient amplitude of each pixel. This method can extract the area with large changes in the image, that is, the edge. By calculating the gradient amplitude of the pixel point, the changes in the image can be obtained, where the area with large gradient may correspond to the details and edges in the image.

[0028] Example 2 Embodiment 2 is a further improvement of Embodiment 1; further explanation, the same components are not repeated here, such as Figure 1-10 As shown, the target sample is an optical inspection consumable, which can be an optical inspection consumable with different numbers of holes such as 96 holes or 384 holes, or an optical inspection consumable with different heights such as 0.1 mm or 0.2 mm. The optical inspection consumable in this embodiment is a PCR tube, and the image sampling and analysis device includes an optical excitation unit that can act on the target sample to make it produce a fluorescent reaction. The loading unit is provided with a temperature control module that can adjust the temperature of the target sample. In the sampling target loading step, after the target sample is assembled on the loading unit of the image sampling and analysis device, the temperature control module is started to adjust the temperature of the target sample, and the optical excitation unit is started. The optical excitation unit acts on the target sample to make it produce a fluorescent reaction. At this time, the target sample is in a state to be sampled.

[0029] The target sample is provided with fluorescent holes arranged in an array. Before using the clarity sampling frame to select the data source, the original image is first binarized to highlight the difference between the target object and the background, and then the canny edge search algorithm is applied to detect the potential circular target in the image, so as to determine the center position and circular outline of each fluorescent hole, sort the center coordinates of each fluorescent hole according to the position, and then set the area adapted to the fluorescent hole as the clarity sampling frame. In this embodiment, the area adapted to the four fluorescent holes is selected as the clarity sampling frame, that is, the clarity sampling frame is a matrix of 100*100 pixels, and images are continuously captured to compare the clarity difference between the four corners and the center. When the clarity values ​​of the four corners are similar and the difference between the four corners and the center meets the set threshold, the optimal horizontal clarity position is reached.

[0030] The image sampling and analysis device also includes a reference unit 4. The sampling unit 1 includes an image sampling component 11 and a focusing lens 12. The image sampling component 11 is assembled on the reference unit 4. The reference unit 4 can rotate with the X-axis and the Y-axis as the rotation axis under the action of the rotating motor to achieve the focusing of the sampling unit 1 in the horizontal direction. The setting of the rotating motor belongs to the prior art and is not drawn in the figure. The focusing lens 12 is coaxially arranged with the image sampling component 11. In the rough calibration and fine calibration steps, the focusing lens 12 can be moved along the Z-axis relative to the reference unit 4 through the adaptive adjustment unit 2 to achieve the focusing of the sampling unit 1 in the Z-axis direction. The sampling unit 1 and the adaptive adjustment unit 2 are respectively connected by signals and controlled by the control device.

[0031] The adaptive adjustment unit 2 includes a driving device 21, a transmission device and a focus connection block 23. The driving device 21 can drive the focus connection block 23 to move along the Z-axis direction. A cantilever structure 24 is provided on the focus connection block 23. One end of the cantilever structure 24 is connected to the focus connection block 23, and the other end is provided with a lens support block 8. The focus lens 12 is assembled in the lens support block 8.

[0032] The reference unit 4 is provided with a fixed plate 5, and a guide rail is provided on the fixed plate 5 along the Z-axis direction. A cantilever structure 24 is provided on one side of the focus connection block 23, and the other side matches the guide rail; the driving device 21 can drive the focus connection block 23 to slide along the guide rail through a transmission device, thereby driving the cantilever structure 24 to move up and down; it also includes a shading sleeve 7, and the shading sleeve 7 is coaxially arranged with the image sampling component 11. The cantilever structure 24 is provided with a movable guide groove 6 matching the shading sleeve 7, and the movable guide groove 6 is arranged outside the lens support block 8; one end of the shading sleeve 7 is connected to the reference unit 4, and the other end matches the movable guide groove 6. When the cantilever structure 24 moves, the shading sleeve 7 at least partially extends into the movable guide groove 6 to prevent external light from entering the focus lens 12.

[0033] In this embodiment, the transmission device is a screw rod 22, the driving device is connected to the screw rod 22, the focus connection block 23 is threadedly connected to the screw rod 22, the driving device 21 drives the screw rod 22 to rotate, drives the focus connection block 23 to slide along the guide rail, and then drives the cantilever structure 24 to move up and down.

[0034] The principles and implementation methods of the present invention are described in this article using specific embodiments. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

[0035] In the description of the present invention, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, or are the directions or positional relationships in which the inventive product is usually placed when in use. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as a limitation on the present invention.

[0036] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

Claims

1. A method for automatic focusing of an adaptive device, applied to an image sampling and analysis device, wherein the image sampling and analysis device comprises a sampling unit, an adaptive adjustment unit, and a loading unit for loading a target sample, wherein the adaptive adjustment unit can drive the sampling unit to move so that the sampling unit and the target sample are in focus, characterized in that: The steps include: Sampling target loading step: open the image analysis device, load the target sample into the loading unit of the image sampling analysis device, put the target sample in a state to be sampled, and establish an XYZ axis coordinate system with the center point of the sampling unit as the origin; Vertical calibration steps: Start the adaptive adjustment unit, and use the adaptive adjustment unit to drive the sampling unit along the Z axis in the range of motion. After each movement stops, the sampling unit samples the target sample and transmits the sampled image data to the control device; the clarity sampling frame is used to select the data source for clarity evaluation at the center of the image data, and the center clarity is obtained by comparison. The highest image data is used as the vertical calibration image; Horizontal calibration step: Use the clarity sampling boxes to select the data sources for clarity evaluation at the four corners of the vertical calibration image, and the control device calculates the clarity of the upper left corner of the image data based on the data sources selected by the four corner boxes of the image data. , upper right corner clarity , Lower left corner clarity And the lower right corner clarity , according to the central clarity , upper left corner clarity , upper right corner clarity , Lower left corner clarity And the lower right corner clarity Calculate the overall clarity of the four corners and the center , judge the overall clarity Whether it does not exceed the set horizontal calibration threshold, if so, the horizontal calibration is completed, otherwise, the sampling unit is controlled to rotate along the X-axis and / or along the Y-axis to perform horizontal tilt calibration until the overall clarity is Converges within the set threshold.

2. The method for automatic focusing of an adaptive device as claimed in claim 1, characterized in that: The vertical calibration step includes a rough calibration sampling step: starting the adaptive adjustment unit, driving the sampling unit to move along the Z axis within the range of motion through the adaptive adjustment unit The sampling unit performs image sampling on the target sample after each movement stops, and transmits the sampled image data to the control device; the step of coarse calibration focus: the data source for clarity evaluation is selected with a clarity sampling frame at the center position of the image data, and the control device calculates the center clarity of each image data according to the data source selected at the center position of the image data. , compare and select the center clarity The highest image data is used as the coarse calibration image, and the position corresponding to the coarse calibration image is used as the coarse focus position. ; Fine calibration sampling step: use the coarse focus position of the coarse calibration image Initial focal length and clarity as the fine calibration sample as the baseline clarity , in the range of motion Within, a new focal length is randomly generated according to the fine calibration step size , the fine calibration step is smaller than the coarse calibration step, the adaptive adjustment unit is started, and the sampling unit is driven to move to the focal length through the adaptive adjustment unit , sample the target sample, and transmit the sampled image data to the control device; fine calibration focus step: the control device calculates the new center clarity ,like > , then accept the new focal length, otherwise with probability Accepts poor focal length, where T is the current temperature, e is the base of the natural logarithm, and the probabilistic selection is introduced to prevent falling into the local optimum; fine calibration convergence step: repeat the fine calibration sampling step and the fine calibration focusing step to iterate, and gradually reduce the temperature during the iteration process T To the set temperature threshold, until the iterative data converges, the vertical calibration image is obtained, and the vertical calibration adjustment is completed.

3. The method for automatic focusing of an adaptive device as claimed in claim 1, characterized in that: During the water calibration step, the overall clarity If the horizontal calibration threshold is exceeded, the left clarity metric value is calculated. , Right clarity measure , upper clarity metric value , the clarity metric value , and then get the left and right clarity difference value And the difference between upper and lower clarity ; If the left and right clarity difference If the value is less than the set threshold, it means that the left and right sides of the fine calibration image are level. Otherwise, according to the left and right clarity difference value Control the sampling unit to deflect with the Y axis as the rotation axis to perform left and right tilt calibration; if the upper and lower clarity difference value If the value is less than the set threshold, it means that the upper and lower levels of the fine calibration image are level. Otherwise, according to the upper and lower clarity difference value Control the sampling unit to deflect with the X-axis as the rotation axis to perform up and down tilt calibration; repeat this step until the overall clarity is Converges within the set threshold.

4. The method for automatic focusing of an adaptive device as claimed in claim 1, characterized in that: Overall clarity measure for: (1)。 5. The method for automatic focusing of an adaptive device according to any one of claims 1 to 4, characterized in that: The clarity calculation method of the data source selected by any of the sampling frames for clarity evaluation is as follows: Calculation data source Gradient in the X direction : (2) in is the convolution kernel of the gradient in the X direction, for: (3) Calculation data source Gradient in the Y direction : (4) in is the convolution kernel of the gradient in the Y direction, for: (5) Calculation data source The gradient amplitude of each pixel : (6) Calculation data source Clarity S : (7) in, The first The gradient magnitude of pixels.

6. The method for automatic focusing of an adaptive device as claimed in claim 1, characterized in that: The target sample is an optical inspection consumable, and the image sampling and analysis device includes an optical excitation unit that can act on the target sample to make it produce a fluorescent reaction. The loading unit is provided with a temperature control module that can adjust the temperature of the target sample. In the sampling target loading step, after the target sample is assembled on the loading unit of the image sampling and analysis device, the temperature control module is started to adjust the temperature of the target sample, and the optical excitation unit is started. The optical excitation unit acts on the target sample to make it produce a fluorescent reaction. At this time, the target sample is in a state to be sampled.

7. The method for automatic focusing of an adaptive device as claimed in claim 6, characterized in that: The target sample is provided with fluorescent holes arranged in an array. Before using the clarity sampling frame to select the data source, the original image is first binarized to highlight the difference between the target object and the background, and then the canny edge search algorithm is used to detect potential circular targets in the image, so as to determine the center position and circular outline of each fluorescent hole, and then set the area suitable for the fluorescent hole as the clarity sampling frame.

8. The method for automatic focusing of an adaptive device as claimed in claim 1, characterized in that: The image sampling and analysis device also includes a reference unit, the sampling unit includes an image sampling component and a focusing lens, the image sampling component is assembled on the reference unit, the focusing lens is coaxially arranged with the image sampling component, the focusing lens can be moved along the Z axis relative to the reference unit through an adaptive adjustment unit, and the sampling unit and the adaptive adjustment unit are respectively signal-connected and controlled by the control device.

9. The method for automatic focusing of an adaptive device as claimed in claim 8, characterized in that: The adaptive adjustment unit includes a driving device, a transmission device and a focus connection block. The driving device can drive the focus connection block to move along the Z-axis direction. A cantilever structure is provided on the focus connection block. One end of the cantilever structure is connected to the focus connection block, and the other end is provided with a lens support block. The focus lens is assembled in the lens support block.

10. The method for automatic focusing of an adaptive device as claimed in claim 9, characterized in that: A guide rail is provided on the reference unit along the Z-axis direction, a cantilever structure is provided on one side of the focus connecting block, and the other side matches the guide rail; the driving device can drive the focus connecting block to slide along the guide rail through the transmission device, thereby driving the cantilever structure to move up and down; it also includes a light-shielding sleeve, which is coaxially arranged with the image sampling component, and a movable guide groove matching the light-shielding sleeve is provided on the cantilever structure, and the movable guide groove is arranged outside the lens support block; one end of the light-shielding sleeve is connected to the reference unit, and the other end matches the movable guide groove, and when the cantilever structure moves, the light-shielding sleeve at least partially extends into the movable guide groove to prevent external light from entering the focusing lens.

Citation Information

Patent Citations

  • Device for assessing parallelism of camera focal plane and method thereof

    CN106803953A

  • Automatic focusing method and device, storage medium and computer equipment

    CN109698901A

  • Automatic focusing method based on optical image definition and related equipment

    CN113933981A

  • Automatic focusing method and device, electronic equipment and storage medium

    CN115567778A

  • Projector correction method and system

    CN116266341A