Focusing method and device based on stepping mode, electronic equipment and storage medium
Through the step-based focusing method, the threshold judgment of the optical path intensity conversion signal and depth of field value is solved, and the existing focusing algorithms are not in unimodality and sensitivity are achieved, efficient and accurate focusing performance is achieved, and the calculation is reduced. cost.
Patent Information
- Application Number
- CN202310845910.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2025-01-10
AI Technical Summary
Existing focus algorithms can easily lead to local extreme value misjudgment when the non-unimodality and insufficient sensitivity of the evaluation function, resulting in focus failure. In addition, deep learning methods require a large amount of labeled data to increase the calculation cost, making it difficult to improve the focus performance of the optical system.
By using a step-by-step focusing method, by controlling the image acquisition device to move the preset step length along the preset direction, the optical path intensity conversion signal and depth of field value are obtained until the optical path intensity conversion signal reaches the threshold value and the depth of field value is within the preset range, and the Complete focus to avoid local optimal solutions and uncontrollable errors.
提高了光学系统的对焦性能,避免了局部最优解和不可控误差,降低了对焦成本,提高了对焦精准度和工作效率。
Smart Images

Figure CN119299853A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a step-based focusing method and device, an electronic device, and a storage medium. Background Art
[0002] In the related art, the focusing algorithm mainly includes the following two methods: Method 1: directly calculating the image gradient value, Method 2: using a deep learning algorithm. For Method 1, the image gradient value is directly calculated, and the hill climbing search algorithm is used to obtain the local optimal focal plane position. However, this hill climbing search algorithm has very high requirements for the evaluation function and the motor drive. The evaluation function needs to have absolute unimodality and extremely high sensitivity. Otherwise, the algorithm is likely to regard the local extreme value of the evaluation function as the optimal focal plane position, resulting in focusing failure, or the evaluation function tends to be smooth in the defocused area, resulting in the motor not receiving the reversal signal for a long time, and finally entering an infinite loop; For Method 2, a deep learning algorithm is used, but this method requires a large amount of training set data in the early stage, and also requires relatively good labeled data, which increases the computational cost.
[0003] Therefore, how to improve the focusing performance of the optical system is an urgent problem to be solved. Summary of the invention
[0004] The present invention provides a step-by-step focusing method, device, electronic device and storage medium, the main purpose of which is to improve the focusing performance of an optical system.
[0005] According to a first aspect of the present disclosure, a focusing method based on a stepping manner is provided, comprising:
[0006] After controlling the image acquisition device to move a preset distance, an optical path intensity conversion signal of the image is obtained;
[0007] When it is determined that the optical path intensity conversion signal is less than a preset optical path intensity conversion signal threshold, the image acquisition device is controlled to move a first preset step length along a preset movement strategy until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction;
[0008] A depth of field value of a lens of the image acquisition device is obtained, and when it is determined that the depth of field value does not exceed a limit value of a preset depth of field range, it is determined that focusing is completed.
[0009] In some embodiments, obtaining the depth of field value of the lens of the image acquisition device includes:
[0010] In a case where it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold, the depth of field value is acquired.
[0011] In some embodiments, controlling the image acquisition device to move a first preset step length along a preset movement strategy comprises:
[0012] Controlling the image acquisition device to move a first preset step along a first preset direction; wherein the preset movement strategy includes moving a first preset step along the first preset direction, wherein the first preset direction is determined in a random manner or in a preset manner;
[0013] Determine whether the difference between the optical path intensity conversion signal after moving the first preset step length and the preset optical path intensity conversion signal threshold value becomes smaller;
[0014] If it is determined that the difference becomes smaller, continue to move the first preset step along the first preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold;
[0015] If it is determined that the difference value becomes larger, move the second preset step length along the second preset direction, wherein the preset movement strategy includes moving the second preset step length along the second preset direction, and the first preset direction is opposite to the second preset direction;
[0016] Determine whether the difference between the optical path intensity conversion signal after moving the second preset step length and the preset optical path intensity conversion signal threshold value becomes smaller;
[0017] If it is determined that the difference becomes smaller, continue to move the second preset step length along the second preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold.
[0018] In some embodiments, the method further comprises:
[0019] When it is determined that the depth of field value exceeds the limit value of the preset depth of field range, the control of the movement of the image acquisition device is suspended and an error prompt message is output.
[0020] In some embodiments, when determining that the depth of field value does not exceed a limit value of a preset depth of field range, determining that the focusing is completed includes:
[0021] Determine whether the depth of field value is less than a lower limit value of a first preset range, where the first preset range is a normal focal plane range corresponding to a dead zone of an image focal plane of the image imaging;
[0022] If it is determined that the depth of field value is greater than or equal to the lower limit value of the first preset range, determining whether the depth of field value is greater than or equal to the upper limit value of the first preset range;
[0023] If it is determined that the depth of field value is less than the upper limit value of the first preset range, it is determined that the focusing is completed.
[0024] In some embodiments, the method further comprises:
[0025] If it is determined that the depth of field value is less than the lower limit value of the first preset range, then determining whether the depth of field value is less than the lower limit value of a second preset range, where the second preset range is a user-defined limit value that can exceed the first preset range;
[0026] If it is determined that the depth of field value is greater than or equal to the lower limit value of the second preset range, the image acquisition device is controlled to move along a third preset direction by a third preset step, wherein the movement in the third direction can be determined randomly or by a preset method.
[0027] In some embodiments, pausing control of movement of the image acquisition device comprises:
[0028] If it is determined that the depth of field value is less than the lower limit value of the second preset range, the control of the movement of the image acquisition device is suspended.
[0029] In some embodiments, the method further comprises:
[0030] If it is determined that the depth of field value is greater than or equal to the upper limit value of the first preset range, determining whether the depth of field value is greater than the upper limit value of the second preset range;
[0031] If it is determined that the depth of field value is less than the upper limit value of the second preset range, the image acquisition device is controlled to move in a third preset direction in a fourth preset step length.
[0032] In some embodiments, pausing control of movement of the image acquisition device comprises:
[0033] If it is determined that the depth of field value is greater than or equal to the upper limit value of the second preset range, the control of the movement of the image acquisition device is suspended.
[0034] In some embodiments, after determining that the focusing is completed, the method further includes:
[0035] Acquiring focus parameters, and confirming the position information of successful focus according to the focus parameters;
[0036] A capture instruction carrying the position information of successful focusing is sent to the image capture device, so that the image capture device captures a target image according to the position information of successful focusing.
[0037] According to a second aspect of the present disclosure, a focusing device based on a stepping method is provided, comprising:
[0038] A first acquisition unit, used to control the image acquisition device to move a preset distance and acquire an optical path intensity conversion signal of the image;
[0039] A control unit, configured to control the image acquisition device to move a first preset step along a preset movement strategy when it is determined that the optical path intensity conversion signal is less than a preset optical path intensity conversion signal threshold, until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction;
[0040] A second acquisition unit, used to acquire a depth of field value of a lens of the image acquisition device;
[0041] The determination unit is used to determine that the focusing is completed when it is determined that the depth of field value does not exceed a limit value of a preset depth of field range.
[0042] In some embodiments, the second acquisition unit is further configured to acquire the depth of field value when it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold.
[0043] In some embodiments, the control unit is further configured to:
[0044] Controlling the image acquisition device to move a first preset step along a first preset direction; wherein the preset movement strategy includes moving a first preset step along the first preset direction, wherein the first preset direction is determined in a random manner or in a preset manner;
[0045] Determine whether the difference between the optical path intensity conversion signal after moving the first preset step length and the preset optical path intensity conversion signal threshold value becomes smaller;
[0046] If it is determined that the difference becomes smaller, continue to move the first preset step along the first preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold;
[0047] If it is determined that the difference value becomes larger, move the second preset step length along the second preset direction, wherein the preset movement strategy includes moving the second preset step length along the second preset direction, and the first preset direction is opposite to the second preset direction;
[0048] Determine whether the difference between the optical path intensity conversion signal after moving the second preset step length and the preset optical path intensity conversion signal threshold value becomes smaller;
[0049] If it is determined that the difference becomes smaller, continue to move the second preset step length along the second preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold.
[0050] In some embodiments, the apparatus further comprises:
[0051] A pause unit, configured to pause controlling the movement of the image acquisition device when it is determined that the depth of field value exceeds a limit value of the preset depth of field range;
[0052] The output unit is used to output error prompt information.
[0053] In some embodiments, the determining unit further includes:
[0054] A first judging module, configured to judge whether the depth of field value is less than a lower limit value of a first preset range, wherein the first preset range is a normal focal plane range corresponding to a dead zone of an image focal plane of the image imaging;
[0055] a second judgment module, configured to judge whether the depth of field value is greater than or equal to an upper limit value of the first preset range if it is determined that the depth of field value is greater than or equal to a lower limit value of the first preset range;
[0056] The determination module is used to determine that the focusing is completed if it is determined that the depth of field value is less than the upper limit value of the first preset range.
[0057] In some embodiments, the determining unit further includes:
[0058] a third judgment module, configured to judge whether the depth of field value is less than the lower limit value of a second preset range if it is determined that the depth of field value is less than the lower limit value of the first preset range, wherein the second preset range is a user-defined limit value that can exceed the first preset range;
[0059] The control module is used to control the image acquisition device to move a third preset step along a third preset direction if it is determined that the depth of field value is greater than or equal to the lower limit of the second preset range, wherein the movement in the third direction can be determined randomly or by a preset method.
[0060] In some embodiments, the pause unit is further configured to pause controlling the movement of the image acquisition device if it is determined that the depth of field value is less than a lower limit value of the second preset range.
[0061] In some embodiments, the determining unit further includes:
[0062] a fourth judgment module, configured to judge whether the depth of field value is greater than the upper limit value of the second preset range if it is determined that the depth of field value is greater than or equal to the upper limit value of the first preset range;
[0063] The control module is used to control the image acquisition device to move a fourth preset step in a third preset direction if it is determined that the depth of field value is less than an upper limit value of the second preset range.
[0064] In some embodiments, the pause unit is further configured to pause controlling the movement of the image acquisition device if it is determined that the depth of field value is greater than or equal to an upper limit value of the second preset range.
[0065] In some embodiments, the apparatus further comprises:
[0066] A confirmation unit, configured to obtain focus parameters after the determination unit determines that the focus is completed, and to confirm the position information of successful focus according to the focus parameters;
[0067] The sending unit is used to send a capture instruction carrying the position information of successful focus to the image capture device, so that the image capture device captures the target image according to the position information of successful focus.
[0068] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0069] at least one processor; and
[0070] a memory communicatively connected to the at least one processor; wherein,
[0071] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.
[0072] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0073] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.
[0074] The step-by-step focusing method, device, electronic device and storage medium provided in the present disclosure control the image acquisition device to move a preset distance, and then obtain the optical path intensity conversion signal of the image imaging; when it is determined that the optical path intensity conversion signal is less than the preset optical path intensity conversion signal threshold, control the image acquisition device to move a first preset step length along the preset movement strategy until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction; obtain the depth of field value of the lens of the image acquisition device, and when it is determined that the depth of field value does not exceed the limit value of the preset depth of field range, determine that the focusing is completed. The embodiment of the present application is based on the focusing algorithm of the micro-step of the stepping motor, which improves the high-speed focusing performance of the optical-mechanical system of the sequencer. This focusing algorithm can avoid falling into the local optimal solution, and at the same time can eliminate the influence of uncontrollable errors such as the movement of the imaging platform of the high-content device, the changing structure between the chip and the fixed position, and the working environment, so that the accuracy of the entire focusing system is higher.
[0075] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0077] Figure 1 A flowchart of a focusing method based on a step-by-step manner provided by an embodiment of the present disclosure;
[0078] Figure 2 A schematic diagram of an optical system provided by an embodiment of the present disclosure;
[0079] Figure 3 A flowchart of another focusing method based on a step-by-step manner provided in an embodiment of the present disclosure;
[0080] Figure 4 A flow chart of a method for controlling an image acquisition device to move a first preset step length along a preset movement strategy provided by an embodiment of the present disclosure;
[0081] Figure 5 A schematic structural diagram of a focusing device based on a stepping method provided in an embodiment of the present disclosure;
[0082] Figure 6 A schematic structural diagram of another focusing device based on a stepping method provided in an embodiment of the present disclosure;
[0083] Figure 7 A schematic block diagram of an exemplary electronic device provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0084] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0085] The following describes a step-by-step focusing method, device, electronic device, and storage medium according to an embodiment of the present disclosure with reference to the accompanying drawings.
[0086] Figure 1 A schematic flow chart of a step-by-step focusing method provided in an embodiment of the present disclosure.
[0087] like Figure 1 As shown, the method comprises the following steps:
[0088] Step 101, after controlling the image acquisition device to move a preset distance, obtain an optical path intensity conversion signal of image imaging.
[0089] The chip containing the gene to be tested is placed on a moving plane, and the image acquisition device focuses the image through a lens. The image acquisition device can move under the drive of a stepper motor.
[0090] When the imaging focal plane moves up and down, the image is focused through the lens, and an approximately linear circuit signal output that changes with the focal plane is obtained on the PD sensor. In this way, the optical signal at the focal plane spatial position is converted into an electrical signal, that is, the optical signal at the focal plane spatial position is converted into an electrical signal, which is the optical path intensity conversion signal for image imaging.
[0091] It should be noted that this step refers to plane movement of the XY axis in the focal plane space when controlling the image acquisition device to move a preset distance.
[0092] Step 102, when it is determined that the optical path intensity conversion signal is less than a preset optical path intensity conversion signal threshold, control the image acquisition device to move a first preset step along a preset movement strategy until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction.
[0093] When the focal plane moves up and down, the sensor light spot will be offset left and right along with the focal plane. Through the sensor processing, a linear analog output that changes with the focal plane is output. By comparing with the analog reference value generated by the normal focal plane, it is converted into the up and down movement (movement) of the lens along the preset direction (Z axis).
[0094] In order to facilitate the understanding of the optical system of the present application, Figure 2 As shown, Figure 2 This is a schematic diagram of an optical system described in an embodiment of the present application. The sensor sheet light (PD sensor) includes a first movable plate and a second movable plate. The light spot projected onto the first movable plate (PDA) and the second movable plate (PDB) outputs a linear light path intensity conversion signal that changes with the focal plane according to the offset of the focal plane. The signal is compared with a preset light path intensity conversion signal threshold (benchmark). When it is determined that the light path intensity conversion signal is less than the preset light path intensity conversion signal threshold, it indicates that the required clarity for imaging is not met. Therefore, it is necessary to adjust the focal length to meet the demand for the clarity of the captured image. Among them, the light path intensity conversion signal refers to the range size, that is, the range of the light spot hitting the PDA and PDB space. The preset light path intensity conversion signal threshold is an empirical value. For example, the preset light path intensity conversion signal threshold can be set to any value between 60 and 99. For example, the preset light path intensity conversion signal threshold is set to 60. It can be flexibly adjusted based on different application scenarios. Specifically, the embodiment of the present application does not limit the preset light path intensity conversion signal threshold.
[0095] In practical applications, the image acquisition device is controlled by a stepper motor to move a first preset step length along a preset movement strategy until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction.
[0096] It should be noted that the preset direction described in the embodiment of the present application is a plane formed perpendicular to the XY axis. In practical applications, the preset direction can be understood as the up and down movement of the objective lens along the Z axis, but a single movement can only be step-by-step in one direction.
[0097] Step 103, obtaining a depth of field value of the lens of the image acquisition device, and determining that focusing is completed when it is determined that the depth of field value does not exceed a limit value of a preset depth of field range.
[0098] The depth of field value (DIV value) of the lens of the image acquisition device can be obtained by any implementation method in the related art, but not limited to. For example, the depth of field value can be calculated in the following manner: the difference signal is DIFF = M*(S1-S2), the sum signal is SUM = M*(S1+S2), and the difference and division signal is DIV = (S1-S2) / (S1+S2), where S1 and S2 are two optical signals output by a two-pixel photodiode, M is the magnification, and M≥5000. The above is only an exemplary distance. Specifically, the embodiment of the present application does not limit the method for determining the depth of field value.
[0099] The acquired depth of field value is compared with the limit value of the preset depth of field range. When it is determined that the depth of field value does not exceed the limit value of the preset depth of field range, it means that the requirements for acquiring the image are met, that is, the focus is completed; when it is determined that the depth of field value exceeds the limit value of the preset depth of field range, it is necessary to adjust / terminate according to the degree of exceeding the preset depth of field range.
[0100] The focusing method based on the stepping method provided in the embodiment of the present application controls the image acquisition device to move a preset distance, and then obtains the optical path intensity conversion signal of the image imaging; when it is determined that the optical path intensity conversion signal is less than the preset optical path intensity conversion signal threshold, the image acquisition device is controlled to move a first preset step length along the preset movement strategy until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction; the depth of field value of the lens of the image acquisition device is obtained, and when it is determined that the depth of field value does not exceed the limit value of the preset depth of field range, it is determined that the focusing is completed. The embodiment of the present application is based on the focusing algorithm of the micro-step of the stepping motor, which improves the high-speed focusing performance of the optical-mechanical system of the sequencer. This focusing algorithm can avoid falling into the local optimal solution, and at the same time can eliminate the influence of uncontrollable errors such as the movement of the imaging platform of the high-content device, the changing structure between the chip and the fixed position, and the working environment, so that the accuracy of the entire focusing system is higher.
[0101] like Figure 3 As shown, the embodiment of the present application also provides another focusing method based on a step-by-step manner, including:
[0102] Step 201, after controlling the image acquisition device to move a preset distance, obtain the optical path intensity conversion signal of the image imaging.
[0103] Before executing the steps, the focus Z axis is returned to zero, the Z axis moves to the vicinity of the focal plane, and the optical path intensity conversion signal of the received image is collected.
[0104] For details about this step, please refer to step 101, and the embodiment of the present application will not be described in detail here.
[0105] Step 202: determine whether the optical path intensity conversion signal is less than a preset optical path intensity conversion signal threshold.
[0106] If it is determined that the optical path intensity conversion signal is less than the preset optical path intensity conversion signal threshold, step 203 is executed; if it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold, step 204 is executed.
[0107] Step 203, controlling the image acquisition device to move a first preset step length along a preset movement strategy until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction;
[0108] When executing step 203, the following methods may be used but are not limited to: Figure 4 As shown, including:
[0109] Step 2031, controlling the image acquisition device to move a first preset step along a first preset direction; wherein the preset movement strategy includes moving a first preset step along the first preset direction, wherein the first preset direction is determined randomly or by a preset method.
[0110] As an implementation method of the embodiment of the present application, randomly move upward along the Z axis so that the Z axis is sent to the current position at an average speed, and the position after moving the first preset step length (for example, the first preset step length is 0.01mm) is z+0.01mm; randomly move downward along the Z axis so that the Z axis is sent to the current position at an average speed, and the position after moving the first preset step length (for example, the first preset step length is 0.01mm) is z-0.01mm. The above examples are only exemplary descriptions and are not specific limitations on the first preset direction and the first preset step length. In the embodiment of the present application, the first preset direction and the first preset step length are variable.
[0111] Step 2032, determining whether the difference between the optical path intensity conversion signal after moving the first preset step length and the preset optical path intensity conversion signal threshold value becomes smaller;
[0112] If it is determined that the difference becomes smaller, step 2033 is executed; if it is determined that the difference becomes larger, step 2034 is executed.
[0113] In an embodiment of the present application, the difference between the optical path intensity conversion signal after moving the first preset step size and the value before the preset optical path intensity conversion signal threshold gradually becomes smaller, indicating that the clarity of the captured image is enhanced. On the contrary, the difference between the optical path intensity conversion signal after moving the first preset step size and the value before the preset optical path intensity conversion signal threshold gradually becomes larger, indicating that the direction of movement is incorrect, resulting in a decrease in the clarity of the captured image.
[0114] Step 2033, continue to move the first preset step length along the first preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold;
[0115] Step 2034, moving a second preset step length along a second preset direction, wherein the preset movement strategy includes moving a second preset step length along the second preset direction, and the first preset direction is opposite to the second preset direction;
[0116] Step 2035, determining whether the difference between the optical path intensity conversion signal after moving the second preset step length and the preset optical path intensity conversion signal threshold value becomes smaller;
[0117] Step 2036: If it is determined that the difference is decreasing, continue to move the second preset step length along the second preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold.
[0118] It should be noted that in actual applications, driving the movement of the image acquisition device is an iterative process. It may not be an operation that can be completed with one movement, but requires multiple movements to complete the step control operation. The specific number of step operations should be combined with the actual application.
[0119] Step 204: Acquire the depth of field value of the lens of the image acquisition device.
[0120] Step 205, determine whether the depth of field value is less than the lower limit value of the first preset range, the first preset range is the normal focal plane range corresponding to the image focal plane dead zone of the image imaging; if it is determined that the depth of field value is greater than or equal to the lower limit value of the first preset range, execute step 206, if it is determined that the depth of field value is less than the lower limit value of the first preset range, execute step 211.
[0121] In the embodiment of the present application, before defining the preset first preset range, the dead zone near the focal plane is first customized, and the range within the focal plane dead zone is the first preset range, that is, the normal focal plane.
[0122] For example, the upper limit value of the first preset range (Deadban) is the +Deadban value, the lower limit value of the first preset range is the -Deadban value, the upper limit value of the second preset range (Level) is the +Level value, the lower limit value of Level is the -Level value, and the distance between the first preset range and the second preset range can be set between 0.05mm and 1.5mm, and the specific distance is not limited.
[0123] Step 206, determining whether the depth of field value is greater than or equal to an upper limit value of the first preset range;
[0124] If it is determined that the depth of field value is less than the upper limit value of the first preset range, step 210 is executed; if it is determined that the depth of field value is greater than or equal to the upper limit value of the first preset range, step 207 is executed.
[0125] Step 207, determining whether the depth of field value is greater than an upper limit value of the second preset range;
[0126] If it is determined that the depth of field value is less than the upper limit value of the second preset range, step 208 is executed; if it is determined that the depth of field value is greater than or equal to the upper limit value of the second preset range, step 209 is executed.
[0127] Step 208: Control the image acquisition device to move in a third preset direction by a fourth preset step length.
[0128] Step 209: suspending control of the movement of the image acquisition device.
[0129] Abnormal situation: When the focus signal changes significantly abnormally, the Z-axis response stops.
[0130] Step 210, determining whether focusing is completed.
[0131] Step 211, determining whether the depth of field value is less than a lower limit value of a second preset range, where the second preset range is a user-defined limit value that can exceed the first preset range;
[0132] If it is determined that the depth of field value is greater than or equal to the lower limit value of the second preset range, step 212 is executed; if it is determined that the depth of field value is less than the lower limit value of the second preset range, step 209 is executed.
[0133] Step 212: Control the image acquisition device to move along a third preset direction by a third preset step length, wherein the movement in the third direction may be determined randomly or by a preset method.
[0134] During the above Z-axis adjustment process, the image clarity analog signal increases or decreases in a linear proportion, and the Z-axis focus uses the optical path analog signal as input and moves in a negative feedback manner.
[0135] It should be noted that the first preset direction movement and the second preset direction movement described in the embodiment of the present application are in opposite directions, the first preset step length and the second preset step length may be the same or different, and the third may be the same as the first preset direction and the second preset direction, respectively, or may be different. The specific details are not included. The third preset step length may be the same as the first preset step length and the second preset step length, or may be different. The embodiment of the present application does not make any specific limitations.
[0136] In summary, the embodiments of the present application have the following beneficial effects:
[0137] 1. The focusing algorithm method reduces the cost of the focusing system and improves the efficiency of focusing work to a certain extent;
[0138] 2. Compared with the control methods in related technologies, it avoids the cost pressure brought by the traditional servo motor's fully closed-loop control system and adopts a unique stepper motor open-loop control method to achieve high-speed automatic focusing;
[0139] 3. The focusing algorithm based on the micro-stepping of the stepper motor improves the high-speed focusing performance of the optical and mechanical system of the sequencer, improves work efficiency, reduces time waste, and takes into account the needs of practicality and system stability. The entire focusing system has a wider range of applications. This focusing algorithm can avoid falling into the local optimal solution, and at the same time can eliminate the influence of uncontrollable errors such as the movement of the imaging platform of high-content equipment, the changing structure between the chip and the fixed position, and the working environment, making the entire focusing system more accurate.
[0140] As an extension of the above embodiment, after determining that the focus is completed, the method further includes: obtaining a focus parameter, and confirming the position information of successful focus according to the focus parameter; sending a capture instruction carrying the position information of successful focus to the image acquisition device, so that the image acquisition device captures the target image according to the position information of successful focus. Real-time follow-up of the focus signal meets the image acquisition position requirements.
[0141] Corresponding to the above-mentioned focusing method based on stepping mode, the present invention also proposes a focusing device based on stepping mode. Since the device embodiment of the present invention corresponds to the above-mentioned method embodiment, the details not disclosed in the device embodiment can be referred to the above-mentioned method embodiment, and will not be repeated in the present invention.
[0142] Figure 5 A schematic diagram of a focusing device based on a step-by-step method provided in an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, including:
[0143] The first acquisition unit 31 is used to control the image acquisition device to move a preset distance and acquire an optical path intensity conversion signal of the image;
[0144] The control unit 32 is used to control the image acquisition device to move a first preset step along a preset movement strategy when it is determined that the optical path intensity conversion signal is less than a preset optical path intensity conversion signal threshold, until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction;
[0145] A second acquisition unit 33, used to acquire a depth of field value of a lens of the image acquisition device;
[0146] The determination unit 34 is configured to determine that the focusing is completed if it is determined that the depth of field value does not exceed a limit value of a preset depth of field range.
[0147] The focusing device based on the stepping method provided in the embodiment of the present application controls the image acquisition device to move a preset distance, and then obtains the optical path intensity conversion signal of the image imaging; when it is determined that the optical path intensity conversion signal is less than the preset optical path intensity conversion signal threshold, the image acquisition device is controlled to move a first preset step length along the preset movement strategy until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction; the depth of field value of the lens of the image acquisition device is obtained, and when it is determined that the depth of field value does not exceed the limit value of the preset depth of field range, it is determined that the focusing is completed. The embodiment of the present application is based on the focusing algorithm of the micro-step of the stepping motor, which improves the high-speed focusing performance of the optical-mechanical system of the sequencer. This focusing algorithm can avoid falling into the local optimal solution, and at the same time can eliminate the influence of uncontrollable errors such as the movement of the imaging platform of the high-content equipment, the changing structure between the chip and the fixed position, and the working environment, so that the accuracy of the entire focusing system is higher.
[0148] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the second acquisition unit 33 is further used to acquire the depth of field value when it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold.
[0149] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the control unit 32 is also used for:
[0150] Controlling the image acquisition device to move a first preset step along a first preset direction; wherein the preset movement strategy includes moving a first preset step along the first preset direction, wherein the first preset direction is determined in a random manner or in a preset manner;
[0151] Determine whether the difference between the optical path intensity conversion signal after moving the first preset step length and the preset optical path intensity conversion signal threshold value becomes smaller;
[0152] If it is determined that the difference becomes smaller, continue to move the first preset step along the first preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold;
[0153] If it is determined that the difference value becomes larger, move the second preset step length along the second preset direction, wherein the preset movement strategy includes moving the second preset step length along the second preset direction, and the first preset direction is opposite to the second preset direction;
[0154] Determine whether the difference between the optical path intensity conversion signal after moving the second preset step length and the preset optical path intensity conversion signal threshold value becomes smaller;
[0155] If it is determined that the difference becomes smaller, continue to move the second preset step length along the second preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold.
[0156] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the device also includes:
[0157] A pause unit 35, configured to pause controlling the movement of the image acquisition device when it is determined that the depth of field value exceeds a limit value of the preset depth of field range;
[0158] The output unit 36 is used to output error prompt information.
[0159] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the determining unit 34 also includes:
[0160] A first judging module 341 is used to judge whether the depth of field value is less than a lower limit value of a first preset range, where the first preset range is a normal focal plane range corresponding to a focal plane dead zone of the image imaging;
[0161] A second judgment module 342 is used to judge whether the depth of field value is greater than or equal to the upper limit value of the first preset range if it is determined that the depth of field value is greater than or equal to the lower limit value of the first preset range;
[0162] The determination module 343 is configured to determine that the focusing is completed if it is determined that the depth of field value is less than an upper limit of the first preset range.
[0163] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the determining unit 34 also includes:
[0164] A third judgment module 344 is used to judge whether the depth of field value is less than the lower limit value of a second preset range if it is determined that the depth of field value is less than the lower limit value of the first preset range, wherein the second preset range is a user-defined limit value that can exceed the first preset range;
[0165] The control module 345 is used to control the image acquisition device to move a third preset step along a third preset direction if it is determined that the depth of field value is greater than or equal to the lower limit of the second preset range, wherein the movement in the third direction can be determined randomly or by a preset method.
[0166] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the pause unit is further used to pause controlling the movement of the image acquisition device if it is determined that the depth of field value is less than a lower limit value of the second preset range.
[0167] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the determining unit 34 also includes:
[0168] A fourth determination module 346 is configured to determine whether the depth of field value is greater than the upper limit value of the second preset range if it is determined that the depth of field value is greater than or equal to the upper limit value of the first preset range;
[0169] The control module 345 is configured to control the image acquisition device to move in a third preset direction in a fourth preset step if it is determined that the depth of field value is less than an upper limit of the second preset range.
[0170] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the pause unit 35 is further used to pause the control of the movement of the image acquisition device if it is determined that the depth of field value is greater than or equal to the upper limit value of the second preset range.
[0171] Furthermore, in a possible implementation of this embodiment, as Figure 6 As shown, the device also includes:
[0172] A confirmation unit 37, configured to obtain focus parameters after the determination unit determines that the focus is completed, and confirm the position information of the successful focus according to the focus parameters;
[0173] The sending unit 38 is used to send a capture instruction carrying the focus successful position information to the image capture device, so that the image capture device captures the target image according to the focus successful position information.
[0174] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment, and the principle is the same, which is not limited in this embodiment.
[0175] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0176] Figure 7 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0177] like Figure 7 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 402 or a computer program loaded from a storage unit 408 to a RAM (Random Access Memory) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An I / O (Input / Output) interface 405 is also connected to the bus 404.
[0178] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0179] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as a step-by-step focusing method. For example, in some embodiments, the step-by-step focusing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute the aforementioned step-based focusing method in any other appropriate manner (for example, by means of firmware).
[0180] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0181] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0182] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0183] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0184] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0185] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0186] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0187] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0188] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A focusing method based on a stepping mode, characterized in that: include: After controlling the image acquisition device to move a preset distance, an optical path intensity conversion signal of the image is obtained; When it is determined that the optical path intensity conversion signal is less than a preset optical path intensity conversion signal threshold, the image acquisition device is controlled to move a first preset step length along a preset movement strategy until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction; A depth of field value of a lens of the image acquisition device is obtained, and when it is determined that the depth of field value does not exceed a limit value of a preset depth of field range, it is determined that focusing is completed.
2. The method according to claim 1, characterized in that The obtaining of the depth of field value of the lens of the image acquisition device comprises: In a case where it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold, the depth of field value is acquired.
3. The method according to claim 1, characterized in that The controlling the image acquisition device to move a first preset step length along a preset movement strategy comprises: Controlling the image acquisition device to move a first preset step along a first preset direction; wherein the preset movement strategy includes moving a first preset step along the first preset direction, wherein the first preset direction is determined in a random manner or in a preset manner; Determine whether the difference between the optical path intensity conversion signal after moving the first preset step length and the preset optical path intensity conversion signal threshold value becomes smaller; If it is determined that the difference becomes smaller, continue to move the first preset step length along the first preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; If it is determined that the difference value becomes larger, move a second preset step length along a second preset direction, wherein the preset movement strategy includes moving a second preset step length along the second preset direction, and the first preset direction is opposite to the second preset direction; Determine whether the difference between the optical path intensity conversion signal after moving the second preset step length and the preset optical path intensity conversion signal threshold value becomes smaller; If it is determined that the difference becomes smaller, continue to move the second preset step length along the second preset direction until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold.
4. The method according to claim 1, characterized in that: The method further comprises: When it is determined that the depth of field value exceeds the limit value of the preset depth of field range, the control of the movement of the image acquisition device is suspended and an error prompt message is output.
5. The method according to claim 4, characterized in that When determining that the depth of field value does not exceed a limit value of a preset depth of field range, determining that the focusing is completed includes: Determine whether the depth of field value is less than a lower limit value of a first preset range, where the first preset range is a normal focal plane range corresponding to a dead zone of an image focal plane of the image imaging; If it is determined that the depth of field value is greater than or equal to the lower limit value of the first preset range, determining whether the depth of field value is greater than or equal to the upper limit value of the first preset range; If it is determined that the depth of field value is less than the upper limit value of the first preset range, it is determined that the focusing is completed.
6. The method according to claim 5, characterized in that The method further comprises: If it is determined that the depth of field value is less than the lower limit value of the first preset range, then determining whether the depth of field value is less than the lower limit value of a second preset range, where the second preset range is a user-defined limit value that can exceed the first preset range; If it is determined that the depth of field value is greater than or equal to the lower limit value of the second preset range, the image acquisition device is controlled to move along a third preset direction by a third preset step, wherein the movement in the third direction can be determined randomly or by a preset method.
7. The method according to claim 6, characterized in that The pausing control of the movement of the image acquisition device comprises: If it is determined that the depth of field value is less than the lower limit value of the second preset range, the control of the movement of the image acquisition device is suspended.
8. The method according to claim 5, characterized in that The method further comprises: If it is determined that the depth of field value is greater than or equal to the upper limit value of the first preset range, determining whether the depth of field value is greater than the upper limit value of the second preset range; If it is determined that the depth of field value is less than the upper limit value of the second preset range, the image acquisition device is controlled to move in a third preset direction in a fourth preset step length.
9. The method according to claim 8, characterized in that The pausing control of the movement of the image acquisition device comprises: If it is determined that the depth of field value is greater than or equal to the upper limit value of the second preset range, the control of the movement of the image acquisition device is suspended.
10. The method according to any one of claims 1 to 9, characterized in that After determining that the focusing is completed, the method further includes: Acquiring focus parameters, and confirming the position information of successful focus according to the focus parameters; A capture instruction carrying the position information of successful focusing is sent to the image capture device, so that the image capture device captures the target image according to the position information of successful focusing.
11. A focusing device based on a stepping method, characterized in that: include: A first acquisition unit, used to control the image acquisition device to move a preset distance and acquire an optical path intensity conversion signal of the image; A control unit, configured to control the image acquisition device to move a first preset step along a preset movement strategy when it is determined that the optical path intensity conversion signal is less than a preset optical path intensity conversion signal threshold, until it is determined that the optical path intensity conversion signal is greater than or equal to the preset optical path intensity conversion signal threshold; the preset movement strategy includes at least one preset direction; A second acquisition unit, used to acquire a depth of field value of a lens of the image acquisition device; The determination unit is used to determine that the focusing is completed when it is determined that the depth of field value does not exceed a limit value of a preset depth of field range.
12. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-10.
14. A computer program product, characterized in that A computer program is included which, when executed by a processor, implements the method according to any one of claims 1 to 10.