Microscope automatic focusing method, system and device

By judging the degree of discrete and momentum search of the FV value in microscope automatic focusing technology, combined with motor transmission control, the problem of low local optimal solution trap and focus efficiency was solved, and the accuracy and efficiency of autofocus were significantly improved.

CN118112772BActive Publication Date: 2025-01-28SUZHOU SEMORR MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410453263.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-16
Publication Date
2025-01-28
Estimated Expiration
2044-04-16

AI Technical Summary

Technical Problem

The existing microscope autofocus technology has problems with local optimal solution traps and low focus efficiency, especially when the image sharpness value FV value fluctuates greatly.

Method used

Through the discrete level of FV values, the misjudgment caused by small data fluctuations is filtered, and the amount of kinetic amount is added to the optimal solution search method to increase the probability of obtaining global optimal solutions. At the same time, the speed control of the motor is controlled. Improve the focus efficiency.

Benefits of technology

Effectively improve the accuracy and efficiency of the automatic microscope autofocus, reduce the probability of insufficient focusing, and significantly increase the possibility of obtaining global optimal solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118112772B_ABST
    Figure CN118112772B_ABST
Patent Text Reader

Abstract

The present invention relates to a microscope autofocus method, comprising: S1 obtaining an image clarity value FV; S2 determining the discrete degree of the FV value; S3 finding a point on one side of the global optimal solution in combination with momentum; S4 reducing the focal length adjustment speed, performing a reverse search without momentum, calculating the FV value at the same time, and finding the maximum value of the FV, then stopping zooming, and completing an autofocus. The microscope autofocus method of the present invention effectively filters out data fluctuation interference by determining the discrete degree of the image clarity value FV, and by adding momentum to the optimal solution search method, it is capable of continuing to search beyond the local optimal solution, greatly increasing the probability of obtaining the global optimal solution. In addition, in order to find a suitable clear point in the optimal solution as quickly as possible each time, variable speed control is performed on the motor speed to improve the focusing efficiency. Compared with the prior art, the method of the present invention has a faster focusing speed, and the probability of unclear focusing is significantly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] The current autofocus in microscopes is a passive autofocus, which is achieved by analyzing image features to obtain the image clarity value FV (Focus Value), and then driving the motor to adjust the focal length to the optimal position.

[0003] In actual situations, the calculated FV value will fluctuate to a certain extent and is not a perfect normal distribution. Therefore, it is necessary to find the optimal solution based on the calculated FV value. The methods are basically based on the hill climbing method, which is a greedy algorithm. When there is a pseudo-extreme value, if the pseudo-extreme value appears before the optimal extreme value, it will fall into the trap of the local optimal solution, and thus the global optimal solution cannot be found.

[0004] Moreover, in order to reduce the deviation between the position obtained by calculating the optimal solution and the position when the motor stops, the motor is often set at a relatively slow speed, which affects the focusing efficiency. Summary of the invention

[0005] The technical problem to be solved by the present invention is to design a microscope automatic focusing method, system and device, process the FV value, add data discreteness judgment to filter out misjudgment caused by small data fluctuations, greatly increase the probability of obtaining the global optimal solution by adding momentum to the optimal solution search method, perform variable speed control on the motor speed, improve focusing efficiency, and solve the existing technical problems.

[0006] In order to solve the above technical problems, the present invention provides a microscope automatic focusing method, comprising the following steps:

[0007] Step S1: Obtain an image definition value FV.

[0008] Step S2: Determine the discrete degree of the FV value, and go to step S3 when the discrete degree is greater than the set threshold.

[0009] Step S3: Find a point on one side of the global optimal solution in combination with momentum.

[0010] Step S4: reduce the speed of adjusting the focus, perform another search in the reverse direction without combining momentum, calculate the FV value at the same time, find the maximum FV value, then stop zooming, and complete an automatic focus.

[0011] Furthermore, in step S1, the algorithm for obtaining the image clarity evaluation is a grayscale gradient method or a variance algorithm or a high-frequency component method using different operators (Sobel operator, Laplacian operator, etc.).

[0012] Furthermore, in step S1, the image definition value FV is calculated as follows:

[0013]

[0014] FV n =αH n +(1-α)*V n ;

[0015] Where: FV n is the calculated FV value of each block, α is a constant, 0.75≤α≤0.9, H n With V n are the output values ​​of each block in the horizontal and vertical directions after passing through the filter, Blocks is the number of blocks, weight is the weight matrix, weight n is the weight of the corresponding block in the weight matrix.

[0016] Furthermore, in step S2, the average difference is used to calculate the degree of dispersion of the data:

[0017]

[0018] Where M is the degree of discreteness, x is the current FV data, x′ is the average of the data set for calculating the discrete quantity, and N is the number of data.

[0019] Furthermore, 3≤N≤10.

[0020] Furthermore, in step S3, the calculation interval Δt between two adjacent FV values ​​remains unchanged, and each time a part of the previous gradient is transferred to the next gradient comparison:

[0021] W′ n =γW′ n-1 +(1-γ)W n ;

[0022] W n =FV n -FV n-1 ;

[0023] Among them, W′ n is the result of combining the gradient and momentum obtained this time, γ is the transfer ratio, W n is the difference of the current FV value, 0.5≤γ≤0.9, when W′ n When it is less than 0, the point on one side of the global optimal solution is found.

[0024] Further, in step S4, the range of the reverse search is set to the focus adjustable range of the calculation interval Δt of four FV values.

[0025] The present invention also provides a microscope automatic focusing system, comprising

[0026] Image clarity acquisition module: used to calculate the image clarity value FV;

[0027] Discrete degree judgment module: used to calculate the discrete degree of FV value and judge whether it is greater than the set threshold;

[0028] Global optimal solution search module: used to combine momentum to achieve the goal of crossing the local optimal solution, each time passing a part of the previous gradient to a certain gradient comparison of the next time, until a negative number appears;

[0029] Global optimal solution determination module: It is used to reduce the focal length adjustment speed according to the point on one side of the global optimal solution found by the global optimal solution search module, and perform another search in the reverse direction without combining momentum, while calculating the FV value and finding the maximum FV value, that is, determining the point of the global optimal solution.

[0030] The present invention also provides a microscope automatic focusing device, comprising:

[0031] at least one processor; and

[0032] at least one memory in communication with the processor;

[0033] The memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the microscope auto-focusing device to perform the aforementioned microscope auto-focusing method.

[0034] Furthermore, it also includes a focus adjustment unit, which includes a driving motor and a zoom objective lens, and the focus adjustment is achieved by rotating the motor.

[0035] Beneficial effects of the present invention:

[0036] The microscope autofocus method of the present invention effectively filters out data fluctuation interference by judging the discrete degree of the image clarity value FV, and by adding momentum to the optimal solution search method, it is capable of continuing to search beyond the local optimal solution, greatly increasing the probability of obtaining the global optimal solution. In addition, in order to find a suitable clear point in the optimal solution as quickly as possible each time, the motor speed is variable to improve the focusing efficiency. Compared with the prior art, the method of the present invention has a faster focusing speed and a significantly reduced probability of unclear focus. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The specific implementation of the present invention will be further explained below in conjunction with the accompanying drawings.

[0038] Figure 1 A flowchart of the microscope auto-focusing method of the present invention;

[0039] Figure 2 is an example of the FV value calculated in Example 1;

[0040] Figure 3 It is a block diagram of the microscope autofocus system of the present invention. DETAILED DESCRIPTION

[0041] Example 1

[0042] Combination Figure 1 The microscope autofocus method of this embodiment includes the following steps:

[0043] Step S1: Obtain an image definition value FV.

[0044] In this embodiment, preferably, in step S1, the algorithm for obtaining the image clarity evaluation is a grayscale gradient method or a variance algorithm or a high-frequency component method using different operators (Sobel operator, Laplacian operator, etc.).

[0045] This embodiment takes the HiSilicon 3403 embedded motherboard as an example. In this embodiment, the HiSilicon 3403 calculates the FV value using the high-frequency component method, that is, the clearer the image, the larger the amplitude of the high-frequency part. The high-frequency component can be obtained by passing the image through a high-pass filter. HiSilicon 3403 provides two independent AF statistical information acquisition modules, FE (Front End) and BE (Eeotnd End). FE is mainly used for statistics of original data, and BE is mainly used for statistics of information after image optimization processing. The BE module is used in this embodiment. HiSilicon 3403 provides four filters and brightness information, namely horizontal filters H1 and H2, vertical filters V1 and V2, and a highlight counter. HiSilicon 3403 performs block statistics on the filtered image. In this embodiment, the blocks are set to the default 17*15.

[0046] In this embodiment, the configuration parameters are divided into AF global configuration parameters, configuration parameters of four filters, and configuration parameters of the final statistical result output format. Among them, the important ones are the statistical mode peak_mode (summing the output value of each pixel in the block after filtering) and square_mode (summing the output value of each pixel in the block after filtering and then squaring it) in the AF global configuration parameters, the FE cropping fe_crop of the AF input image, and the filter strength configuration pre_flt_cfg.

[0047] In this embodiment, the relevant important parameters are configured as follows:

[0048] a) In order to make the variation trend waveform of the obtained FV value steeper near the optimal solution, this embodiment adopts Square_mode (square sum mode), which first normalizes the filter output and then performs square calculation.

[0049] b) Set the weight matrix that needs to be involved in the calculation to be consistent with the number of blocks, and set the weight concentrated in the middle area to 2 and the edge to 1.

[0050] c) Crop the 4K resolution image area and set the fe_crop crop size to 960*540 in the middle area, which can reduce the amount of calculation and focus on the central area of ​​key observation.

[0051] d) To make the filtered output steeper and facilitate subsequent searches, set the filter strength to 0xFF9E, with a range of 0x0000 to 0xFFFF.

[0052] In this embodiment, preferably, in step S1, the method for calculating the image definition value FV is:

[0053]

[0054] FV n =αH n +(1-α)*V n ;

[0055] Where: FV n is the calculated FV value of each block, α is a constant, 0.75≤α≤0.9, H n With V n are the output values ​​of each block in the horizontal and vertical directions after passing through the filter, Blocks is the number of blocks, weight is the weight matrix, weight n is the weight of the corresponding block in the weight matrix.

[0056] Step S2: Determine the discrete degree of the FV value and filter out data fluctuation interference. When the discrete degree is greater than the set threshold, proceed to step S3.

[0057] In this embodiment, preferably, the calculation of the degree of data dispersion is introduced. In step S2, the degree of data dispersion is calculated using the average difference:

[0058]

[0059] Where M is the degree of discreteness, x is the current FV data, x′ is the average of the data set for calculating the discrete quantity, and N is the number of data.

[0060] In this embodiment, preferably, 3≤N≤10. In this embodiment, N is set to 5, that is, the discreteness of 5 FV values ​​is counted at a time. When N is set to 5, the filter threshold range of M can be set between 2 and 8. In this embodiment, the filter threshold is set to 5, that is, the sum of the deviations of each FV value from the average value is 5, that is, when M>5, the next step of searching for the optimal solution is performed.

[0061] Step S3: Find a point on one side of the global optimal solution in combination with momentum.

[0062] The traditional hill climbing method decides whether to continue searching based on the size of the two points before and after. This algorithm is also a method for determining gradient changes: Where FV n With FV n-1 are two adjacent FV values, Δt is the calculation interval between the two FV values. When the calculated frequency is consistent, that is, Δt remains unchanged, it is only necessary to determine the difference between the two FV values ​​before and after, that is:

[0063] W n =FV n -FV n-1 .

[0064] In this embodiment, preferably, in step S3, the calculation interval Δt between two adjacent FV values ​​remains unchanged, and Δt is accurate to 33 milliseconds, and each time a part of the previous gradient is transferred to the next gradient comparison:

[0065] W′ n =γW′ n-1 +(1-γ)W n ;

[0066] W n =FV n -FV n-1 ;

[0067] Among them, W′ n is the result of combining the gradient and momentum obtained this time, γ is the transfer ratio, W n is the difference of the current FV value, 0.5≤γ≤0.9, when W′ n When it is less than 0, the point on one side of the global optimal solution is found.

[0068] In this example, γ is set to 0.85. After the gradient is transferred, the original W n If it is already negative, the last W' is added n-1 After a part of nis still a positive number, so it is possible to go beyond the local optimal solution and continue searching, and finally under the gradient on the other side of the global optimal solution

[0069] Find W′ in the n A point where the value is negative. Figure 2 As an example, when using the calculated FV value, W′ n When we look at the formula for the value, we can find that when calculating W′3, which is the difference between FV4 and FV3, it should be a negative number -2. However, due to the addition of the previous momentum, W3′ now becomes a positive number, thus bypassing the trap of the local optimal solution. When calculating the difference between FV7 and FV6, we can get a negative number, which is the point on the side of the global optimal solution.

[0070] Step S4: reduce the speed of adjusting the focus, perform another search in the reverse direction without combining momentum, calculate the FV value at the same time, find the maximum FV value, then stop zooming, and complete an automatic focus.

[0071] The point found in step S3 is not the point of the global optimal solution, but is on one side of the global optimal solution. At this time, the focal length adjustment speed is reduced. In this embodiment, the focal length adjustment is achieved by setting a motor to drive the zoom objective lens. In this embodiment, the speed of the motor is reduced to half of the original speed.

[0072] In this embodiment, preferably, in step S4, the reverse search range is set to the focusable range of the calculation interval Δt of the four FV values. The general search range can be the entire focusable range after the motor is reversed at that point. In this embodiment, in order to find the appropriate clear point in the optimal solution as quickly as possible each time, the reverse search range is set to the range of the four Δt motors that can focus, and the FV value is calculated at the same time, and the maximum FV value is found, and then the zoom motor is stopped to complete an automatic focus.

[0073] Example 2

[0074] Combination Figure 3 The microscope autofocus system of this embodiment includes

[0075] Image clarity acquisition module: used to calculate the image clarity value FV;

[0076] Discrete degree judgment module: used to calculate the discrete degree of FV value and judge whether it is greater than the set threshold;

[0077] Global optimal solution search module: used to combine momentum to achieve the goal of crossing the local optimal solution, each time passing a part of the previous gradient to a certain gradient comparison of the next time, until a negative number appears;

[0078] Global optimal solution determination module: It is used to reduce the focal length adjustment speed according to the point on one side of the global optimal solution found by the global optimal solution search module, and perform another search in the reverse direction without combining momentum, while calculating the FV value and finding the maximum FV value, that is, determining the point of the global optimal solution.

[0079] Preferably, this embodiment further comprises a focus adjustment module, wherein the focus adjustment module drives the zoom objective lens through a motor and realizes focus adjustment through the rotation of the motor.

[0080] Example 3

[0081] The microscope autofocus device of this embodiment includes:

[0082] at least one processor; and

[0083] at least one memory in communication with the processor;

[0084] The memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the microscope auto-focusing device to perform the microscope auto-focusing method in Example 1.

[0085] Preferably, the present embodiment further comprises a focus adjustment unit, wherein the focus adjustment unit comprises a driving motor and a zoom objective lens, and focus adjustment is achieved by rotating the motor.

[0086] Many specific details are described in the above description to facilitate a full understanding of the present invention. However, the above description is only a preferred embodiment of the present invention. The present invention can be implemented in many other ways different from those described herein, so the present invention is not limited to the specific implementation disclosed above. At the same time, any person familiar with the art can make many possible changes and modifications to the technical solution of the present invention using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of protection of the technical solution of the present invention.

Claims

1. A microscope autofocus method, characterized in that: The steps include: Step S1: Obtaining an image definition value FV; Step S2: Determine the discrete degree of the FV value, and when the discrete degree is greater than the set threshold, proceed to step S3; Step S3: Find the point on one side of the global optimal solution in combination with momentum; Step S4: reduce the speed of adjusting the focus, perform another search in the reverse direction without combining the momentum, calculate the FV value at the same time, find the maximum FV value, then stop zooming, and complete an automatic focus; In step S1, the image definition value FV is calculated as follows: ; ; in: is the calculated FV value of each block, is a constant, 0.75≤ ≤0.9, and They are the output values ​​of each block in the horizontal and vertical directions after passing through the filter, is the number of blocks, is the weight matrix, is the weight of the corresponding block in the weight matrix; In step S2, the average difference is used to calculate the degree of dispersion of the data: ; in is the degree of discreteness, is the current FV data, To calculate the mean of a data set of discrete quantities, is the number of data; In step S3, the calculation interval between two adjacent FV values ​​is Unchanged, each time a part of the previous gradient is passed to the next gradient comparison: ; ; in, is the result of combining the gradient and momentum obtained this time, To transfer the ratio, The difference between the current FV values, 0.5≤ ≤0.9, when When it is less than 0, the point on one side of the global optimal solution is found.

2. The microscope autofocus method according to claim 1, characterized in that: In step S1, the algorithm for obtaining the image clarity evaluation is a grayscale gradient method or a variance algorithm or a high-frequency component method using different operators.

3. The microscope autofocus method according to claim 1, characterized in that: 3≤ ≤10。 4. The microscope autofocus method according to claim 1, characterized in that: In step S4, the range of reverse search is set to the calculation interval of 4 FV values adjustable focus range.

5. A microscope autofocus system, characterized in that: include Image definition acquisition module: used to calculate the image definition value FV; the calculation method of the image definition value FV is: ; ; in: is the calculated FV value of each block, is a constant, 0.75≤ ≤0.9, and They are the output values ​​of each block in the horizontal and vertical directions after passing through the filter, is the number of blocks, is the weight matrix, is the weight of the corresponding block in the weight matrix; Discreteness judgment module: used to calculate the discreteness of FV value and judge whether it is greater than the set threshold; use the average difference to calculate the discreteness of data: ; in is the degree of discreteness, is the current FV data, To calculate the mean of a data set of discrete quantities, is the number of data; Global optimal solution search module: used to combine momentum to achieve the goal of crossing the local optimal solution, each time passing a part of the previous gradient to a certain gradient comparison of the next time, until a negative number appears; Global optimal solution determination module: used to reduce the focal length adjustment speed according to the point on one side of the global optimal solution found by the global optimal solution search module, and perform another search in the reverse direction without combining momentum, while calculating the FV value and finding the maximum FV value, that is, determining the point of the global optimal solution; the calculation interval between two adjacent FV values Unchanged, each time a part of the previous gradient is passed to the next gradient comparison: ; ; in, is the result of combining the gradient and momentum obtained this time, To transfer the ratio, The difference between the current FV values, 0.5≤ ≤0.9, when When it is less than 0, the point on one side of the global optimal solution is found.

6. A microscope autofocus device, characterized in that: include: at least one processor; as well as at least one memory in communication with the processor; Wherein, the memory stores instructions executable by the processor, and the instructions are executed by the processor to enable the microscope autofocus device to perform the microscope autofocus method described in any one of claims 1 to 4.

7. The microscope autofocus device according to claim 6, characterized in that: It also includes a focus adjustment unit, which includes a driving motor and a zoom objective lens, and the focus adjustment is achieved by rotating the motor.

Citation Information

Patent Citations

  • Method for automatically focusing microscope system in urinary sediment examination equipment

    CN101702053A

  • Self-adaptive automatic focusing method based on gray gradient value

    CN109669264A