Focusing method, imaging system and sequencing equipment
By using image quality indicators to adjust the movement of the objective lens in optical imaging technology, combined with Gaussian filtering, the problems of low focus efficiency and great impact of fluorescence quenching in optical imaging technology are solved, and a fast and accurate focusing process is achieved, which improves gene sequencing. Efficiency and imaging quality.
Patent Information
- Application Number
- CN202411198717.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-06
AI Technical Summary
The existing optical imaging technology has low efficiency and great impact on fluorescence quenching during the focus process during gene sequencing, making it difficult to quickly and accurately achieve focus, especially when focusing on the first field of view within a large range.
Images are collected through the objective lens and image quality indicators are obtained. The objective lens is controlled to move relative to the sample. The step length and direction are adjusted according to the image quality indicators until the focus end condition is reached. Gaussian filtering is used to reduce the local extreme value influence, and achieve fast and accurate focus.
It improves the speed and accuracy of focus, reduces the impact of fluorescence quenching, ensures that the objective lens is approaching the optimal focal plane position, and enhances the efficiency and accuracy of the imaging system.
Smart Images

Figure CN119087616A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optical imaging technology, and in particular to a focusing method, an imaging system and a sequencing device. Background Art
[0002] In the gene sequencing process based on the principle of optical imaging, a base extension reaction is usually performed on the sequencing chip first, and the reaction area on the sequencing chip is imaged after base extension. Since the base has been fluorescently labeled, the type of base can be determined by analyzing the signal of the image, thereby achieving sequencing.
[0003] Accurate focusing is the prerequisite for good imaging. Through focusing, a clear image can be obtained through the objective lens in the subsequent imaging process. In order to improve efficiency and reduce the impact of fluorescence quenching, it is usually hoped that the focusing can be completed quickly. For example, for the first field of view (FOV) of the reaction area, accurate focusing needs to be achieved within a larger range, and it is hoped that the focusing will be faster to reduce the impact of fluorescence quenching. After the first field of view is focused, other fields of view can be quickly focused through the autofocus module of the sequencing platform or device. Therefore, how to achieve fast and accurate focusing is a problem worthy of attention. Summary of the invention
[0004] In order to quickly and accurately complete focusing, the present application provides a focusing method, an imaging system and a sequencing device.
[0005] According to the first aspect, an embodiment provides a focusing method, including:
[0006] capturing an image through an objective lens and obtaining an image quality index of the image, wherein the objective lens is in a preliminary focusing position relative to the sample;
[0007] The objective lens and the sample are controlled to move relative to each other, so that the objective lens moves relative to the sample from the preliminary focusing position with a first step length in a preset direction. Each time a position is reached, an image is captured by the objective lens and an image quality index of the image is obtained. The image quality index of the image captured at the current position is compared with the image quality index of the image captured at the previous position. If the image quality index of the image captured at the current position is smaller than the image quality index of the image captured at the previous position, the step length is reduced, and the direction of relative movement between the objective lens and the sample is opposite to the direction of relative movement in the previous step, so as to continue the next relative movement. Otherwise, the step length and the direction of relative movement between the objective lens and the sample are not changed, so as to continue the next relative movement, until the focusing end condition is reached, the relative movement between the objective lens and the sample is stopped, and the focusing of the objective lens is completed.
[0008] In some embodiments, obtaining an image quality indicator of an image includes:
[0009] Performing smoothing filtering on the image, and calculating an image quality index of the image after smoothing filtering;
[0010] Alternatively, a smoothing filter is performed on the region of interest in the image, and an image quality index of the region of interest after the smoothing filter is calculated as the image quality index of the image.
[0011] In some embodiments, the smoothing filter is a Gaussian filter.
[0012] In some embodiments, the focusing end condition is: the number of changes in the direction of relative motion between the objective lens and the sample reaches a preset reversal number threshold.
[0013] In some embodiments, the preliminary focus position is obtained by:
[0014] Controlling the objective lens and the sample to perform relative movement to perform coarse focusing on the objective lens and obtain a coarse focusing position;
[0015] The preliminary focus position is determined based on the coarse focus position.
[0016] In some embodiments, controlling the objective lens and the sample to perform relative movement to perform coarse focusing on the objective lens and obtaining a coarse focusing position includes:
[0017] Controlling the objective lens and the sample to move relative to each other, so that the objective lens moves relative to the sample from one end point of the first position range to another end point of the first position range in a step-by-step manner with a second step length, and at each position, collecting an image through the objective lens and obtaining an image quality index of the image; wherein the second step length is greater than or equal to the first step length;
[0018] The image quality indicators of the images collected at various positions are compared, and the position corresponding to the image with the largest image quality indicator is selected as the coarse focus position.
[0019] In some embodiments, the image quality indicator is clarity.
[0020] In some embodiments, determining the preliminary focus position based on the coarse focus position includes:
[0021] Taking a position moved d3 μm away from the sample on the basis of the coarse focus position as the preliminary focus position, and the preset direction is a direction toward the sample, wherein d3 is a preset third position offset;
[0022] Alternatively, a position moved d3 μm toward the sample based on the coarse focus position is taken as the preliminary focus position, and the preset direction is a direction away from the sample.
[0023] According to a second aspect, an embodiment provides an imaging system, including an objective lens, an image sensor, a driving module and a controller;
[0024] The controller is used to:
[0025] Using the image sensor to collect an image through the objective lens, and obtaining an image quality index of the image, wherein the objective lens is in a preliminary focusing position relative to the sample;
[0026] The driving module is controlled to operate so that the objective lens and the sample perform relative movement, so that the objective lens moves relative to the sample from the preliminary focusing position in a preset direction with a first step length. Each time a position is reached, the image sensor is used to capture an image through the objective lens and obtain an image quality index of the image. The image quality index of the image captured at the current position is compared with the image quality index of the image captured at the previous position. If the image quality index of the image captured at the current position is smaller than the image quality index of the image captured at the previous position, the step length is reduced, and the direction of relative movement between the objective lens and the sample is opposite to the direction of relative movement in the previous step. The driving module is controlled to operate to continue the next relative movement. Otherwise, the step length and the direction of relative movement between the objective lens and the sample are not changed. The driving module is controlled to operate to continue the next relative movement until the focusing end condition is reached, the relative movement between the objective lens and the sample is stopped, and the focusing of the objective lens is completed.
[0027] According to the third aspect, an embodiment provides a sequencing device, comprising the imaging system as described in the second aspect above.
[0028] According to the focusing method, imaging system and sequencing device of the above embodiment, the objective lens is moved relative to the sample in a preset direction from the preliminary focusing position with a first step length. Each time a position is reached, an image is captured by the objective lens and an image quality index of the image is obtained. The image quality index of the image captured at the current position is compared with the image quality index of the image captured at the previous position. If the image quality index of the image captured at the current position is less than the image quality index of the image captured at the previous position, it means that the optimal focal plane position has been exceeded, so the step length is reduced, and the direction of relative movement between the objective lens and the sample is opposite to the direction of relative movement in the previous step, and the next step of relative movement is continued. Otherwise, the step length and the direction of relative movement between the objective lens and the sample are not changed, and the next step of relative movement is continued until the focusing end condition is reached and the focusing is completed. In this way, the direction and step length of the relative movement between the objective lens and the sample can be adaptively adjusted to ensure that the objective lens continuously approaches the optimal focal plane position and achieves focusing quickly and accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a schematic diagram of a curve of the measured Brenner value varying with the position of the objective lens in some embodiments;
[0030] Figure 2 is a schematic structural diagram of an imaging system according to an embodiment;
[0031] Figure 3 is a schematic diagram of the positions of an objective lens, a sample and a stage in one embodiment;
[0032] Figure 4 It is a schematic diagram of a curve of the Brenner value measured without filtering, three-point mean filtering and Gaussian filtering as the objective lens position changes in an embodiment;
[0033] Figure 5 is a schematic diagram of curves of Brenner values measured without filtering, with three-point mean filtering, and with Gaussian filtering as a function of the position of the objective lens in another embodiment;
[0034] Figure 6 The figure is a flow chart of a focusing method according to an embodiment. DETAILED DESCRIPTION
[0035] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.
[0036] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.
[0037] The serial numbers assigned to the components herein, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings). The "sequencing" and "sequencing" referred to herein are the same as nucleic acid sequencing, including DNA sequencing and / or RNA sequencing.
[0038] In the prior art, a hill climbing algorithm is usually used when focusing an objective lens. The main steps of this algorithm include:
[0039] (1) within a first set range, gradually move with a set step length, take a picture of the object at each position, and find a first optimal position according to image quality indicators, etc.;
[0040] (2) within a second setting range including the first optimal position, performing the same process as step (1) with a smaller step size to further find a second optimal position, wherein the second setting range is smaller than the first setting range;
[0041] (3) Further reduce the range and step size and repeat the above step (2) until the accuracy requirement is met.
[0042] This method has no directional information, resulting in too many focusing times. In addition, the condition for stopping iteration in some methods is to determine whether the image quality index reaches a set threshold, or whether the change in the image quality index is less than a set threshold. However, due to factors such as differences in optical paths on different platforms, the threshold is difficult to determine.
[0043] In some other existing technologies, the step size is adjusted by the degree of change of the image quality index. If the image quality index of the image taken at the current position is not significantly different from that of the image taken at the previous position, the step size is increased to speed up the search; if the change is obvious, the step size is reduced.
[0044] This method also needs to pre-set a change threshold when judging the degree of change in the image quality index. The image quality index of the image taken at the current position is subtracted from the image quality index of the image taken at the previous position, and the obtained difference or the absolute value of the difference is compared with the change threshold to determine whether there is a significant change. The threshold is also difficult to determine.
[0045] In addition, the applicant found in practice that this method is easily affected by local extreme values. Figure 1 The applicant uses the Brenner function as the evaluation function of the image quality index. The curves of the Brenner value measured on two different devices and the change of the objective lens position are as follows: Figure 1 As shown in the figure, it can be seen that the Brenner value curve is not an ideal single-peak curve, but has local extreme values. When the above method is used for focusing, the position finally searched is often the position corresponding to the local extreme value, rather than the position with the largest Brenner value, which can easily lead to focusing failure.
[0046] In order to solve at least one of the technical problems existing in the prior art, the present application provides an imaging system and a focusing method. The imaging system of the present application is first described below. Please refer to Figure 2 In some embodiments, the imaging system includes an objective lens 1, an image sensor 2, a driving module 3 and a controller 4.
[0047] The image sensor 2 is used to image the object under test through the objective lens 1, and the image sensor 2 can be a CMOS sensor or a CCD sensor.
[0048] The driving module 3 is used to drive the objective lens 1 and / or the sample to move, so that the objective lens 1 and the sample move relative to each other. In some embodiments, the driving module 3 is used to drive the objective lens 1 to move along its optical axis, for example, in a vertical direction, so that the distance between the objective lens 1 and the sample can be adjusted to achieve the focusing of the objective lens 1 on the sample. In some embodiments, the driving module 3 can drive the sample to move, for example Figure 3As shown, the imaging system in some embodiments further includes a stage 5, on which the sample is carried, and the driving module 3 is used to drive the stage 5 to move, for example, in a vertical direction, so as to adjust the distance between the objective lens 1 and the sample. The driving module 3 can drive the objective lens 1 and / or the sample to move by means of a servo motor, a stepping motor, a linear module, etc. The sample is a sequencing chip or a flow cell, etc., which contains a test object such as a nucleic acid molecule.
[0049] The controller 4 is used to control the objective lens 1, the image sensor 2, the drive module 3 and the stage 5 to achieve focusing and imaging of the sample. In a specific embodiment, the controller 4 can be a digital signal processor (Digital Signal Processor, referred to as: DSP), an application specific integrated circuit (Application Specific Integrated Circuit, referred to as: ASIC), a field programmable gate array (Field Programmable Gate Array, referred to as: FPGA), etc., and can also be other general controllers such as a single-chip microcomputer.
[0050] In the embodiment of the present invention, the controller 4 is used to: use the image sensor 2 to capture an image through the objective lens 1, and obtain an image quality index of the image, wherein the objective lens 1 is in a preliminary focusing position relative to the sample; control the drive module 3 to work, so that the objective lens 1 and the sample move relative to each other, so that the objective lens 1 moves relative to the sample from the preliminary focusing position in a preset direction with a first step length, and each time a position is reached, the image sensor 2 is used to capture an image through the objective lens 1 and obtain an image quality index of the image, and the image quality index of the image captured at the current position is compared with the image quality index of the image captured at the previous position. If the image quality index of the image captured at the current position is less than the image quality index of the image captured at the previous position, the step length is reduced, and the direction of relative movement between the objective lens 1 and the sample is opposite to the direction of relative movement in the previous step, and the drive module 3 is controlled to work to continue the next step of relative movement, otherwise the step length and the direction of relative movement between the objective lens 1 and the sample are not changed, and the drive module 3 is controlled to work to continue the next step of relative movement until the focusing end condition is reached, the relative movement between the objective lens 1 and the sample is stopped, and the focusing of the objective lens 1 is completed.
[0051] Among them, the objective lens 1 is in a preliminary focusing position relative to the sample, which means that the sample is used as a reference for the movement of the objective lens 1, and the objective lens 1 is in a preliminary focusing position. Specifically, the objective lens 1 can be roughly focused on the sample by manual focus or automatic focus to obtain a preliminary focusing position, or the focusing position of the previous chip can be used as the preliminary focusing position. This embodiment does not limit the preliminary focusing position. In some embodiments, an engineering chip can be used for focus debugging to obtain a preliminary focusing position. It can be understood that due to factors such as chip differences, loading differences, and optical path changes, the optimal focal plane when using actual chip sequencing may have a certain deviation from the focal plane of the engineering chip, and further adjustment is required.
[0052] The objective lens 1 and the sample can be moved relative to each other by moving the objective lens 1 closer to or farther from the sample, or by moving the sample closer to or farther from the objective lens 1 , or by moving the objective lens 1 and the sample simultaneously to adjust the distance between the objective lens 1 and the sample.
[0053] The preset direction of movement of the objective lens 1 relative to the sample can be a direction toward the sample or a direction away from the sample, which can be set according to specific circumstances. Taking the direction toward the sample as an example, the objective lens 1 can move closer to the sample, or the sample can move closer to the objective lens 1, or the objective lens 1 and the sample can move toward each other. The first step length can be set according to experience and specific circumstances.
[0054] Image quality indicators can be signal-to-noise ratio, clarity, etc. Among them, clarity can be measured by grayscale gradient function Brenner, half-height width, contrast, etc.
[0055] Specifically, the objective lens 1 is first moved to a preliminary focusing position relative to the sample, and the controller 4 uses the image sensor 2 to capture an image of the object under test through the objective lens 1, obtains an image at the preliminary focusing position, and obtains an image quality index of the image. Afterwards, the controller 4 controls the driving module 3 to work, so that the objective lens 1 moves relative to the sample from the preliminary focusing position with the first step length in a preset direction to the next position. The controller 4 uses the image sensor 2 to collect an image of the object under test through the objective lens 1 to obtain an image collected at the current position, and compares the image quality index of the image collected at the current position with the image quality index of the image collected at the previous position (the previous position is the preliminary focusing position at this time). If the image quality index of the image collected at the current position is smaller than the image quality index of the image collected at the previous position, the step length is reduced (for example, reduced to 1 / 2 of the original step length), and the direction of relative movement between the objective lens 1 and the sample is opposite to the direction of relative movement in the previous step (for example, if the original direction is toward the objective lens 1, it is changed to the direction away from the objective lens 1), the driving module 3 is controlled to work, and the objective lens 1 and the sample are continued to be driven to perform the next relative movement according to the new step length and direction. Otherwise, the step length and the direction of relative movement between the objective lens 1 and the sample are not changed, and the driving module 3 is controlled to work, and the objective lens 1 and the sample are continued to be driven to perform the next relative movement according to the original step length and direction. This is repeated until the focusing end condition is reached and the focusing of the objective lens 1 is completed. It should be noted that the amplitude of each step reduction can be the same or different. For example, the first n times the step size is reduced, the new step size is reduced to 1 / 2 of the original step size. When the step size is reduced subsequently, it can still be reduced to 1 / 2 of the original step size, or the amplitude of the reduction can be increased, and the new step size can be reduced to 1 / 3 of the original step size, etc., where n is an integer greater than 1.
[0056] In some embodiments, the focusing end condition is: the number of changes in the direction of relative motion between the objective lens 1 and the sample reaches a preset reversal number threshold. The reversal number threshold can be set according to the requirements of focusing accuracy and focusing time. In one embodiment, the reversal number threshold is 3. In this embodiment, the number of reversals is used as an indicator for completing focusing, which avoids the problem that the threshold of the image quality indicator is difficult to determine when the threshold of the image quality indicator is used as an indicator for completing focusing.
[0057] The imaging system of the above embodiment controls the objective lens to move relative to the sample in a preset direction starting from the preliminary focusing position with a first step length. Each time a position is reached, the image quality index of the image collected at the current position is compared with the image quality index of the image collected at the previous position. If the image quality index of the image collected at the current position is smaller than the image quality index of the image collected at the previous position, it means that the optimal focal plane position has been exceeded, so the step length is reduced, and the direction of relative movement between the objective lens and the sample is opposite to the direction of relative movement in the previous step, and the next relative movement is continued. Otherwise, the step length and the direction of relative movement between the objective lens and the sample are not changed, and the next relative movement is continued until the focusing end condition is reached, thereby being able to adaptively adjust the direction and step length of the relative movement between the objective lens and the sample to ensure that the objective lens continuously approaches the optimal focal plane position and achieves focusing quickly and accurately.
[0058] In some embodiments, the controller 4 acquires the image quality index of the image including: smoothing the image and calculating the image quality index of the image after smoothing. In some embodiments, the entire image may not be smoothed, but only the designated region of interest may be smoothed and the image quality index may be calculated to reduce the amount of calculation and improve the calculation speed. In this case, the controller 4 acquires the image quality index of the image including: smoothing the region of interest in the image and calculating the image quality index of the region of interest after smoothing as the image quality index of the image.
[0059] The applicant has found that smoothing the image can help reduce or eliminate the jump of the image quality index, thereby avoiding the influence of the local extreme value of the image quality index. The smoothing filter can be a median filter, a mean filter, a Gaussian filter, etc. The optimal filtering method can be determined according to the device used, and the filtering parameters (such as the size of the filter kernel, the variance of the Gaussian filter, etc.) can be determined according to the requirements of the focusing accuracy and focusing time.
[0060] The applicant used the Brenner function as the evaluation function of the image quality index to conduct actual tests, and the results are as follows: Figure 4 and Figure 5 As shown, Figure 4 and Figure 5 The following is a graph showing the change of Brenner value with objective lens position measured on different sequencing devices. It can be seen that after smoothing filtering, the local jump of Brenner value is greatly reduced, and Gaussian filtering is better than three-point mean filtering. The local jump of Brenner value is almost eliminated, and there is no local extreme value, thereby improving the accuracy and efficiency of focusing.
[0061] In some embodiments, the controller 4 determines the preliminary focusing position in the following manner: the controller 4 controls the objective lens 1 and the sample to perform relative movement to perform coarse focusing on the objective lens 1 and obtain a coarse focusing position; and determines the preliminary focusing position based on the coarse focusing position.
[0062] Specifically, the controller 4 controls the objective lens 1 and the sample to perform relative movement to perform coarse focusing on the objective lens 1, and obtaining the coarse focusing position may include: the controller 4 controls the objective lens 1 and the sample to perform relative movement, so that the objective lens 1 moves gradually from one end point of the first position range to another end point of the first position range relative to the sample with a second step length, and at each position, an image is captured by the objective lens 1 and an image quality index of the image is obtained; the image quality indexes of the images captured at each position are compared, and the position corresponding to the image with the largest image quality index is selected as the coarse focusing position. Wherein, the second step length is greater than or equal to the first step length.
[0063] The first position range can be a larger range. The first position range and the second step size can be set based on experience and specific circumstances. In some embodiments, assuming that Z0+d1 is greater than Z0-d1, the first position range can be [Z0-d1μm, Z0+d1μm], where Z0 is a preset position, which can be an approximate position adjusted manually or a position obtained by focusing with an engineering chip; d1 is a preset first position offset.
[0064] In some embodiments, the controller 4 determines the preliminary focus position based on the coarse focus position, including: taking the position moved d3 μm away from the sample on the basis of the coarse focus position as the preliminary focus position, and the preset direction of the first step of the movement of the objective lens 1 relative to the sample from the preliminary focus position in a preset direction as the direction toward the sample; or taking the position moved d3 μm toward the sample on the basis of the coarse focus position as the preliminary focus position, and the preset direction is the direction away from the sample. Wherein d3 is a preset third position offset, which can be determined according to experience and specific circumstances.
[0065] In some embodiments, the preliminary focus position is a position within the second position range including the coarse focus position. Assuming that Z1+d2 is greater than Z1-d2, the second position range may be [Z1-d2μm, Z1+d2μm], where Z1 is the coarse focus position, d2 is a preset second position offset and d2 is greater than d3, and d2 may be determined based on experience and specific circumstances.
[0066] In the above embodiment, coarse focusing is first performed, and a preliminary focusing position is determined based on the coarse focusing position, and then further focusing is performed based on the preliminary focusing position. The two-stage focusing from coarse to fine improves the accuracy of focusing. The coarse focusing position may be the position corresponding to the image with the largest image quality index. The coarse focusing position is determined by finding the maximum value of the image quality index in this way, thereby avoiding the influence of local extreme values.
[0067] Of course, the preliminary focus position can also be determined in other ways. For example, in one embodiment, the imaging system also includes an autofocus module, and the light beam reflected by the sample is received by the autofocus module after passing through the objective lens, and the autofocus module can measure the light intensity of the received light beam. The controller 4 controls the objective lens 1 and the sample to move relative to each other, so that the objective lens 1 moves step by step from one end point of the first position range relative to the sample with a second step length, and each time a position is reached, the light intensity measured by the autofocus module is obtained, and if the light intensity measured by the autofocus module is greater than or equal to a preset light intensity threshold, the movement is stopped, and the current position is used as the coarse focus position, and the preliminary focus position is determined based on the coarse focus position, otherwise the next step of relative movement is continued until the objective lens 1 reaches the other end point of the first position range relative to the sample.
[0068] Some embodiments of the present invention further provide a sequencing device, which includes the above-mentioned imaging system.
[0069] Some embodiments of the present invention provide a focusing method, which can be used in imaging scenarios such as nucleic acid sequencing, cell film reading, and pathological film reading. Figure 6 , the focusing method in some embodiments comprises the following steps:
[0070] Step 100: collecting an image through an objective lens and obtaining an image quality index of the image, wherein the objective lens is in a preliminary focusing position relative to the sample;
[0071] Step 200: Control the objective lens and the sample to perform relative movement, so that the objective lens moves relative to the sample from the initial focusing position in a preset direction with a first step length. Each time a position is reached, an image is captured by the objective lens and an image quality index of the image is obtained. The image quality index of the image captured at the current position is compared with the image quality index of the image captured at the previous position. If the image quality index of the image captured at the current position is smaller than the image quality index of the image captured at the previous position, the step length is reduced, and the direction of relative movement between the objective lens and the sample is opposite to the direction of relative movement in the previous step, so as to continue the next relative movement. Otherwise, the step length and the direction of relative movement between the objective lens and the sample are not changed, so as to continue the next relative movement, until the focusing end condition is reached, the relative movement between the objective lens and the sample is stopped, and the focusing of the objective lens is completed.
[0072] In some embodiments, the focusing end condition is: the number of changes in the direction of relative motion between the objective lens and the sample reaches a preset reversal number threshold.
[0073] The focusing method of the above embodiment controls the objective lens to move relative to the sample in a preset direction starting from the preliminary focusing position with a first step length. Each time a position is reached, the image quality index of the image collected at the current position is compared with the image quality index of the image collected at the previous position. If the image quality index of the image collected at the current position is smaller than the image quality index of the image collected at the previous position, it means that the optimal focal plane position has been exceeded, so the step length is reduced so that the direction of relative movement between the objective lens and the sample is opposite to the direction of relative movement in the previous step, and the next relative movement is continued. Otherwise, the step length and the direction of relative movement between the objective lens and the sample are not changed, and the next relative movement is continued until the focusing end condition is reached, thereby being able to adaptively adjust the direction and step length of the relative movement between the objective lens and the sample to ensure that the objective lens continuously approaches the optimal focal plane position and achieves focusing quickly and accurately.
[0074] In some embodiments, obtaining the image quality index of an image includes: performing smooth filtering on the image and calculating the image quality index of the image after smooth filtering; or, performing smooth filtering on a region of interest in the image and calculating the image quality index of the region of interest after smooth filtering as the image quality index of the image.
[0075] In some embodiments, the smoothing filter is a Gaussian filter.
[0076] The focusing method of the above embodiment, by smoothing and filtering the collected image, is conducive to reducing or eliminating the jump of the image quality index, thereby avoiding the influence of the local extreme value of the image quality index and improving the focusing accuracy.
[0077] In some embodiments, the preliminary focus position is obtained by: controlling the objective lens and the sample to perform relative movement to perform coarse focus on the objective lens and obtain a coarse focus position; and determining the preliminary focus position based on the coarse focus position.
[0078] In some embodiments, controlling the objective lens and the sample to perform relative movement to perform coarse focusing on the objective lens and obtaining a coarse focusing position includes:
[0079] The objective lens and the sample are controlled to move relative to each other, so that the objective lens moves gradually from one end point of the first position range to the other end point of the first position range relative to the sample with a second step length, and at each position, an image is captured by the objective lens and an image quality index of the image is obtained; wherein the second step length is greater than or equal to the first step length; the image quality indexes of the images captured at various positions are compared, and the position corresponding to the image with the largest image quality index is selected as the coarse focus position.
[0080] In some embodiments, the preliminary focus position is determined based on the coarse focus position, including: taking a position moved d3 μm away from the sample on the basis of the coarse focus position as the preliminary focus position, and the preset direction is the direction toward the sample, wherein d3 is a preset third position offset; or, taking a position moved d3 μm toward the sample on the basis of the coarse focus position as the preliminary focus position, and the preset direction is the direction away from the sample.
[0081] The focusing method of the above embodiment first performs coarse focusing, determines a preliminary focusing position based on the coarse focusing position, and then further performs focusing based on the preliminary focusing position. The two-stage focusing from coarse to fine improves the focusing accuracy. The coarse focusing position may be the position corresponding to the image with the largest image quality index. The coarse focusing position is determined by finding the maximum value of the image quality index in this way, thereby avoiding the influence of local extreme values.
[0082] For the specific implementation of the focusing method, please refer to the relevant implementation of the imaging system above, which will not be repeated here. In order to better understand the focusing method of the present application, a specific embodiment is introduced below. In this embodiment, focusing is completed in two stages. In the first stage, coarse focusing is completed within the first position range, and the position with the largest image quality index is found as the rough optimal position of the objective lens. In the second stage, based on the position determined in the first stage, combined with Gaussian filtering, further focusing is performed to locate the final optimal position of the objective lens. Among them, the image quality index adopts clarity, and specifically adopts the Brenner function as the clarity evaluation function.
[0083] Please refer to Figure 3 In this embodiment, the following is established: Figure 3 In the coordinate system shown, the optical axis of the objective lens 1 is the Z axis, the upward direction is the positive half axis of the Z axis, and the downward direction is the negative half axis; the upper surface of the stage 5 is the X=0 plane; the objective lens 1 can be driven by the motor to move along the Z direction, and the stage 5 is fixed. The first position range is [Z0-30μm, Z0+30μm], the second step length is L2=6μm, and the reversal number threshold is 3.
[0084] (1) First, the objective lens 1 is moved to an end point of the first position range, i.e., Z0+30 μm or Z0-30 μm, and an image is collected and the Brenner value is calculated;
[0085] (2) If the objective lens 1 is at Z0+30 μm, move the objective lens 1 downward by L2; if the objective lens 1 is at Z0-30 μm, move the objective lens 1 upward by L2; collect images and calculate the Brenner value;
[0086] (3) The objective lens 1 continues to move in step length L2, collects images and calculates the Brenner value;
[0087] (4) Repeat step (3) until the objective lens 1 reaches another end point of the first position range, and images are collected at 11 positions in total;
[0088] (5) Find the position Z1 corresponding to the maximum Brenner value among the 11 positions mentioned above, and use it as the coarse focus position Z1;
[0089] (6) Taking the position Z1+3 μm moved 3 μm away from the sample on the basis of the coarse focus position Z1 as the preliminary focus position, or taking the position Z1-3 μm moved 3 μm toward the sample on the basis of the coarse focus position Z1 as the preliminary focus position, moving the objective lens 1 to the preliminary focus position, collecting the image and performing Gaussian filtering, and then calculating the Brenner value, wherein the filter kernel size of the Gaussian filter is 7×7, and the variance is 0;
[0090] (7) Take the first step length L1 = 3 μm. If the initial focus position is Z1 + 3 μm, then move the objective lens 1 downward by L1. If the objective lens 1 is at Z1 - 3 μm, then move the objective lens 1 upward by L1.
[0091] (8) After arriving at the new position, collect the image and perform Gaussian filtering, and then calculate the Brenner value;
[0092] (9) Compare the Brenner value of the current position with the Brenner value of the previous position. If the Brenner value of the current position is smaller than the Brenner value of the previous position, the step size is reduced to 1 / 2 of the original step size, and the moving direction of the objective lens 1 is reversed, and the next step of movement is continued. Otherwise, the step size and the moving direction of the objective lens 1 are not changed, and the next step of movement is continued.
[0093] (10) Repeat steps (8) and (9) until the number of reversals is equal to 3, at which time the movement of the objective lens 1 is stopped. At this time, the position of the objective lens 1 is the optimal position.
[0094] In this embodiment, the focusing accuracy reaches within 0.35 μm, which has very high accuracy.
[0095] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.
[0096] The above specific examples are used to illustrate the present invention, which are only used to help understand the present invention and are not used to limit the present invention. For those skilled in the art to which the present invention belongs, some simple deductions, modifications or substitutions can be made according to the idea of the present invention.
Claims
1. A focusing method, characterized in that: include: capturing an image through an objective lens and obtaining an image quality index of the image, wherein the objective lens is in a preliminary focusing position relative to the sample; The objective lens and the sample are controlled to move relative to each other, so that the objective lens moves relative to the sample from the preliminary focusing position with a first step length in a preset direction. Each time a position is reached, an image is captured by the objective lens and an image quality index of the image is obtained. The image quality index of the image captured at the current position is compared with the image quality index of the image captured at the previous position. If the image quality index of the image captured at the current position is smaller than the image quality index of the image captured at the previous position, the step length is reduced, and the direction of relative movement between the objective lens and the sample is opposite to the direction of relative movement in the previous step, so as to continue the next relative movement. Otherwise, the step length and the direction of relative movement between the objective lens and the sample are not changed, so as to continue the next relative movement, until the focusing end condition is reached, the relative movement between the objective lens and the sample is stopped, and the focusing of the objective lens is completed.
2. The focusing method according to claim 1, wherein: Image quality indicators of acquired images include: Performing smoothing filtering on the image, and calculating an image quality index of the image after smoothing filtering; Alternatively, a smoothing filter is performed on the region of interest in the image, and an image quality index of the region of interest after the smoothing filter is calculated as the image quality index of the image.
3. The focusing method according to claim 2, wherein: The smoothing filter is a Gaussian filter.
4. The focusing method according to claim 1, wherein: The focusing end condition is that the number of changes in the direction of relative motion between the objective lens and the sample reaches a preset reversal number threshold.
5. The focusing method according to claim 1, wherein: The preliminary focus position is obtained by: Controlling the objective lens and the sample to perform relative movement to perform coarse focusing on the objective lens and obtain a coarse focusing position; The preliminary focus position is determined based on the coarse focus position.
6. The focusing method according to claim 5, characterized in that: The step of controlling the objective lens and the sample to perform relative movement to perform coarse focusing on the objective lens and obtain a coarse focusing position includes: Controlling the objective lens and the sample to move relative to each other, so that the objective lens moves relative to the sample from one end point of the first position range to another end point of the first position range in a step-by-step manner with a second step length, and at each position, collecting an image through the objective lens and obtaining an image quality index of the image; wherein the second step length is greater than or equal to the first step length; The image quality indicators of the images collected at various positions are compared, and the position corresponding to the image with the largest image quality indicator is selected as the coarse focus position.
7. The focusing method according to any one of claims 1 to 6, characterized in that: The image quality indicator is clarity.
8. The focusing method according to claim 6, wherein: The determining the preliminary focus position based on the coarse focus position comprises: Taking a position moved d3 μm away from the sample on the basis of the coarse focus position as the preliminary focus position, and the preset direction is a direction toward the sample, wherein d3 is a preset third position offset; Alternatively, a position moved d3 μm toward the sample based on the coarse focus position is taken as the preliminary focus position, and the preset direction is a direction away from the sample.
9. An imaging system, characterized in that: Including objective lens, image sensor, driving module and controller; The controller is used to: Using the image sensor to collect an image through the objective lens, and obtaining an image quality index of the image, wherein the objective lens is in a preliminary focusing position relative to the sample; The driving module is controlled to operate so that the objective lens and the sample perform relative movement, so that the objective lens moves relative to the sample from the preliminary focusing position in a preset direction with a first step length. Each time a position is reached, the image sensor is used to capture an image through the objective lens and obtain an image quality index of the image. The image quality index of the image captured at the current position is compared with the image quality index of the image captured at the previous position. If the image quality index of the image captured at the current position is smaller than the image quality index of the image captured at the previous position, the step length is reduced, and the direction of relative movement between the objective lens and the sample is opposite to the direction of relative movement in the previous step. The driving module is controlled to operate to continue the next relative movement. Otherwise, the step length and the direction of relative movement between the objective lens and the sample are not changed. The driving module is controlled to operate to continue the next relative movement until the focusing end condition is reached, the relative movement between the objective lens and the sample is stopped, and the focusing of the objective lens is completed.
10. A sequencing device, characterized in that: Comprising the imaging system of claim 9.
Citation Information
Cited By
Image acquisition system and method of measuring equipment
CN119788965A
