Focusing method and optical detection system

By determining the target focus adjustment interval in the optical detection system and determining the focus position according to the image clarity, the problem of low autofocus accuracy in the prior art is solved, and an efficient and accurate autofocus effect is achieved.

CN119689702APending Publication Date: 2025-03-25HENAN FUCHI TECH CO LTD +4
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311206072.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art cannot guarantee the accuracy of focus when using a microscope for automatic focus, especially when the object to be measured is a transparent object, with defects or holes on the surface, and the accuracy of manual focus cannot be guaranteed.

Method used

By using a stage driving device and an imaging device in the optical detection system, the target focus adjustment interval is determined, and sample images are collected within the interval, and the target focus position is determined according to the image clarity, so as to achieve automatic focus.

Benefits of technology

The efficiency and accuracy of focus processing are improved, ensuring high-quality focus effect under different conditions of the measured object.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119689702A_ABST
    Figure CN119689702A_ABST
Patent Text Reader

Abstract

The invention discloses a focusing method and an optical detection system, and the method comprises the steps: determining a target focusing adjustment interval corresponding to a lens module in a first direction if an objective table driving device is monitored to be started; controlling an objective table driving device to drive the objective table to move in the target focusing adjustment interval at a first preset speed; acquiring a plurality of first sample images of the sample carried on the objective table in the moving process by using the lens module; determining the image definition corresponding to each first sample image, and selecting the first sample image corresponding to the maximum image definition as a target first sample image; determining a target focusing position in the target focusing adjustment interval corresponding to the target first sample image; and the objective table driving device is controlled to drive the objective table to the target focusing position, and automatic focusing is completed. The focusing effect of the optical detection system can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image technology, and in particular relates to a focusing method and an optical detection system. Background Art

[0002] When using a microscope to observe an object, you can clearly observe the subtle parts of the object, providing reliable data for observation. Therefore, microscopes play a pivotal role in the field of subtle observation. Before using a microscope to observe an object, you first need to focus the microscope and the object. Only after the microscope is focused can you observe the object more clearly and accurately.

[0003] However, in the related art, focusing is generally performed manually or automatically. The manual focusing method has the defects of low efficiency and low accuracy. Although the automatic focusing method using a microscope can improve the focusing efficiency, the focusing accuracy cannot be guaranteed when the object to be measured is a transparent object, there are defects on the surface of the object to be measured, or there are holes on the surface of the object to be measured. Summary of the invention

[0004] The embodiments of the present application provide a focusing method and an optical detection system to solve the problems of low focusing accuracy and efficiency.

[0005] An embodiment of the present application provides a focusing method, which is applied to an optical detection system, wherein the optical detection system includes an imaging device and a carrier device, wherein the imaging device is used to collect an image of a sample carried on the carrier device; the carrier device includes a stage and a stage driving device, wherein the stage driving device is used to drive the stage to move, and the focusing method includes: if it is detected that the stage driving device is turned on, determining a target focus adjustment interval corresponding to the imaging device in a first direction; controlling the stage driving device to drive the stage to move in the target focus adjustment interval at a first preset speed; using the imaging device to collect multiple first sample images of the sample carried on the stage during the movement; determining the image clarity corresponding to each first sample image, and selecting the first sample image corresponding to the maximum image clarity as the target first sample image; determining a target focus position within the target focus adjustment interval corresponding to the target first sample image; and controlling the stage driving device to drive the stage to the target focus position to complete automatic focusing.

[0006] Furthermore, in the above method provided in an embodiment of the present application, determining the target focus adjustment interval corresponding to the imaging device in the first direction includes: obtaining the objective lens magnification corresponding to the imaging device, and determining the depth of field length associated with the objective lens magnification; controlling the stage drive device to drive the stage to move in the first direction at a second preset speed, wherein the second preset speed is greater than the first preset speed; using the imaging device to capture a second sample image of the sample carried on the stage during the movement; if it is monitored that the image clarity of the second sample image is greater than a preset clarity threshold, determining an initial focus position corresponding to the second sample image, and determining the target focus adjustment interval based on the initial focus position and the depth of field length.

[0007] Furthermore, in the above method provided in the embodiment of the present application, determining the target focus adjustment interval based on the initial focus position and the depth of field length includes: determining a target distance value based on the depth of field length; taking the initial focus position as a reference position, moving the target distance value upward along the first direction as a first interval endpoint, and moving the target distance value downward along the first direction as a second interval endpoint; determining the target focus adjustment interval based on the first interval endpoint and the second interval endpoint.

[0008] Furthermore, in the above method provided in an embodiment of the present application, determining the target focus position within the target focus adjustment interval corresponding to the target first sample image includes: obtaining a correspondence between a pre-set first sample image and a moving position, and obtaining the target focus position corresponding to the target first sample image based on the correspondence.

[0009] Furthermore, in the above method provided in the embodiment of the present application, the obtaining of the correspondence between the pre-set first sample image and the moving position includes: obtaining the initial moving position and the initial timestamp of the stage; obtaining the target timestamp corresponding to the target first sample image; determining the moving position corresponding to each collected first sample image according to the initial moving position, the initial timestamp and the target timestamp; and constructing the correspondence between the first sample image and the moving position.

[0010] Furthermore, in the above method provided in the embodiment of the present application, determining the image clarity corresponding to each first sample image includes: calling the preset initial clarity determination function to process the first sample image to obtain the initial image clarity corresponding to the first sample image; determining the target coefficient corresponding to each of the initial image clarity; and obtaining the image clarity corresponding to the first sample image based on the target coefficient and the initial image clarity.

[0011] Furthermore, in the above method provided in the embodiment of the present application, the image clarity corresponding to each first sample image is determined, and the first sample image corresponding to the maximum image clarity is selected as the target first sample image, including: constructing an image clarity curve according to the image clarity corresponding to each first sample image; taking the peak value in the image clarity curve as the maximum image clarity; and determining the target first sample image corresponding to the maximum image clarity.

[0012] The second aspect of the embodiment of the present application also provides an optical detection system, which includes an imaging device, a carrier device and a control device, wherein the imaging device is used to collect images of samples carried by the carrier device; the carrier device includes a stage and a stage drive device, and the stage drive device is used to drive the stage to move in multiple preset directions; the control device connects the imaging device and the carrier device, and executes any one of the above-mentioned focusing methods by controlling the imaging device and the carrier device.

[0013] Furthermore, in the above-mentioned system provided in the embodiment of the present application, the stage driving device includes a first stage driving mechanism and a second stage driving mechanism, wherein the first stage driving mechanism is used to drive the stage to move in the first direction; and the second stage driving mechanism is used to drive the stage to move in the second direction.

[0014] Furthermore, in the above-mentioned system provided in an embodiment of the present application, the imaging device includes a lens module and a lens adjustment device, the lens module is connected to the lens adjustment device, the lens module is used to collect the sample image carried on the carrier, and the lens adjustment device is used to switch the lens module so that the objective lens of the corresponding magnification collects the image of the sample carried on the stage.

[0015] The above-mentioned focusing method provided in the embodiment of the present application determines the target focus adjustment interval corresponding to the lens module, controls the stage driving device to drive the stage to move in the target focus adjustment interval at a first preset speed; then uses the lens module to collect multiple first sample images of the sample carried on the stage during the movement, determines the image clarity corresponding to each first sample image, and selects the first sample image corresponding to the maximum image clarity as the target first sample image; then, determines the target focus position within the target focus adjustment interval corresponding to the target first sample image, and controls the stage driving device to drive the stage to the target focus position to complete automatic focusing. By determining the target focus adjustment interval corresponding to the lens module, and determining the target focus position within the target focus adjustment interval according to the image clarity of the collected sample image, the efficiency and accuracy of the focus processing can be improved, thereby improving the effect of the focus processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a schematic diagram of an optical detection system provided in an embodiment of the present application;

[0017] Figure 2 is a structural schematic diagram of an optical detection system provided in an embodiment of the present application;

[0018] Figure 3 is a flowchart of a focusing method provided in an embodiment of the present application;

[0019] Figure 4 is a flow chart for determining a target focus adjustment interval provided in an embodiment of the present application;

[0020] Figure 5 is a flow chart for determining interval endpoints provided in an embodiment of the present application;

[0021] Figure 6 is a flow chart for determining the corresponding relationship provided in the embodiment of the present application;

[0022] Figure 7 is a flow chart for determining image clarity provided by an embodiment of the present application;

[0023] Figure 8 This is a flow chart for determining the target first sample image provided in an embodiment of the present application.

[0024] Main component symbols

[0025] Optical inspection system 100

[0026] Imaging device 10

[0027] Lens module 11

[0028] Lens adjustment device 12

[0029] Carrying equipment 20

[0030] Stage 21

[0031] Stage drive device 22

[0032] The first stage driving mechanism 221

[0033] The second stage driving mechanism 222

[0034] Position sensing device 23

[0035] Base 30

[0036] Fixing 40

[0037] Control device 50

[0038] Storage device 60

[0039] Communication bus 70 DETAILED DESCRIPTION

[0040] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0041] In the description of the present application, it should be understood that the terms indicating the orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, it should be noted that the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0042] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or mutual communication, it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0043] In the fully automatic microscope imaging system, autofocus is a very important technology. In the existing focusing technology, focusing is generally performed manually or automatically. The manual focusing method has the defects of low efficiency and low accuracy. The method of using a microscope for autofocus can improve the focusing efficiency, but when the object to be measured is a transparent object, there are defects on the surface of the object to be measured, or there are holes on the surface of the object to be measured, the focusing accuracy cannot be guaranteed. For example, in the prior art, the microscope uses laser triangulation for autofocus. Specifically, the microscope adds an 808nm laser to the visible light path, and the laser beam passes through a system of optical devices to obtain a semicircular spot on the charge-coupled device. When the spot radius is the smallest, the focusing is completed. In the above-mentioned autofocus method using laser triangulation, after the spot is projected onto the surface of the object to be measured, if the spot is projected onto the defect or hole of the object to be measured, the spot will fall into the defect or hole, causing the observed spot size to be smaller than the actual spot size. Therefore, a pseudo peak value appears when judging the size of the spot, resulting in incorrect autofocus.

[0044] In view of the above problems, an embodiment of the present application provides a focusing method and an optical detection system for improving the effect of focusing processing.

[0045] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0046] Figure 1 is a schematic diagram of an optical detection system 100 provided in an embodiment of the present application, such as Figure 1As shown, the optical detection system 100 includes: an imaging device 10, a carrier device 20, a base 30 and a fixing member 40, wherein the carrier device 20 is mounted on the base 30, one end of the fixing member 40 is mounted on the base 30, and the other end is connected to the imaging device 10, so that the imaging device 10 is at the upper end of the carrier device 20, and the image of the sample carried in the carrier device 20 is collected through the imaging device 10. In one embodiment, the imaging device 10 includes a lens module 11 and a lens adjustment device 12, wherein the lens module 11 is connected to the lens adjustment device 12, the lens module 11 is used to collect the image of the sample carried on the carrier device 20, and the lens adjustment device 12 is used to switch the lens module 11 so that the objective lens of the corresponding magnification collects the image of the carried sample. The loading device 20 includes a loading platform 21 and a loading platform driving device 22, wherein the loading platform 21 is connected to the loading platform driving device 22, and the loading platform 21 is used to carry samples, which may be motherboard chips or other objects that need to be detected. The loading platform driving device 22 is used to drive the loading platform 21 to move in multiple preset directions, wherein the preset direction refers to the movement direction of the corresponding loading platform 21 that is preset, and the preset direction may include a first direction and a second direction, wherein the first direction may be the Z-axis direction (i.e., the vertical direction), and the second direction may be the X-axis or Y-axis direction (i.e., the horizontal direction).

[0047] In one embodiment, the lens module 11 may be a metallographic microscope for observing the surface of a metal material. The lens module 11 refers to a module composed of a plurality of objective lenses of different high magnifications. For example, the lens module 11 may be composed of objective lenses with objective magnifications of 50 times, 100 times, and 200 times. By using objective lenses of different magnifications, images of different sizes can be captured to meet the detection requirements. For example, a low-power lens is suitable for detecting the details of a sample, and a high-power lens is suitable for detecting the overall structure of a sample. In one embodiment, the lens module 11 is connected to a lens adjustment device 12. After receiving an image acquisition instruction, the lens adjustment device 12 parses the image acquisition instruction to obtain an objective lens of a target magnification; then switches the objective lens of the target magnification to acquire multiple first sample images of the sample carried on the stage 21 during the movement process. Among them, the image acquisition instruction refers to an instruction to instruct the lens module 11 to use an objective lens of a target magnification to acquire an image of the sample carried on the stage 21.

[0048] In one embodiment, the stage driving device 22 includes a first stage driving mechanism 221 and a second stage driving mechanism 222, wherein the first stage driving mechanism 221 is used to drive the stage 21 to move in a first direction, which may be a Z-axis direction; the second stage driving mechanism 222 is used to drive the stage 21 to move in a second direction, which may be an X-axis or Y-axis direction. In one embodiment, the object carrying device 20 further includes a position sensing device 23, which may be disposed on the fixing member 40, and is used to detect the moving position of the stage 21 in the first direction; the position sensing device 23 is also used to output an alarm prompt when the moving position of the stage 21 exceeds the upper limit or lower limit of the first direction, so as to prevent the stage 21 from moving in the first direction beyond a specified range. The upper limit refers to the maximum moving position that the stage 21 can move upward along the first direction, and the lower limit refers to the maximum moving position that the stage 21 can move downward along the first direction. The upper limit and the lower limit can be set according to actual needs, and are not limited here.

[0049] See also Figure 2 , Figure 2 : is a structural schematic diagram of an optical detection system 100 provided in an embodiment of the present application. The optical detection system 100 also includes a control device 50, a storage device 60 and at least one communication bus 70. The control device 50 connects the imaging device 10 and the object carrier 20 through the communication bus 70, and executes the computer program stored in the storage device 60 by controlling the imaging device 10 and the object carrier 20 to implement the focusing method. In one embodiment, the storage device 60 can be used to store a plurality of first sample images captured by the lens module 11. The computer program in the storage device 60 can include a target focus adjustment interval determination program, an image clarity determination program and a target focus position determination program, wherein the target focus adjustment interval determination program is used to determine the target focus adjustment interval corresponding to the lens module 11; the image clarity determination program is used to determine the image clarity corresponding to the plurality of first sample images; the target focus position determination program is used to determine the target focus position within the target focus adjustment interval according to the image clarity.

[0050] In one embodiment, in the optical detection system 100, the control device 50 is used to determine the target focus adjustment interval corresponding to the lens module 11 in the first direction; the stage driving device 22 is used to drive the stage 21 to move in the target focus adjustment interval at a first preset speed; the lens module 11 is used to use the lens module 11 to collect multiple first sample images of the sample carried on the stage 21 during the movement; the focus module is used to determine the image clarity corresponding to each first sample image, and select the first sample image corresponding to the maximum image clarity as the target first sample image; the focus module is also used to determine the target focus position within the target focus adjustment interval corresponding to the target first sample image; the stage driving device 22 is also used to drive the stage 21 to the target focus position to complete automatic focusing.

[0051] The above-mentioned optical detection system 100 provided in the embodiment of the present application determines the target focus adjustment interval corresponding to the lens module 11, controls the stage driving device 22 to drive the stage 21 to move in the target focus adjustment interval at a first preset speed; then uses the lens module 11 to collect multiple first sample images of the sample carried on the stage 21 during the movement, determines the image clarity corresponding to each first sample image, and selects the first sample image corresponding to the maximum image clarity as the target first sample image; then, determines the target focus position within the target focus adjustment interval corresponding to the target first sample image, and controls the stage driving device 22 to drive the stage 21 to the target focus position to complete automatic focusing. By determining the target focus adjustment interval corresponding to the lens module 11, and determining the target focus position according to the image clarity of the collected sample image within the target focus adjustment interval, the efficiency and accuracy of the focus processing can be improved, thereby improving the effect of the focus processing.

[0052] Figure 3 FIG. 1 is a flow chart of a focusing method provided in an embodiment of the present application. The focusing method is applied to an optical detection system, such as Figure 2 As shown, the following steps are included:

[0053] S11, if it is detected that the stage driving device is turned on, determining the target focus adjustment interval corresponding to the lens module in the first direction.

[0054] In one embodiment, taking the motherboard chip as an example, when the optical detection system detects a bad condition of the motherboard chip, the stage drive device is turned on, so that the stage drive device drives the stage to move in the second direction, so that the imaging device can collect bad conditions at different positions of the motherboard chip. In this way, when the control device detects that the stage drive device is turned on, it determines that a focus instruction has been received, and the optical detection system needs to be focused, so that the imaging device collects a clear image of the motherboard chip on the stage, thereby improving the accuracy of the motherboard chip quality analysis.

[0055] In one embodiment, for each magnification objective lens in the lens module, there is a corresponding target focus adjustment interval, and the target focus adjustment interval corresponding to each objective lens may be the same or different. The first direction is the Z-axis direction, and the target focus adjustment interval refers to the movement interval of the stage in the Z-axis direction. The target focus adjustment interval includes the moving position of successful focus. The stage is driven by the stage driving device to move in the target focus adjustment interval, and the moving position of successful focus can be determined in the target focus adjustment interval, thereby completing the focus.

[0056] S12, controlling the stage driving device to drive the stage to move within the target focus adjustment interval at a first preset speed.

[0057] In one embodiment, the first preset speed refers to a preset moving speed of the stage within the target focus adjustment interval. The first preset speed is set to a relatively small value, and moves within the target focus adjustment interval at a slower moving speed to achieve precise focus.

[0058] S13, using the lens module to collect a plurality of first sample images of the sample carried on the stage during the movement.

[0059] In one embodiment, the control device sends a first acquisition instruction to the lens module, and the first acquisition instruction includes an acquisition frequency. After receiving the first acquisition instruction, the lens module collects multiple first sample images of the sample carried on the stage during the movement according to the acquisition frequency. Among them, the acquisition frequency can be set according to actual needs. The higher the acquisition frequency, the more the number of first sample images collected; the lower the acquisition frequency, the fewer the number of first sample images collected. In one embodiment, the number of first sample images collected by the lens module is at least 3. In another embodiment, the control device sends a first acquisition instruction to the lens module, and the first acquisition instruction includes an acquisition number. After receiving the first acquisition instruction, the lens module randomly collects multiple first sample images of the sample carried on the stage during the movement according to the acquisition number. Among them, the acquisition number can be set according to actual needs. For example, the acquisition number can be 3, 5, 8, etc., which is not limited here.

[0060] S14, determining the image definition corresponding to each first sample image, and selecting the first sample image corresponding to the maximum image definition as the target first sample image.

[0061] In one embodiment, the plurality of first sample images captured by the lens module are stored in a cache space of a storage device, and then the control device obtains each first sample image from the cache space according to the first-in-first-out principle, and inputs the first sample image into an image definition determination program in the storage device to obtain the image definition corresponding to each first sample image. The maximum image definition is selected from the plurality of image definitions, and according to the corresponding relationship between the image definition and the first sample image, the target first sample image corresponding to the maximum image definition can be obtained.

[0062] S15, determining a target focus position within the target focus adjustment interval corresponding to the target first sample image.

[0063] In one embodiment, when the lens module collects multiple first sample images, the moving position of each first sample image in the first direction is recorded to obtain the corresponding relationship between the first sample image and the moving position. Then, according to the corresponding relationship, the target focus position corresponding to the target first sample image is obtained.

[0064] S16, controlling the stage driving device to drive the stage to the target focusing position to complete automatic focusing.

[0065] In one embodiment, at the target focus position, the image clarity of the sample image captured by the lens module is the highest. Thus, the target focus position is the position where the lens module focuses successfully. The stage driving device is controlled to drive the stage to the target focus position to complete automatic focusing.

[0066] The above-mentioned focusing method provided in the embodiment of the present application determines the target focus adjustment interval corresponding to the lens module, controls the stage driving device to drive the stage to move in the target focus adjustment interval at a first preset speed; then uses the lens module to collect multiple first sample images of the sample carried on the stage during the movement, determines the image clarity corresponding to each first sample image, and selects the first sample image corresponding to the maximum image clarity as the target first sample image; then, determines the target focus position within the target focus adjustment interval corresponding to the target first sample image, and controls the stage driving device to drive the stage to the target focus position to complete automatic focusing. By determining the target focus adjustment interval corresponding to the lens module, and determining the target focus position within the target focus adjustment interval according to the image clarity of the collected sample image, the efficiency and accuracy of the focus processing can be improved, thereby improving the effect of the focus processing.

[0067] In one embodiment, before controlling the stage driving device to drive the stage to move in the target focus adjustment interval at a first preset speed to achieve precise focusing, the target focus adjustment interval may also be determined by means of coarse focusing. Figure 4 is a flow chart of determining a target focus adjustment interval provided by an embodiment of the present application, and a method for determining a target focus adjustment interval is applied to an optical detection system. Figure 4 As shown, the following steps are included:

[0068] S21, obtaining the objective lens magnification corresponding to the lens module, and determining the depth of field length associated with the objective lens magnification.

[0069] In one embodiment, the lens module refers to a module composed of a plurality of objective lenses of different high magnifications. For example, the lens module may be composed of objective lenses with objective magnifications of 50 times, 100 times, and 200 times. The depth of field length refers to the range in which the sample image can remain clear from the time the lens is aimed at the sample to the range before and after the focus during the image acquisition process. The image clarity of the sample image within the depth of field length is high, and the image clarity outside the depth of field length is low. For objective lenses with different objective magnifications, there are corresponding depth of field lengths. For example, the depth of field length corresponding to a 50x objective lens is 37 microns, the depth of field length corresponding to a 100x objective lens is 10 microns, and the depth of field length corresponding to a 200x objective lens is 3 microns.

[0070] S22, controlling the stage driving device to drive the stage to move in the first direction at a second preset speed, wherein the second preset speed is greater than the first preset speed.

[0071] In one embodiment, the second preset speed refers to a preset moving speed of the stage in the first direction. The second preset speed is set to a relatively large value, and a coarse focus is achieved by moving within the upper and lower limit intervals in the first direction at a faster moving speed. The upper limit refers to the maximum moving position that the stage can move upward along the first direction, and the lower limit refers to the maximum moving position that the stage can move downward along the first direction.

[0072] S23, using the lens module to collect a second sample image of the sample carried on the stage during the movement.

[0073] In one embodiment, the control device sends a second acquisition instruction to the lens module, and the second acquisition instruction includes an acquisition frequency. After receiving the second acquisition instruction, the lens module acquires multiple second sample images of the sample carried on the stage during the movement according to the acquisition frequency. Among them, the acquisition frequency can be set according to actual needs. The higher the acquisition frequency, the more the number of first sample images acquired; the lower the acquisition frequency, the fewer the number of first sample images acquired. In one embodiment, the multiple second sample images acquired by the lens module are stored in the cache space of the storage device. After that, the control device obtains each second sample image from the cache space according to the first-in-first-out principle, and inputs the second sample image into the image clarity determination program in the storage device to obtain the image clarity corresponding to each second sample image.

[0074] S24, if it is monitored that the image clarity of the second sample image is greater than a preset clarity threshold, determine an initial focus position corresponding to the second sample image, and determine a target focus adjustment interval according to the initial focus position and the depth of field length.

[0075] In one embodiment, the preset clarity threshold refers to a value preset for evaluating image clarity. If the image clarity of the second sample image is monitored to be greater than the preset clarity threshold, it is determined that the acquired second sample image is clearer, and the initial focus position corresponding to the second sample image is determined. In one embodiment, when the lens module acquires multiple second sample images, the moving position of each second sample image in the first direction is recorded to obtain a corresponding relationship between the second sample image and the moving position. Then, based on the corresponding relationship, the initial focus position corresponding to the second sample image is obtained.

[0076] In one embodiment, at the initial focus position, the image clarity of the sample image collected by the lens module is greater than a preset clarity threshold, so that the moving position of successful focus is near the initial focus position. Taking the initial focus position as the reference position, the target focus adjustment interval is determined according to the depth of field length.

[0077] The embodiment of the present application determines the initial focus position by means of coarse focusing, determines the depth of field length according to the objective lens magnification of the lens module, and then uses the initial focus position as the reference position and determines the target focus adjustment interval according to the depth of field length, so as to control the device to perform precise focusing within the target focus adjustment interval. By determining the target focus adjustment interval by means of coarse focusing, the problem of the stage moving too far in the first direction causing the focus time to be too long is avoided, thereby improving the focusing efficiency; in addition, the present application determines the depth of field range according to the objective lens magnification, and then determines the target focus adjustment interval according to the depth of field range, so that more images with high image clarity are captured within the target focus adjustment interval, and the target focus position corresponding to the peak value is selected from more images with high image clarity, which can improve the focusing accuracy.

[0078] Figure 5 is a flow chart for determining the interval endpoints provided in an embodiment of the present application, and the process for determining the interval endpoints is applied in an optical detection system. Figure 5 As shown, the following steps are included:

[0079] S31, determining a target distance value according to the depth of field.

[0080] In one embodiment, the target distance value refers to a value determined according to the depth of field length, and the target distance value is greater than or equal to the depth of field length. The greater the depth of field length, the greater the target distance value; the smaller the depth of field length, the smaller the target distance value. For different depths of field lengths, different target distance values ​​can be set, or a unified target distance value can be set, which is not limited here. For example, if the objective lens magnification is 50 times and the corresponding depth of field length is 37 microns, the target distance value can be 50 microns.

[0081] S32, taking the initial focus position as a reference position, moving the target distance value upward along the first direction as a first interval endpoint, and moving the target distance value downward along the first direction as a second interval endpoint.

[0082] In one embodiment, in a first direction, taking the initial focus position as a reference position, the target distance value is moved upward along the first direction as a first interval endpoint, and the target distance value is moved downward along the first direction as a second interval endpoint.

[0083] S33: Determine the target focus adjustment interval according to the first interval endpoint and the second interval endpoint.

[0084] In one embodiment, the first interval endpoint and the second interval endpoint are used as two endpoint values ​​of the target focus adjustment interval, and the target focus adjustment interval can be obtained according to the two endpoint values. Taking the initial focus position as d and the target distance value as 50 microns as an example, the first interval endpoint is [d-50] and the second interval endpoint is [d+50].

[0085] The embodiment of the present application determines the target distance value according to the depth of field length, and then determines the target focus adjustment interval according to the target distance value, which can ensure that the target focus adjustment interval contains the coordinate interval corresponding to the depth of field length, so that more images with high image clarity are captured within the target focus adjustment interval, and the target focus position corresponding to the peak value is selected from more images with high image clarity, which can improve the focusing accuracy.

[0086] Figure 6 is a flowchart of determining the corresponding relationship provided in the embodiment of the present application, and the corresponding relationship determination process is applied in an optical detection system. Figure 6 As shown, the following steps are included:

[0087] S41, obtaining an initial moving position and an initial timestamp of the stage in the first direction.

[0088] In one embodiment, the initial movement position refers to the coordinate position in the first direction before the stage starts to move, and the initial timestamp refers to the timestamp before the stage starts to move.

[0089] S42, obtaining a target timestamp corresponding to the target first sample image.

[0090] In one embodiment, when the lens module collects multiple first sample images, the timestamp corresponding to the collection of each first sample image is recorded to obtain the corresponding relationship between the first sample image and the timestamp. Then, the target timestamp corresponding to the target first sample image is obtained according to the corresponding relationship.

[0091] S43: Determine a movement position corresponding to each first sample image acquired according to the initial movement position, the initial timestamp, the target timestamp, and the first preset speed.

[0092] In one embodiment, the moving position is recorded as S, the initial moving position is recorded as S0, the initial timestamp is recorded as t0, the target timestamp is recorded as t, and the first preset speed is recorded as v. The moving position corresponding to each first sample image collected is determined according to the following formula 1:

[0093] Formula 1: S = S0 + v*(t-t0)

[0094] S44, constructing a corresponding relationship between the first sample image and the moving position.

[0095] In one embodiment, a corresponding relationship is established between each of the first sample images and the calculated moving position.

[0096] The embodiment of the present application determines the movement position corresponding to each first sample image collected according to the initial movement position, the initial timestamp, the target timestamp and the first preset speed, and then constructs the corresponding relationship between the first sample image and the movement position. By constructing the above corresponding relationship, the target focus position corresponding to the target first sample image can be quickly and accurately determined, thereby improving the accuracy and speed of focusing.

[0097] Figure 7 is a flow chart for determining image clarity provided in an embodiment of the present application, and the image clarity determination process is applied in an optical detection system. Figure 7 As shown, the following steps are included:

[0098] S51, obtaining an initial definition determination function.

[0099] In one embodiment, the initial clarity determination function refers to a pre-set mathematical model for calculating image clarity. The initial clarity determination function may include a gradient-based clarity evaluation function (e.g., energy gradient function, Tenengrad function, Brenner function, Laplacian function, etc.), a frequency domain evaluation function, an information entropy-based clarity evaluation function, and a statistics-based clarity evaluation function (e.g., Range function, Vollaths function), etc., without limitation herein.

[0100] S52, calling the initial definition determination function to process the first sample image to obtain the initial image definition corresponding to the first sample image.

[0101] S53, determining a target coefficient corresponding to each initial image definition.

[0102] In one embodiment, for each first sample image, there is a corresponding target coefficient. Before determining the target coefficient, the largest initial image definition is selected from a plurality of initial image definitions. For example, there are n first sample images corresponding to n initial image definitions, and the n initial image definitions are arranged in the order of acquisition time, with the initial image definition corresponding to the first sample image acquired first being ranked first, and the initial image definition corresponding to the last sample image acquired being ranked last. Determine the maximum initial image clarity corresponding to position K from the n initial image clarity. For the initial image clarity from the 1st position to the Kth position, the target coefficient of the 1st position is 1; the target coefficient of the 2nd position is the initial image clarity corresponding to the first sample image at the 2nd position / the initial image clarity corresponding to the first sample image at the 1st position; the target coefficient of the 3rd position is the initial image clarity corresponding to the first sample image at the 3rd position / (the image clarity average of the initial image clarity corresponding to the first sample image at the 1st position and the initial image clarity corresponding to the first sample image at the 2nd position); the target coefficient of the 4th position is the initial image clarity corresponding to the first sample image at the 4th position / (the image clarity average of the initial image clarity corresponding to the first sample image at the 1st position, the initial image clarity corresponding to the first sample image at the 2nd position and the initial image clarity corresponding to the first sample image at the 3rd position). And so on, until the target coefficient of the Kth position is obtained. For the initial image clarity from the Kth position to the nth position, the target coefficient of the nth position is 1; the target coefficient of the n-1th position is the initial image clarity corresponding to the first sample image at the n-1th position / the initial image clarity corresponding to the first sample image at the n-1th position; the target coefficient of the n-2th position is the initial image clarity corresponding to the first sample image at the n-2th position / (the average of the image clarity of the initial image clarity corresponding to the first sample image at the n-1th position and the initial image clarity corresponding to the first sample image at the n-th position); the target coefficient of the n-3th position is the initial image clarity corresponding to the first sample image at the n-3th position / (the average of the image clarity of the initial image clarity corresponding to the first sample image at the n-2th position and the initial image clarity corresponding to the first sample image at the n-1th position and the initial image clarity corresponding to the first sample image at the n-th position). The target coefficient corresponding to each of the initial image clarity can be determined in the above manner.

[0103] S54: Obtain the image clarity corresponding to the first sample image according to the target coefficient and the initial image clarity.

[0104] In one embodiment, the product of the target coefficient and the initial image definition is calculated, and the product is used as the image definition corresponding to the first sample image.

[0105] The embodiment of the present application determines the target coefficient corresponding to each of the initial image clarity, and obtains the image clarity corresponding to the first sample image based on the target coefficient and the initial image clarity. This can make the image clarity near the peak greater, make the peak more obvious compared to the smooth area, and improve the accuracy and rate of peak determination, thereby improving the accuracy and efficiency of focusing processing.

[0106] Figure 8 is a flow chart for determining a target first sample image provided by an embodiment of the present application, and the flow chart for determining a target first sample image is applied to an optical detection system. Figure 8 As shown, the following steps are included:

[0107] S61, constructing an image clarity curve according to the image clarity corresponding to each first sample image.

[0108] In one embodiment, the moving position of each first sample image in the target focus adjustment interval is determined, and an image clarity curve is constructed with the moving position as the horizontal coordinate and the image clarity corresponding to each first sample image as the vertical coordinate. In one embodiment, the target timestamp of each first sample image in the target focus adjustment interval can also be determined, and the image clarity curve is constructed with the target timestamp as the horizontal coordinate and the image clarity corresponding to each first sample image as the vertical coordinate. The image clarity curve can be set according to actual needs and is not limited here.

[0109] S62: Taking the peak value in the image clarity curve as the maximum image clarity.

[0110] S63, determining the target first sample image corresponding to the maximum image clarity.

[0111] In one embodiment, in the image clarity curve of image clarity-moving position, the moving position corresponding to the maximum image clarity can be directly determined, and the moving position is used as the target focus position, and the stage driving device is controlled to drive the stage to the target focus position to complete automatic focusing. In the image clarity curve of image clarity-target timestamp, the target timestamp corresponding to the maximum image clarity can be determined, and according to the corresponding relationship between the timestamp and the first sample image, the target first sample image corresponding to the target timestamp can be obtained.

[0112] The embodiment of the present application constructs an image clarity curve according to the image clarity corresponding to each first sample image, and can quickly and accurately determine the peak value from the image clarity curve as the maximum image clarity, and then determine the target first sample image corresponding to the maximum image clarity, which can improve the accuracy and rate of determining the focus position, and further improve the accuracy and rate of focusing.

[0113] then Figure 1 and Figure 2 Description of the optical detection system 100. In some embodiments, the optical detection system 100 can also be connected to a client device (not shown in the figure), and the client device includes but is not limited to any electronic product that can interact with the client through a keyboard, mouse, remote control, touchpad or voice control device, such as a personal computer, a tablet computer, a smart phone, a digital camera, etc.

[0114] In some embodiments, at least one communication bus 70 is configured to implement connection communication between the storage device 60 and at least one control device 50, etc.

[0115] Although not shown, the optical detection system 100 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to at least one control device 50 through a power management device, so that the power management device can manage charging and discharging and other functions. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The optical detection system 100 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0116] In some embodiments, a computer program is stored in the storage device 60, and when the computer program is executed by at least one control device 50, all or part of the steps in the focusing method are implemented. The storage device 60 includes a read-only memory device (ROM), a programmable read-only memory device (PROM), an erasable programmable read-only memory device (EPROM), a one-time programmable read-only memory device (OTPROM), an electronically erasable rewritable read-only memory device (EEPROM), a compact disc read-only memory device (CD-ROM) or other optical disc storage devices, magnetic disk storage devices, magnetic tape storage devices, or any other computer-readable medium that can be used to carry or store data.

[0117] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the product preparation device 30, etc.

[0118] In some embodiments, at least one control device 50 is the control core (ControlUnit) of the optical detection system 100, and uses various interfaces and lines to connect various components of the entire optical detection system 100, and executes various functions and processes data of the product preparation device 30 by running or executing programs or modules stored in the storage device 60, and calling data stored in the storage device 60. For example, when at least one control device 50 executes the computer program stored in the storage device 60, it implements all or part of the steps of the focusing method in the embodiment of the present application; or implements all or part of the functions of the optical detection system 100. At least one control device 50 can be composed of an integrated circuit, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips.

[0119] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a product preparation device (which can be a personal computer, a product preparation device, or a network device, etc.) or a processor to execute parts of the methods of various embodiments of the present application.

[0120] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation.

[0121] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0122] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0123] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or, and the singular does not exclude the plural. Multiple units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A focusing method, applied to an optical detection system, characterized in that: The optical detection system includes an imaging device and a loading device, wherein the imaging device is used to collect an image of a sample carried on the loading device; The object-carrying device comprises an object stage and an object stage driving device, wherein the object stage driving device is used to drive the object stage to move, and the focusing method comprises: If it is detected that the stage driving device is turned on, determining a target focus adjustment interval corresponding to the imaging device in the first direction; Controlling the stage driving device to drive the stage to move within the target focus adjustment interval at a first preset speed; Using the imaging device to collect a plurality of first sample images of the sample carried on the stage during the movement; Determine the image definition corresponding to each of the first sample images, and select the first sample image corresponding to the maximum image definition as the target first sample image; Determine a target focus position within the target focus adjustment interval corresponding to the target first sample image; The stage driving device is controlled to drive the stage to the target focusing position to complete automatic focusing.

2. The method according to claim 1, characterized in that The determining of the target focus adjustment interval corresponding to the imaging device in the first direction includes: Acquire an objective lens magnification corresponding to the imaging device, and determine a depth of field length associated with the objective lens magnification; Controlling the stage driving device to drive the stage to move in the first direction at a second preset speed, wherein the second preset speed is greater than the first preset speed; using the imaging device to collect a second sample image of the sample carried on the stage during the movement; If it is monitored that the image clarity of the second sample image is greater than a preset clarity threshold, the initial focus position corresponding to the second sample image is determined, and the target focus adjustment interval is determined according to the initial focus position and the depth of field length.

3. The method according to claim 2, characterized in that The determining the target focus adjustment interval according to the initial focus position and the depth of field length includes: Determine the target distance value according to the depth of field length; Taking the initial focus position as a reference position, moving the target distance value upward along the first direction as a first interval endpoint, and moving the target distance value downward along the first direction as a second interval endpoint; The target focus adjustment interval is determined according to the first interval endpoint and the second interval endpoint.

4. The method according to claim 1, characterized in that The determining the target focus position within the target focus adjustment interval corresponding to the target first sample image includes: A preset correspondence relationship between the first sample image and the moving position is acquired, and based on the correspondence relationship, the target focusing position corresponding to the target first sample image is obtained.

5. The method according to claim 4, characterized in that The obtaining of a preset correspondence between the first sample image and the moving position includes: Obtaining an initial moving position and an initial timestamp of the stage in the first direction; Obtaining a target timestamp corresponding to the target first sample image; Determine the moving position corresponding to each of the first sample images acquired according to the initial moving position, the initial timestamp, the target timestamp and the first preset speed; A corresponding relationship between the first sample image and the moving position is constructed.

6. The method according to claim 1, characterized in that The determining the image clarity corresponding to each of the first sample images comprises: Calling a preset initial definition determination function to process the first sample image to obtain an initial image definition corresponding to the first sample image; Determine a target coefficient corresponding to each of the initial image sharpnesses; The image clarity corresponding to each of the first sample images is obtained according to the target coefficient and the initial image clarity.

7. The method according to claim 1, characterized in that The determining the image definition corresponding to each of the first sample images and selecting the first sample image corresponding to the maximum image definition as the target first sample image includes: constructing an image clarity curve according to the image clarity corresponding to each of the first sample images; Taking the peak value in the image clarity curve as the maximum image clarity; Determine the target first sample image corresponding to the maximum image clarity.

8. An optical detection system, characterized in that: The optical detection system includes an imaging device, a carrier device and a control device, the imaging device is used to collect the sample image carried by the carrier device; the carrier device includes a stage and a stage driving device, the stage driving device is used to drive the stage to move in multiple preset directions; the control device connects the imaging device and the carrier device, and executes the focusing method as described in any one of claims 1 to 7 by controlling the imaging device and the carrier device.

9. The system according to claim 8, characterized in that The stage driving device comprises a first stage driving mechanism and a second stage driving mechanism, wherein: The first stage driving mechanism is used to drive the stage to move in the first direction; The second stage driving mechanism is used to drive the stage to move in a second direction.

10. The system according to claim 8, characterized in that The imaging device includes a lens module and a lens adjustment device, wherein the lens module is connected to the lens adjustment device, the lens module is used to collect the image of the sample carried on the loading device, and the lens adjustment device is used to switch the lens module so that the objective lens of the corresponding magnification collects the image of the sample carried on the loading stage.

Citation Information

Cited By

  • Focus searching method, semiconductor detection method, detection equipment and storage medium

    CN119996830A

  • Focus Search Method, Semiconductor Detection Method, Detection Device, and Storage Medium

    CN119996830B