Microscope autofocusing methods, media, devices, systems, and apparatuses

By optimizing the stage movement strategy during microscope autofocus by utilizing brightness difference and sharpness calculations, the problem of long autofocus time in microscopes is solved, achieving efficient autofocus while protecting the lens.

CN117270187BActive Publication Date: 2026-11-24OPTOSKY (XIAMEN) PHOTONICS INC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311230689.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-22
Publication Date
2026-11-24
Estimated Expiration
2043-09-22

AI Technical Summary

Technical Problem

Existing microscope autofocus methods are time-consuming and inefficient, mainly due to the long time required for sharpness analysis.

Method used

By controlling the stage to move away from the microscope at a preset speed, an image of the object is acquired and the brightness difference is calculated. If the difference is greater than a threshold, the stage moves closer to the microscope and acquires a clear image. The optimal focus position is then calculated to complete the autofocus.

Benefits of technology

It significantly improves the efficiency of microscope autofocus, reduces the time required for autofocus, avoids collisions between the lens and the sample, and prevents image overexposure that leads to reduced clarity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117270187B_ABST
    Figure CN117270187B_ABST
Patent Text Reader

Abstract

This invention discloses a method, medium, device, system, and apparatus for automatic focusing of a microscope. The method includes: controlling the stage to move away from the microscope at a first preset speed, and acquiring a first image of the object at a first preset frequency during the moving away process; calculating a first difference between the brightness value of the first image and the maximum brightness value, and determining whether the first difference is greater than a first difference threshold; if the first difference is greater than the first difference threshold, controlling the stage to approach the microscope at a preset step distance, and acquiring a corresponding second image of the object after each movement; calculating the sharpness corresponding to the second image, determining an optimal focusing position based on the sharpness corresponding to all second images, and adjusting the microscope according to the optimal focusing position to complete automatic focusing. This method can effectively improve the efficiency of automatic focusing of a microscope and reduce the time required for automatic focusing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microscope control technology, and in particular to a microscope autofocus method, medium, equipment, system and device. Background Technology

[0002] A microscope is an optical instrument consisting of one or more lenses, primarily used to magnify tiny objects so they can be seen with the naked eye. To improve efficiency, autofocus systems are often used to automatically focus the microscope, reducing the time required for manual focusing.

[0003] In related technologies, when autofocusing a microscope, the image sharpness is often directly analyzed. That is, an image is captured and its sharpness is analyzed every time the microscope moves a small distance. However, because sharpness analysis takes a long time, the autofocusing time of the microscope is long, resulting in low autofocusing efficiency. Summary of the Invention

[0004] This invention aims to at least partially solve one of the technical problems in related technologies. Therefore, one object of this invention is to provide a microscope autofocus method that can effectively improve the efficiency of microscope autofocus and reduce the time required for microscope autofocus.

[0005] In a first aspect, the present invention proposes an automatic focusing method for a microscope, the method comprising the following steps: controlling the stage to move away from the microscope at a first preset speed, and acquiring a first image of the object at a first preset frequency during the moving away process; calculating a first difference between the brightness value of the first image of the object and the maximum brightness value, and determining whether the first difference is greater than a first difference threshold; if the first difference is greater than the first difference threshold, controlling the stage to approach the microscope at a preset step distance, and acquiring a corresponding second image of the object after each movement; calculating the sharpness corresponding to the second image of the object, determining the optimal focusing position based on the sharpness corresponding to all second images of the object, and adjusting the microscope according to the optimal focusing position to complete automatic focusing.

[0006] According to an embodiment of the present invention, the microscope autofocus method first controls the stage to move away from the microscope at a first preset speed, and acquires a first image of the object at a first preset frequency during the moving away process; then, it calculates a first difference between the brightness value of the first image of the object and the maximum brightness value, and determines whether the first difference is greater than a first difference threshold; then, if the first difference is greater than the first difference threshold, it controls the stage to approach the microscope at a preset step distance, and acquires a corresponding second image of the object after each movement; then, it calculates the sharpness corresponding to the second image of the object, determines the optimal focus position based on the sharpness corresponding to all second images of the object, and adjusts the microscope according to the optimal focus position to complete autofocus, thereby effectively improving the efficiency of microscope autofocus and reducing the time required for microscope autofocus.

[0007] In some embodiments, before controlling the stage to approach the microscope at a preset step distance, the method further includes: controlling the stage to approach the microscope at a second preset speed, and acquiring a third object image at a second preset frequency during the approach process; calculating a second difference between the brightness value of the third object image and the maximum brightness value, and determining whether the second difference is less than a second difference threshold; if the second difference is less than the second difference threshold, stopping the relative movement between the microscope and the stage.

[0008] In some embodiments, before calculating the first difference between the brightness value of the first object image and the maximum brightness value, the method further includes: determining whether the brightness value of the first object image is greater than an overexposure brightness threshold; if the brightness value of the first object image is greater than the overexposure brightness threshold, stopping the relative movement between the microscope and the stage, and adjusting the exposure time; during the exposure time adjustment process, acquiring a fourth object image at a third preset frequency, and calculating the brightness value of the fourth object image; when the brightness value of the fourth object image is equal to a preset brightness threshold, stopping the adjustment of the exposure time, and setting the preset brightness threshold to the current maximum brightness value.

[0009] In some embodiments, the sharpness of the second object image is calculated using the Tenengrad gradient function.

[0010] In a second aspect, the present invention provides a computer-readable storage medium storing a microscope autofocus program thereon, which, when executed by a processor, implements the microscope autofocus method as described above.

[0011] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements the microscope autofocusing method as described above.

[0012] Fourthly, the present invention proposes an autofocus system for a microscope, comprising: a microscope, a controller, and a movable stage, wherein the microscope is equipped with an electronic imaging module, the controller is connected to the electronic imaging module and the movable stage respectively, the controller is loaded with an autofocus program for the microscope, and the controller controls the electronic imaging module and the movable stage based on the autofocus program for the microscope to achieve the autofocus method for the microscope as described above.

[0013] Fifthly, the present invention proposes an autofocus device for a microscope, comprising: a control module for controlling the stage to move away from the microscope at a first preset speed; a first acquisition module for acquiring a first image of the object at a first preset frequency during the moving away process; a calculation module for calculating a first difference between the brightness value of the first image of the object and the maximum brightness value, and determining whether the first difference is greater than a first difference threshold; a second acquisition module for controlling the stage to approach the microscope at a preset step distance when the first difference is greater than the first difference threshold, and acquiring a corresponding second image of the object after each movement; and a focusing module for calculating the sharpness corresponding to the second image of the object, determining an optimal focusing position based on the sharpness corresponding to all second images of the object, and adjusting the microscope according to the optimal focusing position to complete autofocus.

[0014] In some embodiments, the control module is further configured to control the stage to approach the microscope at a second preset speed; it also includes a third acquisition module, which is configured to acquire a third image of the object at a second preset frequency during the approach process; the calculation module is further configured to calculate a second difference between the brightness value of the third image of the object and the maximum brightness value, and determine whether the second difference is less than a second difference threshold; the control module is further configured to stop the relative movement between the microscope and the stage when the second difference is less than the second difference threshold.

[0015] In some embodiments, the sharpness of the second object image is calculated using the Tenengrad gradient function.

[0016] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0017] Figure 1 This is a schematic flowchart of a microscope autofocusing method according to an embodiment of the present invention;

[0018] Figure 2 This is a schematic flowchart of a microscope autofocusing method according to another embodiment of the present invention;

[0019] Figure 3 This is a block diagram of a computer device according to an embodiment of the present invention;

[0020] Figure 4 This is a block diagram of a microscope autofocus system according to an embodiment of the present invention;

[0021] Figure 5 This is a block diagram of a microscope autofocus device according to an embodiment of the present invention. Detailed Implementation

[0022] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0023] The microscope autofocusing method according to an embodiment of the present invention is described below with reference to the accompanying drawings.

[0024] Please see Figure 1 , Figure 1 This is a schematic flowchart of a microscope autofocusing method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the microscope autofocus method includes the following steps:

[0025] S101, control the stage to move away from the microscope at a first preset speed, and acquire a first image of the object at a first preset frequency during the moving away process.

[0026] In other words, firstly, the microscope and the stage are controlled to move relatively far apart, and the relative speed of their movement is a first preset speed; at the same time, during the relative movement of the two, the first image of the object is acquired at a first preset frequency.

[0027] There are several ways to control the stage to move away from the microscope at a first preset speed.

[0028] As an example, the microscope lens is set to be movable, and during the control process, the microscope lens is controlled to move closer to or further away from the stage, so as to control the microscope to move relatively away from the stage.

[0029] As another example, a movable stage is provided, and then the stage is controlled to move relative to the microscope to control the microscope and the stage to move away from each other.

[0030] S102, calculate the first difference between the brightness value of the first object image and the maximum brightness value, and determine whether the first difference is greater than the first difference threshold.

[0031] In some embodiments, it has been found during use that when the microscope and stage move relative to each other, if their relative positions are near the focal point, overexposure can easily occur, and overexposure reduces image sharpness, affecting the microscope's autofocus performance. Therefore, to eliminate the reduced image sharpness caused by overexposure, before calculating the first difference between the brightness value of the first image and the maximum brightness value, the method further includes: determining whether the brightness value of the first image is greater than an overexposure brightness threshold; if the brightness value of the first image is greater than the overexposure brightness threshold, stopping the relative movement between the microscope and stage and adjusting the exposure time; during the exposure time adjustment, acquiring a fourth image at a third preset frequency and calculating the brightness value of the fourth image; when the brightness value of the fourth image equals the preset brightness threshold, stopping the adjustment of the exposure time and setting the preset brightness threshold to the current maximum brightness value.

[0032] In other words, as the stage moves away from the microscope, the system continuously checks whether the first image is overexposed. If so, it stops moving away and adjusts the exposure time. During the adjustment, it acquires a fourth image to monitor the effect of the exposure time adjustment on the image brightness. When the brightness of the fourth image reaches the preset brightness threshold, it stops adjusting the exposure time and sets the maximum brightness value to the preset brightness threshold.

[0033] As an example, firstly, it is determined whether the brightness of the first image is greater than 250. If so, the stage stops moving to prevent the stage from moving further away from the microscope. Next, the exposure time is adjusted while acquiring a fourth image. Then, the brightness value of the fourth image is calculated. Then, it is determined whether the brightness value of the fourth image is less than or equal to 150. If so, the adjustment of the exposure time is stopped, and the maximum brightness value is set to 150. This effectively prevents the reduction in sharpness caused by overexposure.

[0034] S103, if the first difference is greater than the first difference threshold, control the stage to approach the microscope at a preset step distance, and acquire the corresponding second object image after each movement.

[0035] In other words, the maximum brightness value is stored; for example, when continuously acquiring the first object image, if the brightness value of the first object image increases linearly, the maximum brightness value is continuously updated. Next, a first difference between the brightness value of the first object image and the maximum brightness value is calculated; if the first difference is less than or equal to a first difference threshold, the stage continues to move away from the microscope at a first preset speed; if the first difference is greater than the first difference threshold, the movement of the microscope and stage moving away from each other is stopped, and the stage is controlled to approach the microscope at a preset step distance, acquiring the corresponding second object image after each movement.

[0036] Preferably, in order to make the brightness value of the first image increase linearly, the camera's exposure mode can be set to a fixed exposure mode, that is, a fixed exposure time can be set. In this way, using a fixed exposure time to acquire the first image will make the brightness value of the acquired first image increase linearly (that is, the closer the relative position between the microscope and the stage is to the optimal focus position, the greater the brightness value of the first image).

[0037] In some embodiments, to further improve the efficiency of microscope autofocus, before controlling the microscope to approach the stage at a preset step distance, the method further includes: controlling the stage to approach the microscope at a second preset speed, and acquiring a third object image at a second preset frequency during the approach process; calculating a second difference between the brightness value of the third object image and the maximum brightness value, and determining whether the second difference is less than a second difference threshold; if the second difference is less than the second difference threshold, stopping the relative movement between the microscope and the stage.

[0038] S104, calculate the sharpness corresponding to the second object image, determine the optimal focus position based on the sharpness corresponding to all second object images, and adjust the microscope according to the optimal focus position to complete autofocus.

[0039] In some embodiments, the sharpness of the second object image is calculated using the Tenengrad gradient function.

[0040] As an example, the Tenengrad gradient function uses the Sobel operator to extract the gradient values ​​in the horizontal and vertical directions respectively. The image sharpness based on the Tenengrad gradient function is defined as follows:

[0041] D(f)=∑ y ∑ x |G(x,y)|

[0042] (G(x,y)>T)

[0043] Wherein, G(x,y) takes the following form:

[0044]

[0045] Where: T is the given edge detection threshold, and Gx and Gy are the convolutions of the Sobel horizontal and vertical edge detection operators at pixel (x,y), respectively. It is recommended to use the following Sobel operator template for edge detection:

[0046]

[0047] As a specific embodiment of the present invention, such as Figure 2 As shown, the microscope autofocus method includes the following steps:

[0048] S201 controls the stage to move away from the microscope at a first preset speed.

[0049] S202, during the moving away process, acquire a first image of the object at a first preset frequency.

[0050] S203, determine whether the brightness value of the first image is greater than the overexposure brightness threshold; if yes, proceed to step S204; if no, proceed to step S207.

[0051] S204, stop the relative movement between the microscope and the stage, and adjust the exposure time.

[0052] S205, during the exposure time adjustment process, acquire the fourth object image at the third preset frequency and calculate the brightness value of the fourth object image.

[0053] S206, when the brightness value of the fourth object image is equal to the preset brightness threshold, stop adjusting the exposure time and set the preset brightness threshold to the current maximum brightness value; return to step S201.

[0054] S207, calculate the first difference between the brightness value of the first object image and the maximum brightness value.

[0055] S208, determine whether the first difference is greater than the first difference threshold; if not, return to step S202; if yes, proceed to step S209.

[0056] S209, stop the relative movement between the stage and the microscope.

[0057] S210, control the stage to approach the microscope at a second preset speed, and during the approach, acquire a third image of the object at a second preset frequency.

[0058] S211, calculate the second difference between the brightness value of the third object image and the maximum brightness value.

[0059] S212, determine whether the second difference is less than the second difference threshold; if not, return to step S210; if yes, execute step S213.

[0060] S213, stop the relative movement between the stage and the microscope.

[0061] S214 controls the stage to approach the microscope at a preset step distance, and acquires the corresponding second image of the object after each movement.

[0062] S215, calculate the sharpness corresponding to the second object image, and determine the optimal focus position based on the sharpness corresponding to all the second object images.

[0063] S216, adjusts the microscope to the optimal focusing position to achieve autofocus.

[0064] As an example, after determining that the second difference is less than the second difference threshold, the relative movement between the stage and the microscope is stopped. Then, the stage is controlled to step toward the microscope 30 times with small increments. After each step, a corresponding second image of the object is acquired. Then, the sharpness of the second image of the object is compared to determine the sharpest position. Then, the relative position between the microscope and the stage is adjusted according to the sharpest position to complete the autofocus.

[0065] Furthermore, it should be noted that in related technologies, most directly analyze sharpness. However, when autofocusing powder samples, the sharpness algorithm struggles to detect peak values, leading to continuous relative movement between the microscope and the stage. Thicker samples are prone to colliding with the microscope lens, causing damage. The microscope autofocus method of this invention, by first adjusting the brightness, effectively prevents collisions between the microscope lens and the sample.

[0066] In summary, the microscope autofocus method according to embodiments of the present invention firstly controls the stage to move away from the microscope at a first preset speed, and acquires a first image of the object at a first preset frequency during the moving away process; then, it calculates a first difference between the brightness value of the first image of the object and the maximum brightness value, and determines whether the first difference is greater than a first difference threshold; then, if the first difference is greater than the first difference threshold, it controls the stage to approach the microscope at a preset step distance, and acquires a corresponding second image of the object after each movement; then, it calculates the sharpness corresponding to the second image of the object, determines the optimal focus position based on the sharpness corresponding to all second images of the object, and adjusts the microscope according to the optimal focus position to complete autofocus, thereby effectively improving the efficiency of microscope autofocus and reducing the time required for microscope autofocus.

[0067] To implement the above embodiments, this invention provides a computer-readable storage medium storing a microscope autofocus program thereon, which, when executed by a processor, implements the microscope autofocus method as described above.

[0068] To implement the above embodiments, this invention provides a computer device, such as... Figure 3 As shown, the computer device includes a memory 301, a processor 302, and a computer program stored in the memory 301 and executable on the processor 302. When the processor 302 executes the program, it implements the microscope autofocusing method as described above.

[0069] To achieve the above embodiments, this invention proposes an automatic focusing system for a microscope, such as... Figure 4 As shown, the microscope autofocus system includes a microscope 401, a controller 402, and a moving stage 403. The microscope 401 is equipped with an electronic imaging module. The controller 402 is connected to both the electronic imaging module and the moving stage 403. The controller 402 is loaded with a microscope autofocus program. Based on the microscope autofocus program, the controller 402 controls the electronic imaging module and the moving stage 403 to achieve the microscope autofocus method described above.

[0070] To achieve the above embodiments, this invention provides an automatic focusing device for a microscope, such as... Figure 5 As shown, the microscope autofocus device includes: a control module 10, a first acquisition module 20, a calculation module 30, a second acquisition module 40, and a focusing module 50.

[0071] Among them, the control module 10 is used to control the stage to move away from the microscope at a first preset speed;

[0072] The first acquisition module 20 is used to acquire a first image of the object at a first preset frequency during the moving away process;

[0073] The calculation module 30 is used to calculate the first difference between the brightness value of the first object image and the maximum brightness value, and to determine whether the first difference is greater than the first difference threshold.

[0074] The second acquisition module 40 is used to control the microscope to approach the stage with a preset step distance when the first difference is greater than the first difference threshold, and to acquire the corresponding second object image after each movement.

[0075] The focusing module 50 is used to calculate the sharpness corresponding to the second object image, determine the optimal focusing position based on the sharpness corresponding to all the second object images, and adjust the microscope according to the optimal focusing position to complete the autofocus.

[0076] In some embodiments, the control module 10 is further configured to control the stage to approach the microscope at a second preset speed; the device further includes a third acquisition module (not shown in the figure), which is configured to acquire a third object image at a second preset frequency during the approach process; the calculation module 30 is further configured to calculate a second difference between the brightness value of the third object image and the maximum brightness value, and determine whether the second difference is less than a second difference threshold; the control module is further configured to stop the relative movement between the microscope and the stage when the second difference is less than the second difference threshold.

[0077] In some embodiments, the sharpness of the second object image is calculated using the Tenengrad gradient function.

[0078] It should be noted that the above description of the microscope autofocus method also applies to this microscope autofocus device, and will not be repeated here.

[0079] In summary, the microscope autofocus device according to embodiments of the present invention, by setting a control module for controlling the stage to move away from the microscope at a first preset speed; a first acquisition module for acquiring a first image of the object at a first preset frequency during the moving away process; a calculation module for calculating a first difference between the brightness value and the maximum brightness value of the first image of the object, and determining whether the first difference is greater than a first difference threshold; a second acquisition module for controlling the stage to approach the microscope at a preset step distance when the first difference is greater than the first difference threshold, and acquiring a corresponding second image of the object after each movement; and a focusing module for calculating the sharpness corresponding to the second image of the object, determining the optimal focusing position based on the sharpness corresponding to all second images of the object, and adjusting the microscope according to the optimal focusing position to complete autofocus, can effectively improve the efficiency of microscope autofocus and reduce the time required for microscope autofocus.

[0080] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0081] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0082] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0083] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0084] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0085] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0086] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0087] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for automatic focusing of a microscope, characterized in that, Includes the following steps: The stage is controlled to move away from the microscope at a first preset speed, and during the moving away process, a first image of the object is acquired at a first preset frequency; Calculate the first difference between the brightness value of the first object image and the maximum brightness value, and determine whether the first difference is greater than the first difference threshold. If the first difference is greater than the first difference threshold, the stage is controlled to approach the microscope at a preset step distance, and a corresponding second image of the object is acquired after each movement. Calculate the sharpness corresponding to the second object image, determine the optimal focus position based on the sharpness corresponding to all second object images, and adjust the microscope according to the optimal focus position to complete autofocus; Before calculating the first difference between the brightness value of the first object image and the maximum brightness value, the method further includes: Determine whether the brightness value of the first image of the object is greater than the overexposure brightness threshold; If the brightness value of the first image is greater than the overexposure brightness threshold, then the relative movement between the microscope and the stage is stopped, and the exposure time is adjusted. During the exposure time adjustment process, a fourth object image is acquired at a third preset frequency, and the brightness value of the fourth object image is calculated. When the brightness value of the fourth object image is equal to the preset brightness threshold, the adjustment of the exposure time is stopped, and the preset brightness threshold is set to the current maximum brightness value.

2. The microscope autofocusing method as described in claim 1, characterized in that, Before controlling the stage to approach the microscope at a preset step distance, the method further includes: The stage is controlled to approach the microscope at a second preset speed, and during the approach, a third image of the object is acquired at a second preset frequency. Calculate the second difference between the brightness value of the third object image and the maximum brightness value, and determine whether the second difference is less than the second difference threshold; If the second difference is less than the second difference threshold, then the relative movement between the microscope and the stage is stopped.

3. The microscope autofocusing method as described in claim 1, characterized in that, The sharpness of the second image is calculated using the Tenengrad gradient function.

4. A computer-readable storage medium, characterized in that, It stores a microscope autofocus program, which, when executed by a processor, implements the microscope autofocus method as described in any one of claims 1-3.

5. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the microscope autofocus method as described in any one of claims 1-3.

6. An automatic focusing system for a microscope, characterized in that, include: A microscope, a controller, and a movable stage are provided, wherein the microscope is equipped with an electronic imaging module, the controller is connected to the electronic imaging module and the movable stage respectively, the controller is loaded with a microscope autofocus program, and the controller controls the electronic imaging module and the movable stage based on the microscope autofocus program to realize the microscope autofocus method as described in any one of claims 1-3.

7. An automatic focusing device for a microscope, characterized in that, include: The control module is used to control the stage to move away from the microscope at a first preset speed; The first acquisition module is used to acquire a first image of the object at a first preset frequency during the process of moving away. The calculation module is used to calculate a first difference between the brightness value of the first object image and the maximum brightness value, and to determine whether the first difference is greater than a first difference threshold. The second acquisition module is used to control the stage to approach the microscope with a preset step distance when the first difference is greater than the first difference threshold, and to acquire the corresponding second object image after each movement. The focusing module is used to calculate the sharpness corresponding to the second object image, determine the optimal focusing position based on the sharpness corresponding to all the second object images, and adjust the microscope according to the optimal focusing position to complete automatic focusing.

8. The microscope autofocus device as described in claim 7, characterized in that, The control module is also used to control the stage to approach the microscope at a second preset speed; It also includes a third acquisition module, which is used to acquire a third object image at a second preset frequency during the approach process; The calculation module is also used to calculate a second difference between the brightness value of the third object image and the maximum brightness value, and to determine whether the second difference is less than a second difference threshold. The control module is also used to stop the relative movement between the microscope and the stage when the second difference is less than the second difference threshold.

9. The microscope autofocus device as described in claim 7, characterized in that, The sharpness of the second image is calculated using the Tenengrad gradient function.

Citation Information

Patent Citations

  • Imaging method, device and system

    CN112291469A

  • Rapid automatic focusing method of microscope

    CN114185164A

  • Microscope photographing apparatus, method and program for adjusting brightness

    JP2005221708A