A method for an adaptive device to perform autofocus
By automatically detecting and correcting the horizontal inclination and vertical position of the PCR image, the problems of manual focus operation of the existing PCR instrument are complicated, inefficient, insufficient accuracy and poor adaptability, and efficient and accurate fluorescence detection is achieved.
Patent Information
- Application Number
- CN202411975611.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2044-12-31
AI Technical Summary
The manual focus operation of existing PCR instruments is cumbersome, inefficient, insufficient accuracy and poor adaptability, resulting in low image acquisition accuracy and affecting the reliability of the detection results.
By calculating the clarity of the four corners of the image and comparing it with the central clarity, the horizontal inclination problem of the image is detected and corrected, and combined with the adaptive adjustment unit, the focus lens is driven to move in the Z-axis direction, achieving automatic vertical calibration of the sampling target.
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.
Smart Images

Figure CN119421054B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image focusing, and particularly 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, used for rapid amplification of specific DNA fragments. In recent years, with the rapid development of biotechnology, PCR technology has been widely applied in the fields of medical diagnosis, gene detection, forensic identification, food safety detection, etc. In these applications, the monitoring of the PCR reaction process and the 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 that a light source emits excitation light, which irradiates the sample to be tested that has been processed. The fluorescent marker in the sample will emit fluorescence, that is, emission light, under the action of the excitation light. The detection instrument collects this fluorescence, and through analyzing the fluorescence intensity and distribution, the sample can be qualitatively and quantitatively analyzed.
[0003] During the PCR detection process, the collection 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 images. Currently, most PCR instruments adopt the traditional method of manual focusing. This focusing method has the following problems: Complicated operation: Every time the consumables are replaced, the operator needs to manually adjust the focusing position, which is not only time-consuming and laborious, but also prone to errors. Low efficiency: Manual focusing requires a large amount of time and energy, reducing the work efficiency, especially in high-throughput detection. Insufficient precision: When the height difference of the consumables is small, it is difficult to accurately adjust the focusing position manually, resulting in poor accuracy of image acquisition. Poor adaptability: Manual focusing is difficult to adapt to various specifications of consumables, especially in application scenarios with high requirements for throughput and versatility.
[0004] With the development of PCR detection technology, higher requirements are put forward for the throughput, versatility and automation level of PCR instruments. In particular, the accuracy of fluorescence collection directly affects the reliability of the detection results. Due to natural phenomena such as astigmatism, field curvature and distortion brought about by the optical system and the focusing lens design, the four corners of the image are usually the places where blurring is most likely to occur. If horizontal calibration is not performed, although the center of the image may be very clear, the blurring in the four-corner area will seriously affect the overall image quality. In fields such as industry, scientific research, and medical imaging where extremely high requirements are placed on the global clarity of images, this problem of edge blurring is particularly obvious. Therefore, it is particularly important to develop a focusing method that can automatically focus on the entire image and adapt to various specifications of consumables. Summary of the Invention
[0005] The object of the present invention is: aiming at 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 accuracy and poor adaptability of existing PCR instruments. By calculating the sharpness of the four corners of the image and comparing it with the central sharpness, the horizontal tilt problem of the image can be effectively detected and corrected, ensuring the global sharpness of the image and avoiding affecting the overall image quality due to blurred edges; at the same time, the adaptive adjustment unit drives the focusing lens to move in the Z-axis direction and combines with the comparison of image sharpness to achieve automatic vertical calibration of the sampling target; 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 with extremely high requirements for global image sharpness.
[0006] The technical solution adopted by the present invention is as follows:
[0007] A method for automatic focusing of an adaptive device, applied to an image sampling and analysis device, the image sampling and analysis device includes a sampling unit, an adaptive adjustment unit, and a loading unit for loading a target sampling object, and the adaptive adjustment unit can drive the sampling unit to move so that the sampling unit focuses on the target sampling object, including the following steps:
[0008] Sampling target loading step: Turn on the image analysis device, load the target sampling object into the loading unit of the image sampling and analysis device, make the target sampling object in a state to be sampled, and establish an XYZ-axis coordinate system with the center point of the sampling unit as the origin;
[0009] Vertical calibration step: Start the adaptive adjustment unit, drive the sampling unit to move along the Z-axis within the motion range by the adaptive adjustment unit. After each movement stops, the sampling unit samples the image of the target sampling object and transmits the sampled image data to the control device; use a sharpness sampling frame to select the data source for sharpness evaluation at the center position of the image data, and through comparison, obtain the image data with the highest central sharpness as the vertical calibration image; Horizontal calibration step: Use sharpness sampling frames to select the data sources for sharpness evaluation at the four corners of the vertical calibration image respectively. The control device calculates the sharpness of the upper left corner of the image data, the sharpness of the upper right corner, the sharpness of the lower left corner, and the sharpness of the lower right corner based on the data sources selected by the four corners of the image data. According to the central sharpness, the sharpness of the upper left corner, the sharpness of the upper right corner, the sharpness of the lower left corner, and the sharpness of the lower right corner The highest image data is used as the vertical calibration image;
[0010] Horizontal calibration step: Use sharpness sampling frames to select the data sources for sharpness evaluation at the four corners of the vertical calibration image respectively. The control device calculates the sharpness of the upper left corner of the image data, the sharpness of the upper right corner, the sharpness of the lower left corner, and the sharpness of the lower right corner based on the data sources selected by the four corners of the image data. According to the central sharpness, the sharpness of the upper left corner, the sharpness of the upper right corner, the sharpness of the lower left corner, and the sharpness of the lower right corner The sharpness of the upper right corner The sharpness of the lower left corner And the sharpness of the lower right corner , according to the central sharpness The sharpness of the upper left corner The sharpness of the upper right corner The sharpness of the lower left corner And the sharpness of the lower right corner Calculate the overall sharpness of the four corners and the center , and judge the overall sharpness Whether it does not exceed the set horizontal calibration threshold. If so, the horizontal calibration is completed. Otherwise, control the sampling unit to rotate along the X-axis and / or along the Y-axis for horizontal tilt calibration until the overall sharpness Converges within the set threshold
[0011] Furthermore, the vertical calibration step includes a rough calibration sampling step: start the adaptive adjustment unit, and drive the sampling unit to move along the Z-axis within the motion range in multiple times according to the rough calibration step size. After each movement stops, the sampling unit samples the target sampling object for an image, and transmits the sampled image data to the control device; rough calibration focusing step: use a sharpness sampling frame to select the data source for sharpness evaluation at the center position of the image data, and the control device calculates the center sharpness of each image data based on the data source selected at the center position of the image data , compare and select the image data with the highest center sharpness as the rough calibration image, and use the position corresponding to the rough calibration image as the rough focusing position ; fine calibration sampling step: use the rough focusing position of the rough calibration image as the initial focal length for fine calibration sampling, and the sharpness as the reference sharpness , within the motion range , randomly generate a new focal length according to the fine calibration step size , the fine calibration step size is smaller than the rough calibration step size, start the adaptive adjustment unit, drive the sampling unit to move to the focal length , sample the target sampling object for an image, and transmit the sampled image data to the control device; fine calibration focusing step: the control device calculates the new center sharpness , if > , then receive the new focal length, otherwise accept the worse focal length with a probability , where T is the current temperature, e is the base of the natural logarithm, and introducing probabilistic selection prevents falling into local optima; fine calibration convergence step: repeat the fine calibration sampling step and the fine calibration focusing step for iteration. During the iteration process, gradually reduce the temperature T to the set temperature threshold until the iteration data converges, obtain the vertical calibration image, and complete the vertical calibration adjustment
[0012] Furthermore, in the water calibration step, the overall sharpness If the calibration threshold is exceeded, the left sharpness metric value is calculated. , the right sharpness metric value , the upper sharpness metric value , and the lower sharpness metric value are obtained. Then, the left - right sharpness difference value and the up - down sharpness difference value are obtained; if the left - right sharpness difference value is less than the set threshold, it indicates that the left - right level of the fine - calibrated image is okay. Otherwise, according to the left - right sharpness difference value , the sampling unit is controlled to deflect with the Y - axis as the rotation axis for left - right tilt calibration; if the up - down sharpness difference value is less than the set threshold, it indicates that the up - down level of the fine - calibrated image is okay. Otherwise, according to the up - down sharpness difference value , the sampling unit is controlled to deflect with the X - axis as the rotation axis for up - down tilt calibration; this step is repeated until the overall sharpness converges within the set threshold.
[0013] Further, the overall sharpness metric value is:
[0014] (1).
[0015] Further, the sharpness calculation method for the data source selected by any one of the sampling frames for sharpness evaluation is as follows:
[0016] Calculate the gradient of the data source in the X - direction :
[0017] (2)
[0018] where is the convolution kernel of the gradient in the X - direction, is:
[0019] (3)
[0020] Calculate the gradient of the data source in the Y - direction :
[0021] (4)
[0022] where is the convolution kernel of the gradient in the Y - direction, is:
[0023] (5)
[0024] Calculate the data source Gradient magnitude of each pixel :
[0025] (6)
[0026] Calculate the clarity of the data source : S :
[0027] (7)
[0028] wherein is the gradient amplitude of the th pixel in the image.
[0029] Furthermore, the target sampling object is an optical inspection consumable, and the image sampling and analysis device includes an optical excitation unit that can act on the target sampling object to cause a fluorescence reaction. A temperature control module capable of adjusting the temperature of the target sampling object is provided at the loading unit. In the sampling target loading step, after the target sampling object 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 sampling object, and the optical excitation unit is started. The optical excitation unit acts on the target sampling object to cause a fluorescence reaction, and at this time the target sampling object is in a state to be sampled.
[0030] Furthermore, the target sampling object is provided with fluorescence pore positions arranged in an array. Before using the clarity sampling frame to frame 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 detection algorithm is applied to detect potential circular targets in the image, so as to determine the center position and circular contour of each fluorescence pore, and then set the area adapted to the fluorescence pore positions as the clarity sampling frame.
[0031] Furthermore, the image sampling and analysis device further 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 move relative to the reference unit along the Z-axis through an adaptive adjustment unit. The sampling unit and the adaptive adjustment unit are respectively connected by signals and controlled by a control device.
[0032] Furthermore, the adaptive adjustment unit includes a driving device, a transmission device and a focusing connection block. The driving device can drive the focusing connection block to move along the Z-axis direction. The focusing connection block is provided with a cantilever structure. One end of the cantilever structure is connected to the focusing connection block, and the other end is provided with a lens support block. The focusing lens is assembled in the lens support block.
[0033] Furthermore, a guide rail is provided on the reference unit along the Z-axis direction. One side of the focus connection block is provided with a cantilever structure, and the other side is matched with the guide rail. The driving device can drive the focus connection block to slide along the guide rail through a transmission device, thereby driving the cantilever structure to move up and down. A light-shielding sleeve is also included. The light-shielding sleeve is coaxially arranged with the image sampling component. A moving guide groove matched with the light-shielding sleeve is provided on the cantilever structure. The moving guide groove is arranged around the lens support block. One end of the light-shielding sleeve is connected to the reference unit, and the other end is matched with the moving guide groove. When the cantilever structure moves, at least part of the light-shielding sleeve extends into the moving guide groove to prevent external light from entering the focusing lens.
[0034] In summary, due to the adoption of the above technical solutions, the beneficial effects of the present invention are as follows:
[0035] Through the combination of vertical calibration and horizontal calibration, the present invention ensures that both the center and the edge of the image can achieve high definition, improving the accuracy and reliability of fluorescence detection.
[0036] Through the combination of coarse calibration and fine calibration, the present invention ensures that the clarity of the vertically calibrated image reaches the optimal and stably converges. By the coarse calibration step size, the approximate focusing position is quickly found, reducing the search range and improving the efficiency. This step is to initially determine the focusing position by selecting the data source with the highest clarity at the center position of the image. Through the fine calibration step size, fine adjustment is carried out to ensure the high precision of the focusing position. New focal lengths are randomly generated and worse focal lengths are accepted with a probability. By introducing probabilistic selection, it is prevented from falling into local optimum, ensuring the global optimum of the final focusing position. Through iteration and gradually reducing the temperature T , it ensures that the clarity of the vertically calibrated image reaches the optimal and stably converges, avoiding premature termination of the focusing process.
[0037] By calculating the clarity of the four corners of the vertically calibrated image and comparing it with the center clarity, the present invention accurately evaluates the overall clarity of the image. This step can detect the horizontal tilt problem of the image. According to the left-right clarity difference value and the up-down clarity difference value, the target sampling object is controlled to rotate along the X-axis and / or Y-axis for left-right and up-down tilt calibration to ensure the horizontal direction 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.
[0038] The automatic focusing method of the present invention significantly reduces the focusing time each time the consumables are replaced. Especially in high-throughput detection, the working efficiency is greatly improved. The operator does not need to manually adjust the focusing position, simplifying the operation process, reducing the work burden, while reducing the error of manual operation, improving the accuracy and reliability of focusing, and ensuring that the focusing position for each detection is optimal.
[0039] Through the design of the cantilever structure and the lens support block, the present invention improves the flexibility and stability of the focusing lens, ensuring the precise movement of the focusing lens during the horizontal calibration process.
[0040] In the present invention, the light-shielding sleeve is coaxially arranged with the image sampling component, and the moving guide groove matches the light-shielding sleeve, ensuring that the light-shielding sleeve can prevent external light from entering the focusing lens during the focusing process, improving the purity of the image and the accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is a schematic flow chart of the method for automatic focusing of the adaptive device of the present invention;
[0042] Figure 2 is a schematic flow chart of obtaining the clarity of the present invention;
[0043] Figure 3 is a processing process diagram of the obtained picture during the horizontal calibration of the present invention;
[0044] Figure 4 is a schematic diagram of the clarity of the picture during the rough calibration process of the present invention;
[0045] Figure 5 is a schematic diagram of the clarity of the picture during the fine calibration process of the present invention;
[0046] Figure 6 is a schematic diagram of the clarity of the picture after the horizontal calibration of the present invention;
[0047] Figure 7 is a schematic structural diagram of the image sampling and analyzing device of the present invention;
[0048] Figure 8 is a cross-sectional view of the image sampling and analyzing device of the present invention;
[0049] Figure 9 is the effect diagram without using the light-shielding sleeve;
[0050] Figure 10 is the effect diagram of using the light-shielding sleeve of the present invention.
[0051] Reference numerals in the drawings: 1 - sampling unit, 2 - adaptive adjustment unit, 4 - reference unit, 5 - fixing plate, 6 - moving guide groove, 7 - light-shielding sleeve, 8 - lens support block, 11 - image sampling component, 12 - focusing lens, 21 - driving device, 22 - lead screw, 23 - focusing connection block, 24 - cantilever structure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] A method for automatic focusing of an adaptive device, as Figure 1-10As 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 sampling object. The adaptive adjustment unit 2 can drive the sampling unit 1 to move so that the sampling unit 1 is focused on the target sampling object, and the method includes the following steps:
[0053] Sampling target loading step: Turn on the image analysis device, load the target sampling object into the loading unit of the image sampling and analysis device, make the target sampling object 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;
[0054] Coarse calibration sampling step: Start the adaptive adjustment unit 2, and drive the sampling unit 1 to move along the Z axis multiple times within the motion range at a coarse calibration step size. The coarse calibration step is 0.01 mm. After each movement stops, the sampling unit 1 performs image sampling on the target sampling object and transmits the sampled image data to the control device;
[0055] Coarse calibration focusing step: Use a clarity sampling frame to select the data source for clarity evaluation at the center position of the image data. 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 , compares and selects the image data with the highest center clarity as the coarse calibration image, and takes the position corresponding to the coarse calibration image as the coarse focusing position ;
[0056] Fine calibration sampling step: Use the coarse focusing position of the coarse calibration image as the initial focal length for fine calibration sampling and the clarity as the reference clarity , within the motion range , randomly generate a new focal length according to the fine calibration step size . The fine calibration step size is smaller than the coarse calibration step size and can be 1 / 2, 1 / 4, etc. of the coarse calibration step size. In this application, the fine calibration step size is selected to be 1 / 2 of the coarse calibration step size. Start the adaptive adjustment unit 2, and drive the sampling unit 1 to move to the focal length , perform image sampling on the target sampling object, and transmit the sampled image data to the control device;
[0057] Fine calibration focusing step: The control device calculates the new center clarity , if > , then receive the new focal length, otherwise accept the worse focal length with a probability , where T is the current temperature, eis the base of the natural logarithm. By introducing probabilistic selection, it prevents getting stuck in local optima; Fine calibration convergence step: Repeat the fine calibration sampling step and the fine calibration focusing step for iteration. During the iteration, gradually reduce the temperature T to the set temperature threshold until the iterative data converges, obtain the vertical calibration image, and complete the vertical calibration adjustment.
[0058] Horizontal calibration step: Use clarity sampling frames to frame out the data sources for clarity evaluation at the four corners of the vertically calibrated image respectively. The control device calculates the clarity of the upper left corner of the image data based on the data sources framed out at the four corners of the image data 、the clarity of the upper right corner 、the clarity of the lower left corner and the clarity of the lower right corner , and calculates the overall clarity of the four corners and the center according to the center clarity 、the clarity of the upper left corner 、the clarity of the upper right corner 、the clarity of the lower left corner and the clarity of the lower right corner ; Determine whether the overall clarity does not exceed the set horizontal calibration threshold. If so, complete the horizontal calibration. Otherwise, calculate the left clarity metric value 、the right clarity metric value 、the upper clarity metric value 、the lower clarity metric value ; Further obtain the left - right clarity difference value and the up - down clarity difference value ; If the left - right clarity difference value is less than the set threshold, it indicates that the fine - calibrated image is horizontal left - right. Otherwise, control the sampling unit 1 to deflect around the Y - axis according to the left - right clarity difference value for left - right tilt calibration; If the up - down clarity difference value is less than the set threshold, it indicates that the fine - calibrated image is horizontal up - down. Otherwise, control the sampling unit 1 to deflect around the X - axis according to the up - down clarity difference value for up - down tilt calibration; Repeat this step until the overall clarity converges within the set threshold.
[0059] The overall clarity metric value is:
[0060] (1)。
[0061] The clarity calculation method for the data source framed out by any of the said sampling frames for clarity evaluation is as follows:
[0062] Calculation data source Gradient in the X direction :
[0063] (2)
[0064] Wherein is the convolution kernel of the gradient in the X direction, is:
[0065] (3)
[0066] Calculation data source Gradient in the Y direction :
[0067] (4)
[0068] Wherein is the convolution kernel of the gradient in the Y direction, is:
[0069] (5)
[0070] Calculation data source Gradient magnitude of each pixel point :
[0071] (6)
[0072] Calculation data source Sharpness of S :
[0073] (7)
[0074] Wherein, is the gradient magnitude of the th pixel in the image. This method can extract the regions with large changes in the image, that is, the edges. By calculating the gradient magnitude of the pixel points, the change situation in the image can be obtained, and the regions with larger gradients may correspond to the details and edges in the image.
[0075] Embodiment 2
[0076] Embodiment 2 is a further improvement of Embodiment 1; further explanation, the same components will not be elaborated here, such as Figure 1-10As shown, the target sampling object is an optical inspection consumable, which can be an optical inspection consumable with different numbers of holes such as 96-well or 384-well, or an optical inspection consumable with different heights such as 0.1 mm or 0.2 mm. In this embodiment, the optical inspection consumable is a PCR tube. The image sampling and analysis device includes an optical excitation unit that can act on the target sampling object to cause a fluorescence reaction. A temperature control module capable of adjusting the temperature of the target sampling object is provided at the loading unit. In the sampling target loading step, after the target sampling object 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 sampling object, and the optical excitation unit is started. The optical excitation unit acts on the target sampling object to cause a fluorescence reaction. At this time, the target sampling object is in a state to be sampled.
[0077] The target sampling object is provided with fluorescence pore positions arranged in an array. Before using the clarity sampling frame to frame 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 detection algorithm is applied to detect potential circular targets in the image, so as to determine the center position and circular contour of each fluorescence pore position. The center coordinates of the circles of each fluorescence pore position are sorted according to the position, and then a region adapted to the fluorescence pore positions is set as the clarity sampling frame. In this embodiment, a region adapted to four fluorescence pore positions is selected as the clarity sampling frame, that is, the clarity sampling frame is a matrix with a size of 100*100 pixels. Images are continuously taken, and then the clarity differences between the four corners and the center are compared. 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 best horizontal clarity position is reached.
[0078] The image sampling and analysis device further 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 around the X-axis and Y-axis under the action of a rotating motor to achieve focusing of the sampling unit 1 in the horizontal direction. The setting of the rotating motor belongs to the prior art and is not shown 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 move relative to the reference unit 4 along the Z-axis through the adaptive adjustment unit 2 to achieve focusing of the sampling unit 1 in the Z-axis direction. The sampling unit 1 and the adaptive adjustment unit 2 are respectively signal-connected and controlled by a control device.
[0079] The adaptive adjustment unit 2 includes a driving device 21, a transmission device, and a focusing connection block 23. The driving device 21 can drive the focusing connection block 23 to move along the Z-axis direction. The focusing connection block 23 is provided with a cantilever structure 24. One end of the cantilever structure 24 is connected to the focusing connection block 23, and the other end is provided with a lens support block 8. The focusing lens 12 is assembled in the lens support block 8.
[0080] A fixing plate 5 is provided on the reference unit 4. A guide rail is provided on the fixing plate 5 in the Z-axis direction. One side of the focusing connection block 23 is provided with a cantilever structure 24, and the other side is matched with the guide rail. The driving device 21 can drive the focusing 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 further includes a light-shielding sleeve 7. The light-shielding sleeve 7 is coaxially arranged with the image sampling component 11. A moving guide groove 6 matched with the light-shielding sleeve 7 is provided on the cantilever structure 24. The moving guide groove 6 is arranged around the lens support block 8. One end of the light-shielding sleeve 7 is connected to the reference unit 4, and the other end is matched with the moving guide groove 6. When the cantilever structure 24 moves, at least part of the light-shielding sleeve 7 extends into the moving guide groove 6 to prevent external light from entering the focusing lens 12.
[0081] In this embodiment, the transmission device is a lead screw 22. The driving device is connected to the lead screw 22. The focusing connection block 23 is threadedly connected to the lead screw 22. The driving device 21 drives the lead screw 22 to rotate, drives the focusing connection block 23 to slide along the guide rail, and further drives the cantilever structure 24 to move up and down.
[0082] In this article, specific embodiments are used to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
[0083] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of this invention is usually placed during use. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present invention.
[0084] In the description of the present invention, it should also be noted that unless otherwise clearly specified and limited, the terms "set", "installed", "connected", "connected" 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 directly connected, or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
Claims
1. A method for automatic focusing of an adaptive device, characterized in that: Applied to an image sampling and analysis device, the image sampling and analysis device comprises a sampling unit, an adaptive adjustment unit, and a loading unit for loading a target sample, the adaptive adjustment unit can drive the sampling unit to move so that the sampling unit and the target sample are in focus, the target sample is an optical inspection consumable, and the target sample is provided with fluorescent holes arranged in an array, the image sampling and analysis device comprises an optical excitation unit that can act on the target sample to make it produce a fluorescent reaction, and the loading unit is provided with a temperature control module that can adjust the temperature of the target sample, 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, start the temperature control module to adjust the temperature of the target sample, start the optical excitation unit, the optical excitation unit acts on the target sample to make it produce a fluorescent reaction, so that the target sample is in a state to be sampled, and establish an XYZ axis coordinate system with the center point of the sampling unit as the origin; Rough calibration sampling steps: Start the adaptive adjustment unit, and drive the sampling unit along the Z axis in 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; Rough calibration focus steps: before using the clarity sampling frame to select the data source, first perform binarization processing on the original image to highlight the difference between the target object and the background, then apply the canny edge search algorithm 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 position as the clarity sampling frame; 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 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 , 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 Accept poor focal length, where T is the current temperature and e is the base of the natural logarithm. 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 focus step to iterate. During the iteration process, the temperature T is gradually reduced to the set temperature threshold until the iterative data converges, the vertical calibration image is obtained, and the vertical calibration adjustment is completed; 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 Converge within the set threshold; 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.
2. The method for automatic focusing of an adaptive device as claimed in claim 1, characterized in that: Overall clarity measure for: (1)。 3. The method for automatic focusing of an adaptive device according to any one of claims 1 to 2, 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.
4. 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.
5. The method for automatic focusing of an adaptive device as claimed in claim 4, 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.
6. The method for automatic focusing of an adaptive device as claimed in claim 5, 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
Projector correction method and system
CN116266341A
Microscope automatic focusing method based on deep learning and image processing
CN117970595A