Rapid focusing strategy method based on stereomicroscope

By using a combination method of large-step coarse adjustment and small-step fine adjustment in the astronomical microscope, synchronous coarse adjustment is combined with image acquisition time and motor running speed, the problem of excessive calculation burden of traditional automatic focusing methods is solved, and efficient and accurate focusing effect is achieved.

CN119620367APending Publication Date: 2025-03-14WUZHOU UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411723200.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

When traditional autofocusing methods deal with high-resolution images or scenes that require fast focus, the calculation burden is too high and it is difficult to meet the real-time requirements.

Method used

A fast focus strategy based on asana microscope is proposed. Through a combination of large-step coarse adjustment and small-step fine adjustment, the image acquisition time and motor running speed are used to synchronize coarse adjustment to quickly find the position of the maximum definition value, and conduct small-step search and fine adjustment near it to obtain the final clearest position.

Benefits of technology

The focus efficiency and accuracy are significantly improved, and the focus time is improved by about 75% compared with the traditional global method, meeting the real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119620367A_ABST
    Figure CN119620367A_ABST
Patent Text Reader

Abstract

A method based on a rapid focusing strategy of a stereomicroscope comprises the following steps: S100, performing large-step coarse adjustment on an image acquired by the stereomicroscope, and acquiring a position with a maximum definition value by combining image acquisition time and motor operation speed as synchronous coarse adjustment; and S200, small-step search fine adjustment is carried out near the position with the obtained maximum definition value, and the final clearest position is obtained. According to the method, an appropriate coarse adjustment step length is firstly selected for rapid scanning to save time, and automatic adjustment is performed near a maximum value obtained after coarse adjustment to fine scanning, so that the accuracy of the focusing process is ensured, and focusing convergence is accelerated. According to the method, the focusing efficiency and accuracy are remarkably improved, and extremely high application potential and popularization value are shown.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a method based on a fast focusing strategy of a stereo microscope. Background Art

[0002] With the rapid progress of computer technology and image processing capabilities, the deep integration of optical microscopes and computer vision technology has led to the widespread application of automatic detection systems, covering multiple key fields such as industry, medicine, and biology. This system has significantly improved the efficiency and accuracy of the detection process with its high efficiency, convenience, and intelligence. Among them, imaging quality, as a core indicator for measuring system performance, is directly related to the reliability and timeliness of the detection results. Therefore, exploring efficient methods for obtaining high-definition images has become an indispensable basic task in the construction of automatic detection systems.

[0003] As a key link in optimizing imaging quality, the development of focusing technology has witnessed a profound transformation from traditional manual focusing to automatic focusing based on advanced image processing technology. The automatic focusing method accurately evaluates the current focusing state by capturing and analyzing subtle information in the image in real time, and automatically adjusts the lens parameters to achieve optimal imaging focus. Compared with the traditional manual focusing method, automatic focusing not only significantly improves the focusing speed and accuracy, but also greatly simplifies the operation process, making it widely used and recognized in fields with high precision requirements such as biological imaging.

[0004] In the evolution of autofocus technology, scholars have extensively explored multiple dimensions, including preprocessing technology of focused images, innovation of focus evaluation functions, and deep optimization of search algorithms. As one of the core directions of autofocus research, the optimization of search algorithms is particularly critical, aiming to improve focusing efficiency and accuracy. Traditional search methods, such as traversal search, hill climbing search, Fibonacci search, and curve fitting search, each have their limitations. Although the traversal search method is comprehensive, it is time-consuming and difficult to meet real-time requirements; the hill climbing search method is easily constrained by the characteristics of the focus evaluation function and is prone to fall into local optimality; the Fibonacci search method is limited by application scenarios and costs; the curve fitting search method is sensitive to the shape of the curve and performs poorly in flat areas.

[0005] The advantages of the traversal search method are mainly reflected in its robustness and controllability of focus accuracy. First, it is not affected by local extrema, which is a problem that many traditional focus algorithms find difficult to overcome. In the process of autofocus, image signals often contain complex noise and interference, which may lead to multiple local extrema points in the focus function. This method avoids falling into these local extrema by systematically adjusting the search parameters, thereby ensuring the accuracy and reliability of the final focus result. Secondly, the focus accuracy only depends on the set search step size, which provides users with great flexibility. In practical applications, users can reasonably set the search step size according to specific needs and hardware conditions to achieve the desired focus accuracy. As long as the set step size is small enough, a focusing effect very close to the ideal state can be achieved, which is particularly important for high-precision imaging applications. However, the disadvantages of this method are also significant. The most prominent problem is that its calculation amount is relatively large and the real-time performance is not high. Since this method uses equal steps to traverse the entire focus interval, no matter how the image features change, every possible focus position needs to be calculated and evaluated. This results in a significant increase in the computational burden when processing high-resolution images or scenes that require fast focusing, making it difficult to meet real-time requirements. Summary of the invention

[0006] In order to solve the above problems, the present disclosure provides a method based on a stereo microscope fast focusing strategy, which comprises the following steps:

[0007] S100: performing large step length coarse adjustment on the image acquired by the stereo microscope, wherein the image acquisition time and the motor running speed are combined as synchronous coarse adjustment to obtain the position of the maximum clarity;

[0008] S200: Perform a small step search and fine adjustment near the acquired position of the maximum clarity value to obtain the final clearest position.

[0009] In addition, the present invention also discloses a device based on a stereo microscope fast focusing strategy, comprising:

[0010] A device for making a large-step coarse adjustment of an image acquired by a stereo microscope, wherein the image acquisition time and the motor running speed are combined as a synchronous coarse adjustment to obtain a position of maximum clarity;

[0011] A device for performing a small step search and fine adjustment near the position of the acquired maximum clarity value to obtain the final clearest position.

[0012] In addition, the present invention also discloses a computer storage medium, wherein the storage medium includes computer instructions, and when the computer instructions are executed on the computer, the computer executes the method.

[0013] In addition, the present invention also discloses an electronic device, wherein the electronic device comprises:

[0014] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein:

[0015] When the processor executes the program, the method described is implemented.

[0016] Through the above technical solutions, this method proposes a coarse and fine search algorithm (CAFSA). The CAFSA algorithm cleverly divides the search process into two parts: coarse adjustment and fine adjustment, and adopts differentiated search strategies: in the coarse adjustment part, a large step size is used to quickly search the entire area to find the maximum value; in the fine adjustment part, a finer step size is used to accurately search the vicinity of the coarse adjustment maximum value, and the maximum image clarity evaluation value is the clearest position. The design of this search strategy not only overcomes the limitations of traditional methods, but also provides new ideas and directions for the development of autofocus technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of a method based on a fast focusing strategy of a stereo microscope provided in one embodiment of the present disclosure;

[0018] Figure 2 is a flow chart of a coarse adjustment method provided in one embodiment of the present disclosure;

[0019] Figure 3 is a flow chart of a fine-tuning method provided in one embodiment of the present disclosure;

[0020] Figure 4 is a modeling effect diagram provided in one embodiment of the present disclosure;

[0021] Figure 5 is a diagram of a physical prototype provided in one embodiment of the present disclosure;

[0022] Figure 6 It is a matlab simulation diagram provided in one embodiment of the present disclosure;

[0023] Figure 7 is a schematic diagram of the effect before coarse adjustment provided in one embodiment of the present disclosure;

[0024] Figure 8 This is a schematic diagram of a 0.5 mm step length coarse adjustment effect provided in one embodiment of the present disclosure;

[0025] Fig. 9 This is a schematic diagram of the imaging effect after coarse adjustment with a step length of 0.2 mm provided in one embodiment of the present disclosure;

[0026] Fig.10 This is a schematic diagram of the imaging effect after coarse adjustment with a step length of 0.1 mm provided in one embodiment of the present disclosure;

[0027] Fig.11 This is a schematic diagram of the imaging effect after coarse adjustment with a step length of 0.05 mm provided in one embodiment of the present disclosure;

[0028] Fig.12 is a fine-tuning effect diagram provided in one embodiment of the present disclosure;

[0029] Fig.13 is another fine-tuning effect diagram provided in one embodiment of the present disclosure;

[0030] Fig.14 This is a schematic diagram of the fine-tuning effect of the sample 1 combination provided in one embodiment of the present disclosure;

[0031] Fig.15 It is a schematic diagram of the fine-tuning effect of the sample 2 combination provided in one embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] In one embodiment, Figure 1 As shown, the present disclosure provides a method based on a stereo microscope fast focusing strategy, which comprises the following steps:

[0033] S100: performing large step length coarse adjustment on the image acquired by the stereo microscope, wherein the image acquisition time and the motor running speed are combined as synchronous coarse adjustment to obtain the position of the maximum clarity;

[0034] S200: Perform a small step search and fine adjustment near the acquired position of the maximum clarity value to obtain the final clearest position.

[0035] As far as this embodiment is concerned, the existing microscope can be implemented with coarse adjustment and fine adjustment, but they are all based on the hill climbing strategy. Since the hill climbing method cannot meet the actual engineering needs and the accuracy is too low, the CAFSA algorithm is proposed in this method. The traditional method does not combine the image acquisition time and the motor running speed as synchronous coarse adjustment, and there is no coarse adjustment and fine adjustment optimal combination matching strategy.

[0036] This method first selects a suitable coarse adjustment step size for fast scanning to save time, and then automatically adjusts to fine scanning near the maximum value obtained after coarse adjustment to ensure the accuracy of the focusing process and accelerate the focusing convergence. Compared with the traditional global method, the focusing time of this method is about 75% more efficient, which significantly improves the focusing efficiency and accuracy, showing extremely high application potential and promotion value.

[0037] In another embodiment, step S100 further includes: determining the coarse adjustment step size according to the depth of field of the microscope, and quickly traversing to find the position N*S of the maximum value in the interval, where N is the position of the motor that records the maximum clarity value during the coarse adjustment process, and S is the coarse adjustment step size.

[0038] In this embodiment, the specific process of coarse adjustment is as follows: Figure 2 As shown. At the beginning of coarse adjustment, reset the Z-axis motor, start the timing and start collecting images, start the motor to run with a coarse step length, then collect an image every 33ms and record the position of the motor at that moment. Calculate the value through the clarity function based on the collected current frame image, and compare it with the previous frame value, save the clarity value of the maximum value image and the position information of the image, and determine whether it has reached the maximum position after each step. When it reaches the maximum position, the coarse adjustment is completed and the position of the maximum value of the coarse adjustment clarity is returned.

[0039] During the automatic focusing process of a microscope, the selection of the coarse adjustment step size is a key step, which directly affects the focusing speed and efficiency.

[0040] Several factors need to be considered for coarse adjustment: (1) Focusing speed: The main goal of the coarse adjustment stage is to quickly find the position near the focus, so the step size selection should be based on improving the focusing speed. A large step size can reduce the search time, thereby speeding up the focusing speed. (2) Focusing accuracy: Although the coarse adjustment stage does not require extremely high focusing accuracy, the step size should not be too large to avoid missing the position near the focus, which will cause difficulties in the subsequent fine adjustment stage. (3) Microscope characteristics: The depth of field, focal length, numerical aperture and other parameters of the microscope will affect the focusing process. Therefore, when selecting the coarse adjustment step size, the specific characteristics of the microscope need to be considered to ensure a smooth focusing process.

[0041] Determination of coarse adjustment step length: (1) First make an important reference based on the depth of field of the microscope: The depth of field of the microscope is an important reference indicator. The coarse adjustment step length should not exceed the depth of field range of the microscope to ensure that the position near the focus can be found during the coarse adjustment stage. Estimate the depth of field of the microscope according to the depth of field calculation formula, and select the appropriate coarse adjustment step length accordingly. (2) Then adjust step by step according to actual conditions: In actual operation, you can first select a larger step length for coarse adjustment, and then gradually adjust the step length according to the focusing results. If you find that the focusing effect is not good, you can appropriately reduce the step length to improve the focusing accuracy. (3) Adjust according to empirical values: In actual applications, experiments can be used to verify whether the choice of coarse adjustment step length is appropriate. By comparing the focusing effect and time under different step lengths, the best coarse adjustment step length setting can be found.

[0042] S is the coarse adjustment step size. The coarse adjustment step size is 0.2mm, and the fine adjustment step size is 0.02mm for the best focusing effect.

[0043] In another embodiment, step S200 further includes: searching for the maximum image clarity value from position (N-1)*S to position (N+1)*S with a small step size.

[0044] In this embodiment, the specific process of fine-tuning is as follows: Figure 3 As shown. At the beginning of fine adjustment, the motor runs to the Z-axis position of (N-1)*S (N is the clear position N*S obtained by the last coarse adjustment, indicating the Nth acquisition), the timing is turned on and the image acquisition begins, the motor is started to run with the fine adjustment step, and then an image is acquired every 33ms while recording the position of the motor at this moment. The value is calculated by the clarity function based on the acquired frame image and compared with the value of the previous frame, and the clarity value of the maximum value image and the position information of the image are saved. After each step is completed, it is determined whether the maximum position is reached. When the maximum position (N-1)*S is reached, the fine adjustment is completed and the maximum clarity position of the fine adjustment image is returned.

[0045] The selection of the fine-tuning step size of the microscope autofocus is a critical process that directly affects the accuracy and efficiency of focusing.

[0046] Considerations for fine-tuning step size selection: (1) Accuracy: The step size should be small enough to ensure fine adjustment when approaching the focus to avoid overshoot or missing the focus. (2) Efficiency: In areas far from the focus, the step size can be relatively large to speed up the focusing speed. However, when approaching the focus, the step size should be gradually reduced to ensure the accuracy of focusing. (3) Adaptability: Different microscope models, lenses, and sample characteristics may require different step size settings. Therefore, the choice of step size should have a certain degree of flexibility to adapt to different application scenarios.

[0047] Determination of fine adjustment step length: The coarse adjustment has determined the focal point's location, so first determine the fine adjustment distance L and step length S1. Theoretically, L = (N+1)*S-(N-1)*S = 2S, and the fine adjustment step length S 1= 0.5*S, should be adjusted according to actual conditions.

[0048] In another embodiment, the image acquisition time is 33 ms.

[0049] In this embodiment, the frame rate of the image output by the CCD camera is used for calculation, for example, 1080P.30. The image output is 30 frames per second, and an interval of 1 / 30 is approximately equal to 33ms to capture one image. If the output frame rate is higher, it can be adjusted according to the frame rate. The higher the frame rate, the higher the capture accuracy.

[0050] In another embodiment, the image acquired by the stereo microscope is collected based on the number of captured frames of the camera as a benchmark and combined with the distance moved by the motor in the Z-axis direction.

[0051] As far as this embodiment is concerned, the CAFSA algorithm is improved based on the traversal search method. In order to improve the focusing rate, the number of captured frames based on the camera is collected as a benchmark, and the distance of the motor moving in the Z-axis direction is coordinated. For example, the video output rate of the camera is 1080P.30. That is, 30 frames of images are output in one second, and 30 pictures and 30 motor movement positions are obtained in one second and combined into a sequence. This method avoids repeated acquisition of images and recording of motor positions, reduces the amount of calculation, reduces the processing burden of the processor, and improves the real-time performance of the system. The faster the frame rate of the camera output, the higher the resolution accuracy.

[0052] In another embodiment, the coarse adjustment step size S=33*V, where V is the motor running speed.

[0053] In this embodiment, the coarse adjustment step length adopts a relatively coarse step length, and it is sufficient to find the approximate position. The coarse adjustment step length is synchronized with the image acquisition as much as possible, that is, S = 33*V, 33 is milliseconds, V is the motor speed, and S is the coarse adjustment step length. It is sufficient to basically determine the approximate position of the clear image in coordination with the optical magnification.

[0054] In another embodiment, the small step size S1 = 0.5*S, where S is the coarse adjustment step size.

[0055] In this embodiment, fine adjustment is performed by searching with a step size smaller than 1 / 2 within a position that is approximately twice the theoretical step size as the fine adjustment search range.

[0056] In another embodiment, a device based on a stereo microscope fast focusing strategy comprises:

[0057] A device for making a large-step coarse adjustment of an image acquired by a stereo microscope, wherein the image acquisition time and the motor running speed are combined as a synchronous coarse adjustment to obtain the position of the maximum clarity;

[0058] A device for performing a small step search and fine adjustment near the position of the acquired maximum clarity value to obtain the final clearest position.

[0059] As for this embodiment, the best combination of coarse adjustment and fine adjustment is adopted, the coarse adjustment reduces the time as much as possible, and the fine adjustment completes the detail search.

[0060] In another embodiment, the sample collected by the method is a circuit board, and a self-developed experimental prototype is used. Figure 4 , Figure 5 As shown, focusing is mainly achieved by a stepper motor driving the imaging system to move in the Z-axis direction. The optical magnification of the lens is 0.2-2 times, and the camera is 8 million pixels.

[0061] In another embodiment, the focus evaluation function is selected as follows.

[0062] The selection of the focus evaluation function is a key step, which directly affects the accuracy and efficiency of image focusing. The focus evaluation function can be divided into the following categories: (1) Gradient edge-based evaluation algorithm (spatial domain) (2) Frequency domain evaluation algorithm (3) Information entropy-based evaluation algorithm (4) Image statistics-based evaluation algorithm.

[0063] Considering the practicality in engineering applications, the first evaluation algorithm based on gradient edge and energy calculation algorithm are generally used as the judgment of image clarity. The operators commonly used in the evaluation algorithm based on gradient edge are the first-order differential operator Sobel operator and the second-order differential operator Laplacaian operator; Sobel operator is a discrete differential operator used for edge detection, which combines Gaussian smoothing and differential derivation and can produce better edge detection effect. In the focus evaluation function, Sobel operator can be used to calculate the gradient of the image to evaluate the clarity of the image. Laplacian operator Laplacian is used to detect grayscale changes in the image. In the focus evaluation function, Laplacian operator can be used to calculate the second-order derivative of the image to evaluate the clarity of the image. The energy algorithm is a focus evaluation function based on the statistical characteristics of the grayscale distribution of the image. It evaluates the clarity of the image by calculating the distribution and change of the grayscale value in the image.

[0064] This method mainly uses the Sobel operator as the evaluation function. The Sobel operator is used to estimate the gradient values ​​in the horizontal and vertical directions, and the square operation is used to amplify the edge gradient of the image. The evaluation function f(I) is defined as the sum of the squares of the gradients, and the threshold T is introduced to adjust the sensitivity of the evaluation function. The expression is as follows:

[0065] f(I)=∑ x ∑ y [S(x,y)] 2 ,S(x,y)>T (1)

[0066] Where S(x,i) represents the convolution of the pixel (x,y) in image I with the Sobel operator, and the expression is as follows:

[0067]

[0068] For digital images, Gx(x, y) and Gy(x, y) in the above formula can be expressed by formula (3) and formula (4) respectively:

[0069] G x (x,y)=I(x-1,y+1)+2I(x,y+1)+I(x+1,y+1)

[0070] -I(x-1,y-1)-2I(x,y-1)-I(x+1,y-1)(3)

[0071]

[0072] Where I(x,y) is the grayscale value of the image at the pixel (x,y) position.

[0073] This method collected 200 pictures and performed simulation tests on Matlab. The test results are as follows: Figure 6 As shown in Figure 3, from the perspective of robustness, the Sobel operator has a certain suppression effect on noise due to the combination of smoothing and differentiation operations, so it is more robust than the Laplacian operator to a certain extent.

[0074] In another embodiment, the auto-focus speed and accuracy evaluation is performed as follows.

[0075] (1) Autofocus coarse adjustment speed evaluation

[0076] The maximum travel of the Z axis is 70mm. The autofocus runs from 0mm to the maximum travel of 70mm. The shorter the time of this process, the higher the efficiency of the autofocus. The image sensor output video stream image parameter is 1080P.30 frames. The system updates the microscopic image data once every 33ms and performs an image clarity analysis.

[0077] Assume focusing time t, travel L, step length S, and sampling time is 33ms. Then:

[0078]

[0079] Substituting L = 70mm, S = 0.5mm into Formula 5, we get t = 4620ms. Different step sizes have different theoretical focusing times. If the step size is too large, it is easy to misposition the clear image, so the selection of the automatic focusing step size is crucial to speed and accuracy. The step sizes used in the experimental test are shown in Table 1. The error between the theoretical time consumption and the actual time consumption is caused by many factors, mainly: 1. The continuity of the motor operation, especially the frequent stopping and starting of the motor when the step size is small; 2. The processing time of the image acquisition thread and the image processing thread.

[0080]

[0081] Table 1

[0082] Turn on the camera and use different step lengths to perform a rough adjustment test on sample 1: Figure 7 This is the imaging effect before focusing. The initial position of the Z axis is 0 and the image is blurred. Figure 8 This is the imaging effect after coarse adjustment with a step size of 0.5mm. The actual time taken is 5465ms and the effect is blurry, indicating a focusing failure. Fig. 9 This is the imaging effect after coarse adjustment with a step length of 0.2mm. The actual time taken is 12356ms. The effect is blurry and the focusing fails. Fig.10 This is the imaging effect after coarse adjustment with a step length of 0.1mm. The actual time taken is 27680ms. The effect is good and the focusing is basically successful. Fig.11 This is the imaging effect after coarse adjustment with a step size of 0.05mm. The actual time taken is 57335ms. The effect is good and the focusing is successful.

[0083] Tests show that the larger the step size, the faster the focusing speed, but the worse the accuracy. When the step size is controlled at 0.1 or 0.05mm, the focusing requirements can be met.

[0084] (2) Fine-tuning speed and accuracy evaluation

[0085] According to the coarse adjustment, the focusing efficiency is best when the coarse adjustment step is 0.1mm and 0.2mm, so the fine adjustment distance L should be 0.2mm and 0.4mm respectively. The fine adjustment step S1 should be less than 0.05mm. The accuracy and efficiency of the system should be taken into consideration, and different step sizes of 0.01mm and 0.02mm are used for testing. The results are as follows Figure 12-13 The test results of the stroke of 0.2mm, 0.4mm, step length of 0.01mm, 0.02mm are shown in Table 2.

[0086]

[0087] Table 2

[0088] In another embodiment, a system optimization method and implementation.

[0089] Through the above test, it is found that the focusing speed and accuracy are contradictory. The video stream output by the image sensor is 1080P.30 frames, and the image quality effect and output rate are high. If it is changed to 720P.60 frames, although the image output time is increased, the image output resolution is reduced, and the image quality is reduced. This method improves the focusing efficiency without changing the image output quality. From formula 5, it can be seen that only the stroke L and the step length S can be changed.

[0090] (1) Improvement method 1: Reduce the stroke

[0091] Without changing the step length, the focusing time can be improved by reducing the stroke. The original stroke of 70mm was changed to 50mm, and the step lengths were 0.5mm, 0.2mm, 0.1mm, and 0.05mm respectively. The test results are shown in Table 3. Under the premise of sacrificing formation, the step length was reduced, and the focusing efficiency was indeed greatly improved.

[0092]

[0093] Table 3

[0094] (2) Improvement method 2: combined step length test

[0095] Although reducing the stroke can reduce the focusing time, it cannot be reduced all the time, otherwise the observation range will become too small and more types of objects cannot be observed. In order to meet the design requirements. In the case of selecting a suitable stroke, the method of combining coarse and fine adjustment steps can be used to reduce the time. Use a larger step size to first collect images to obtain the location of the clarity value attachment, and then use a small step size to search.

[0096] In this paper, we first use 0.1mm and 0.2mm coarse step lengths to focus and find a clearer area. When the difference in clarity between the front and back images is large, we use 0.01mm and 0.02mm fine step lengths to focus. The test records are shown in Table 4.

[0097] The combined step focusing effect is as follows: Figure 14-15 As shown in the figure, the overall test results meet the requirements. The stroke is 50mm, the coarse step length is 0.05mm, and the time is 36614ms. The combined step length is 0.2mm for coarse adjustment and 0.02mm for fine adjustment, and the time is 9150ms. The time is reduced by 27464ms, and the efficiency is improved by about 75%.

[0098]

[0099] Table 4

[0100] In order to improve the efficiency and accuracy of focusing, the following measures were taken: (1) The step length was changed from 70mm to 50mm. This method significantly improved the automatic focusing time, but at the expense of travel. (2) The coarse and fine adjustment combined step focusing was improved. As long as the step length is selected appropriately, the focusing time can be greatly shortened and the focusing accuracy can be guaranteed. There are many options for selecting the step length, which is also the core point of the research on shortening the focusing time. Finally, the CAFSA algorithm greatly improved the overall efficiency and accuracy of the system.

[0101] In addition, the present invention also discloses a computer storage medium, wherein the storage medium includes computer instructions, and when the computer is run on the computer, the computer executes any of the methods described above.

[0102] In addition, the present invention also discloses an electronic device, wherein the electronic device comprises:

[0103] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein:

[0104] When the processor executes the program, any of the methods described above is implemented.

[0105] Although the embodiments of the present invention are described above in conjunction with the accompanying drawings, the present invention is not limited to the above specific embodiments and application fields, and the above specific embodiments are only illustrative and instructive, rather than restrictive. A person of ordinary skill in the art can also make many forms under the guidance of this specification and without departing from the scope of protection of the claims of the present invention, all of which belong to the protection of the present invention.

Claims

1. A method based on a fast focusing strategy of a stereo microscope, comprising the following steps: S100: performing large step length coarse adjustment on the image acquired by the stereo microscope, wherein the image acquisition time and the motor running speed are combined as synchronous coarse adjustment to obtain the position of the maximum clarity; S200: Perform a small step search and fine adjustment near the acquired position of the maximum clarity value to obtain the final clearest position.

2. According to the method of claim 1, preferably, step S100 further comprises: Determine the coarse adjustment step length according to the depth of field of the microscope, and quickly traverse to find the position N*S of the maximum value in the interval, where N is the position of the motor that records the maximum clarity value during the coarse adjustment process, and S is the coarse adjustment step length.

3. According to the method of claim 1, step S200 further comprises: Use small steps to search for the maximum image clarity from position (N-1)*S to position (N+1)*S. The method according to claim 1 , wherein the image acquisition time is 33 ms.

5. The method according to claim 1, wherein the image acquired by the stereo microscope is acquired by combining the number of captured frames of the camera with the distance moved by the motor in the Z-axis direction.

6. According to the method of claim 2, the coarse adjustment step length S=33*V, where V is the motor running speed.

7. According to the method of claim 3, the small step size S1 = 0.5*S, where S is the coarse adjustment step size.

8. A device based on a fast focusing strategy for a stereo microscope, comprising: A device for making a large-step coarse adjustment of an image acquired by a stereo microscope, wherein the image acquisition time and the motor running speed are combined as a synchronous coarse adjustment to obtain the position of the maximum clarity; A device for performing a small step search and fine adjustment near the position of the acquired maximum clarity value to obtain the final clearest position.

9. A computer storage medium, wherein: The storage medium includes computer instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 7.

10. An electronic device, wherein: The electronic device comprises: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Automatic image focusing method and focusing device

    CN120529178A

  • Image auto-focusing method and focusing device

    CN120529178B