Image acquisition method, device, computer equipment and storage medium

By collecting a reference sample image set in the microscope and calculating the focus position for motion compensation, the problem of low image acquisition efficiency of traditional microscopes is solved, and automated and efficient image acquisition is achieved.

CN114584662BActive Publication Date: 2024-10-11SHENZHEN REETOO BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011374649.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-30
Publication Date
2024-10-11
Estimated Expiration
2040-11-30

AI Technical Summary

Technical Problem

The image collection efficiency of traditional microscopes is low and requires manual adjustment of the stage height, resulting in low image collection efficiency.

Method used

By collecting a reference sample image set at the first magnification, determine the reference focus position and area of ​​interest, adjust the microscope magnification, calculate the first and second focus positions, perform motion compensation based on the difference in focus positions, and realize automatic adjustment and image acquisition. .

Benefits of technology

The image collection efficiency is improved, the collection area and distance are reduced, and the accuracy and efficiency of image collection are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114584662B_ABST
    Figure CN114584662B_ABST
Patent Text Reader

Abstract

The present application relates to an image acquisition method, device, computer equipment and storage medium. The method includes: under a first magnification, sample image acquisition is performed on a detection sample in a microscope to obtain a reference sample image set; based on the reference sample image set, a reference focus position and a set of regions of interest corresponding to the detection sample are determined; the magnification of the microscope is adjusted to a second magnification, a first focus position corresponding to the current region of interest is calculated according to the reference focus position, sample image acquisition is performed according to the first focus position, and a first sample image is obtained; the current region of interest is updated, and a second focus position corresponding to the current region of interest is determined according to the reference focus position; motion compensation information is determined according to the difference between the first focus position and the second focus position; based on the motion compensation information, the microscope is controlled to perform motion compensation, and sample image acquisition is performed according to the second focus position. The use of this method can improve image acquisition efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image acquisition method, apparatus, computer equipment and storage medium. Background Art

[0002] With the development of science and technology, samples need to be tested in many cases. For example, in the medical field, blood tests can be performed by dropping blood on a slide and placing it on the stage of a microscope for testing.

[0003] In traditional technology, the microscope needs to be adjusted manually, such as adjusting the height of the stage. After the adjustment is accurate, the camera is used to capture the image, resulting in low image capture efficiency. Summary of the invention

[0004] Based on this, it is necessary to provide an image acquisition method, device, computer equipment and storage medium that can improve image acquisition efficiency in response to the above technical problems.

[0005] An image acquisition method, the method comprising: at a first magnification, performing sample image acquisition on a detection sample in a microscope to obtain a reference sample image set; determining a reference focus position corresponding to the detection sample based on the reference sample image set, and determining a set of regions of interest corresponding to the detection sample based on the reference sample image set; adjusting the magnification of the microscope to a second magnification, calculating a first focus position corresponding to a current region of interest based on the reference focus position, performing sample image acquisition based on the first focus position to obtain a first sample image; updating the current region of interest, determining a second focus position corresponding to the current region of interest based on the reference focus position; determining motion compensation information based on the difference between the first focus position and the second focus position; controlling the microscope to perform motion compensation based on the motion compensation information, and performing sample image acquisition based on the second focus position from the position after motion compensation to obtain a second sample image.

[0006] An image acquisition device, the device comprising: a reference sample image set acquisition module, used to acquire sample images of a detection sample in a microscope at a first magnification to obtain a reference sample image set; a focus and region of interest acquisition module, used to determine a reference focus position corresponding to the detection sample based on the reference sample image set, and to determine a region of interest set corresponding to the detection sample based on the reference sample image set; a first sample image acquisition module, used to adjust the magnification of the microscope to a second magnification, calculate a first focus position corresponding to a current region of interest according to the reference focus position, and acquire sample images according to the first focus position to obtain a first sample image; a second focus position determination module, used to update the current region of interest, and determine a second focus position corresponding to the current region of interest according to the reference focus position; a motion compensation information acquisition module, used to determine motion compensation information according to the difference between the first focus position and the second focus position; a first motion compensation module, used to control the microscope to perform motion compensation based on the motion compensation information, and acquire sample images according to the second focus position starting from the position after motion compensation to obtain a second sample image.

[0007] In some embodiments, the focus and area of ​​interest acquisition module includes: a planned scanning area acquisition unit, used to acquire the planned scanning area corresponding to the detection sample at a first magnification; a key focus position set determination unit, used to determine the key focus position set corresponding to the planned scanning area; a reference focus position determination unit, used to acquire a reference sample image set corresponding to each key focus position in the key focus position set, and determine the reference focus position corresponding to the key focus position according to the image clarity of the reference sample image set.

[0008] In some embodiments, the reference focus position determination unit is used to: control the microscope to move so that the current key focus position in the key focus position set is within the observation range; control the microscope to move and collect images of the detection sample during the movement, and determine the current reference focus position based on the reference sample image set obtained by the collection; update the current key focus position in the key focus position set, and repeat the steps of controlling the microscope to move so that the current key focus position in the key focus position set is within the observation range; control the microscope to move and collect images of the detection sample during the movement, and determine the current reference focus position corresponding to the current key focus position based on the clarity of the image in the reference sample image set obtained by the collection, until the key focus positions in the key focus position set are updated.

[0009] In some embodiments, the device also includes: a forward information acquisition module, used to acquire the forward movement steps corresponding to the forward key focusing position and the forward reference focus position corresponding to the forward key focusing position; a second motion compensation module, used to control the microscope to perform motion compensation according to the forward movement steps, the forward reference focus position and the current movement steps corresponding to the current key focusing position; the reference focus position determination unit is used to: start from the position after motion compensation, control the microscope to move according to the current movement steps, and collect images of the detection sample during the movement, and determine the current reference focus position based on the reference sample image set obtained by the collection.

[0010] In some embodiments, the device also includes: a field of view focus position obtaining module, which is used to perform focus interpolation based on the reference focus position at the first magnification to obtain the field of view focus position corresponding to each field of view of the planned scanning area; an image acquisition module, which is used to perform image acquisition of the detection sample based on the field of view focus position at the first magnification.

[0011] In some embodiments, the first motion compensation module is used to: subtract the first focus position from the second focus position to obtain a position difference; and obtain a motion compensation step number and a motion compensation direction based on the position difference.

[0012] In some embodiments, the device also includes a second motion compensation module, which is used to: control the microscope to move a preset distance and perform image acquisition, and determine the acquisition focus position based on the acquired sample image set; when it is determined that the acquisition focus position is not located at the center position corresponding to the preset movement distance, perform motion compensation according to the acquisition focus position.

[0013] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: under a first magnification, sample images are collected for a detection sample in a microscope to obtain a reference sample image set; a reference focus position corresponding to the detection sample is determined based on the reference sample image set, and a set of regions of interest corresponding to the detection sample is determined based on the reference sample image set; the magnification of the microscope is adjusted to a second magnification, a first focus position corresponding to a current region of interest is calculated according to the reference focus position, sample images are collected according to the first focus position to obtain a first sample image; the current region of interest is updated, and a second focus position corresponding to the current region of interest is determined according to the reference focus position; motion compensation information is determined according to the difference between the first focus position and the second focus position; based on the motion compensation information, the microscope is controlled to perform motion compensation, and sample images are collected according to the second focus position starting from the position after motion compensation to obtain a second sample image.

[0014] A computer-readable storage medium stores a computer program, which implements the following steps when executed by a processor: under a first magnification, sample images are collected for a detection sample in a microscope to obtain a reference sample image set; a reference focus position corresponding to the detection sample is determined based on the reference sample image set, and a set of regions of interest corresponding to the detection sample is determined based on the reference sample image set; the magnification of the microscope is adjusted to a second magnification, a first focus position corresponding to a current region of interest is calculated based on the reference focus position, sample images are collected based on the first focus position to obtain a first sample image; the current region of interest is updated, and a second focus position corresponding to the current region of interest is determined based on the reference focus position; motion compensation information is determined based on the difference between the first focus position and the second focus position; based on the motion compensation information, the microscope is controlled to perform motion compensation, and sample images are collected based on the second focus position starting from the position after motion compensation to obtain a second sample image.

[0015] The above-mentioned image acquisition method, device, computer equipment and storage medium can detect and obtain a reference sample image set at a first magnification, obtain a reference focus position and a region of interest based on the reference image set, and perform image acquisition on the region of interest at a second magnification. The focus position corresponding to the region of interest can be calculated based on the reference focus position, and image acquisition is performed based on the focus position. Acquisition through the region of interest can reduce the image acquisition area, and after replacing the region of interest, motion compensation can be performed based on the difference in the focus position calculated before and after replacing the region of interest. Image acquisition is performed after motion compensation to obtain a second sample image, thereby reducing the distance for sample image acquisition based on the second focus position, thereby improving the efficiency of image acquisition. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A diagram showing an application environment of an image acquisition method in some embodiments;

[0017] Figure 2 is a schematic diagram of a flow chart of an image acquisition method in some embodiments;

[0018] Figure 3 A schematic diagram of a flow chart of a step of determining a reference focal position corresponding to a detection sample based on a reference sample image set in some embodiments;

[0019] Figure 4 is a schematic diagram of another region of interest and key focus position;

[0020] Figure 5 A schematic flow chart of the steps of obtaining a reference sample image set corresponding to each key focus position in a key focus position set and determining a reference focus position corresponding to the key focus position according to the image clarity of the reference sample image set in some embodiments;

[0021] Figure 6 is a structural block diagram of an image acquisition device in some embodiments;

[0022] Figure 7 1 is a diagram of the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0024] The image acquisition method provided in this application can be applied to Figure 1In the application environment shown, a microscope 110, an image capture device 120 and a computer device 130 are included. The microscope 110 includes an object lens 112, a stage 114 and an object lens 116, the glass slide of the detection sample to be detected is placed flat on the stage 114, the object lens 112 is used to focus on the glass slide with the detection sample with different focal lengths, the eyepiece 116 is used to observe the image entering the object lens 112, and the image capture device (image sensor) 120 is arranged on the object lens, i.e., located above the lens barrel of the microscope. The computer device 130 can be, for example, a computer, and the interface of the image capture device is connected to the computer device, and the image capture device, for example, a camera can be taken in real time, and an image is obtained and displayed on the computer, so that the object imaging below the microscope can be observed in real time on the computer. The computer can be connected to the image capture device and the microscope signal, for example, it can be connected through a network.

[0025] The computer device 130 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices.

[0026] In some embodiments, Figure 2 As shown, an image acquisition method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps:

[0027] Step S202 : collecting sample images of the detection sample in the microscope at a first magnification to obtain a reference sample image set.

[0028] Among them, the first magnification is the magnification of the objective lens, which can be set as needed. Generally speaking, the first magnification can be a smaller magnification, such as the minimum magnification in a microscope, which can be set as needed, such as 10 times.

[0029] Specifically, the reference sample image set is acquired at the first magnification. The images in the reference sample image set may be the positions corresponding to the images with the highest definition among the images acquired by shooting various key focus positions, for example, the positions of the stage corresponding to the images with the highest definition.

[0030] Step S204: determining a reference focus position corresponding to the detection sample based on the reference sample image set, and determining a set of regions of interest corresponding to the detection sample based on the reference sample image set.

[0031] Among them, the reference focus position is the focus position corresponding to the detected sample under the first magnification. There can be multiple reference focus positions. For example, a scanning area can be planned on the glass slide of the detection sample, and the key focus point in the planned scanning area can be determined. The objective lens can remain stationary, and the stage can be moved in the vertical direction to obtain the position of the stage corresponding to the clearest reference sample image when the focus point is observed most clearly, as the focus position corresponding to the focus point. For example, a rectangular scanning area can be planned on the glass slide, and the rectangular area can be divided into multiple sub-areas, such as more than 4 sub-areas. The intersections between the areas are key focus points, namely a1, a2, ... aN, respectively, and N is the number of key focus points. When observing the N points a1, a2, ... aN, while continuously adjusting the height of the stage, you can take pictures, and obtain the stage position corresponding to the clearest image in the image of the focus point as the reference focus position. Thus, the focus positions corresponding to a1, a2, ... aN are obtained.

[0032] The region of interest set includes multiple regions of interest, and the region of interest can be obtained by performing region of interest recognition on the reference sample image, for example, by using an artificial intelligence-based model. Alternatively, an image region including specific image features can be obtained as the region of interest.

[0033] Specifically, the computer device can be used to control the movement of the microscope stage while controlling the image capture device to capture images of the test sample at a first magnification to obtain a reference sample image set, and the stage position corresponding to the clearest image in the reference sample image set captured at the focus point is obtained as the reference focal position.

[0034] Step S206, adjusting the magnification of the microscope to a second magnification, calculating a first focus position corresponding to the current region of interest according to the reference focus position, and acquiring a sample image according to the first focus position to obtain a first sample image.

[0035] Among them, the second magnification is the magnification of the objective lens, which can be set as needed. Generally speaking, the second magnification is larger than the first magnification, for example, it can be 100 times. The current region of interest is the region of interest that can be currently observed by the objective lens. The first focal position is calculated, and the stage position at which the clearest current region of interest can be observed. The first focal position is obtained by interpolation based on the reference focal position. For example, a computer device can calculate which region of the first magnification the current region of interest seen under a 100x objective lens is in, and then interpolate through the reference focal position and the interpolation method to calculate the focal position of this current region of interest at the second magnification. The focal position can be represented by the number of steps the stage of the microscope moves.

[0036] Specifically, the computer device can adjust the magnification of the objective lens of the microscope to a second magnification, for example, switching from a first magnification of 10 times to a second magnification of 100 times. Then control the stage of the microscope to move to the initial focus position corresponding to the second magnification. If the field of view corresponding to the initial focus position includes the region of interest, calculate which region of the 10x objective lens field of view this position is in, and then calculate the focus position corresponding to the initial focus position, i.e., the first focus position, by interpolation. After obtaining the first focus position, the stage can be controlled to move in the direction of the first focus position to ensure that the stage will pass through the first focus position. Image acquisition can be performed during the movement, for example, the camera is in a real-time continuous shooting state, and the captured pictures are saved in the corresponding folder. The clarity of each picture is calculated by a clarity algorithm, and the picture with the highest clarity is recorded and saved. In this way, the clearest picture corresponding to the current region of interest can be obtained. Among them, the range of movement of the stage can be determined according to the focusing range of the objective lens of the second magnification, and the focusing range of the objective lens can be represented by the number of steps S3 of the stage movement in the vertical direction. When the stage moves toward the direction of the first focal position, it can move S3 steps.

[0037] Step S208, updating the current region of interest, and determining a second focus position corresponding to the current region of interest according to the reference focus position.

[0038] Specifically, after the first sample image is captured, the region of interest is switched, that is, the current region of interest is switched to the next region of interest. Similar to the calculation method of the first focal position, the second focal position is calculated to obtain the stage position where the clearest current region of interest can be observed. The second focal position is also obtained by interpolation based on the reference focal position. For example, the computer device can calculate which region of the field of view of the objective lens with the first magnification that the current region of interest seen under the 100x objective lens is located, and then interpolate through the reference focal position and the interpolation method to calculate the focal position corresponding to the current region of interest as the second focal position.

[0039] Step S210, determining motion compensation information according to the difference between the first focus position and the second focus position.

[0040] Wherein, the motion compensation information may include the number of motion steps and the direction of motion. The direction of motion may be upward motion or downward motion. The difference may be expressed by the position difference obtained by subtracting the first focal position from the second focal position, for example, the second focal position and the first focal position may be expressed by the number of steps. The first focal position may be subtracted from the second focal position, and the number of motion compensation steps and the direction of motion compensation may be obtained based on the position difference. If the obtained difference is positive, it means that the second focal position is located above the first focal position, and the stage needs to move upward, that is, move in a direction close to the objective lens, and the number of motion steps is the absolute value of the difference. If the obtained difference is negative, it means that the second focal position is located below the first focal position, and the stage needs to move downward, that is, move in a direction away from the objective lens, and the number of motion steps is the absolute value of the difference.

[0041] Specifically, the computer device may subtract the first focus position from the second focus position, determine the number of movement steps and the direction of movement according to the obtained difference, and perform motion compensation according to the number of movement steps and the direction of movement.

[0042] Step S212, controlling the microscope to perform motion compensation based on the motion compensation information, and starting from the position after motion compensation, collecting a sample image according to the second focus position to obtain a second sample image.

[0043] Specifically, after obtaining the number of movement steps and the direction of movement, the stage of the microscope can be controlled to move the number of movement steps in the direction of movement. After the motion compensation is completed, the stage can be controlled to continue to move in the direction close to the second focal position, for example, the stage is controlled to move the number of steps S3 corresponding to the focusing range of the objective lens of the second magnification, and image acquisition is performed, the image is saved in a corresponding folder, and the clarity of the photos in the folder is calculated, and the image with the highest clarity is used as the second sample image.

[0044] In some embodiments, when the difference between the first focus position and the second focus position is less than a preset threshold, motion compensation may not be performed, and the step of directly acquiring a sample image according to the second focus position to obtain a second sample image may be performed. The preset threshold may be set as needed, for example, 10 steps. When the current region of interest is changed next time, the motion compensation information calculated this time is superimposed with the motion compensation information calculated next time according to the same method, and then motion compensation is performed.

[0045] In some embodiments, when it is determined that the direction of motion compensation is the same as the direction of the second focus position, and the difference between the first focus position and the second focus position is less than a preset threshold, motion compensation may not be performed, and the number of motion compensation steps is added to the original number of steps for sample image acquisition to obtain the target number of steps for sample image acquisition, and the stage is controlled to move the target number of steps and sample image acquisition is performed to obtain a second sample image.

[0046] It can be understood that when there are more than two regions of interest, the current region of interest can be continuously updated until the region of interest is updated. For each current region of interest, a step of performing motion compensation based on the difference in focus position can be performed. For example, a third focus position corresponding to the current region of interest is obtained, and motion compensation information is determined based on the difference between the third focus position and the second focus position, and motion compensation is performed.

[0047] In the above-mentioned image acquisition method, since a reference sample image set can be detected at a first magnification, a reference focus position and a region of interest can be obtained based on the reference image set, and image acquisition of the region of interest can be performed at a second magnification, the focus position corresponding to the region of interest can be calculated based on the reference focus position, and image acquisition is performed based on the focus position. Acquisition through the region of interest can reduce the image acquisition area, and after replacing the region of interest, motion compensation can be performed based on the difference in the focus position calculated before and after replacing the region of interest, and image acquisition is performed after motion compensation to obtain a second sample image, thereby reducing the distance for sample image acquisition based on the second focus position, thereby improving the efficiency of image acquisition.

[0048] In some embodiments, Figure 3 As shown, determining the reference focus position corresponding to the detection sample based on the reference sample image set includes:

[0049] Step S302: acquiring a planned scanning area corresponding to the detection sample at a first magnification.

[0050] The planned scanning area is the area planned to scan the glass slide corresponding to the detection sample, which can be set according to a preset rule, for example, a rectangular area of ​​a preset size.

[0051] Specifically, the glass slide to be tested can be placed flat on the stage of the microscope, and the computer device can be connected to the camera to initialize the microscope, move the X, Y, and Z axes of the microscope to the optical coupling position, and switch the objective lens to the first magnification, such as 10 times, and then define a rectangular area as the planned scanning area.

[0052] Step S304: determine a set of key focus positions corresponding to the planned scanning area.

[0053] Specifically, the key focus position set may include multiple focus positions, for example, a key point in the planned scanning area may be used as a focus point. For example, for a rectangle, the rectangular area may be divided into multiple sub-areas, for example, at least 9 sub-areas, and the intersections between the sub-areas may be used as key focus positions, i.e., positioning points. Figure 4As shown, the large dots indicate key focus positions and the small dots indicate areas of interest.

[0054] Step S306, obtaining a reference sample image set corresponding to each key focus position in the key focus position set, and determining a reference focus position corresponding to the key focus position according to the image clarity of the reference sample image set.

[0055] Specifically, after obtaining the set of key focus positions, the clearest position for observing each key focus position can be obtained as a reference focus position. For example, the key focus position can be imaged by moving the stage, and the stage position corresponding to the image with the highest image clarity in the reference sample images of the key focus positions can be obtained as the reference focus position.

[0056] In an embodiment of the present application, by acquiring a planned scanning area corresponding to a detection sample at a first magnification, determining a set of key focusing positions corresponding to the planned scanning area, and determining a reference focus position corresponding to each key focusing position in the set of key focusing positions, the focus positions corresponding to a plurality of focus points can be obtained, thereby referring to these focus positions to calculate the focus positions of each field of view in the planned scanning area at different magnifications.

[0057] In some embodiments, after obtaining the first magnification, focus interpolation can be performed based on the reference focus position at the first magnification to obtain the field of view focus position corresponding to each field of view of the planned scanning area; at the first magnification, image acquisition is performed on the detection sample based on the field of view focus position.

[0058] Specifically, after obtaining the reference focus position, the focus coordinate values ​​of other intermediate fields of view under the first magnification can be calculated according to the obtained reference focus coordinate values ​​by interpolation method, and the field of view can be switched based on the obtained focus coordinate values, and the stage can be moved to the focus position corresponding to the field of view to take one or more pictures, so that the sample areas of other fields of view can be quickly photographed without taking pictures while moving in each sample area, and then selecting the clearest picture for saving. For example, under a 10x objective lens, after obtaining the focus coordinate values ​​corresponding to a1, a2, ... aN respectively, the focus positions corresponding to other fields of view under the 10x objective lens can be calculated by interpolation method, and then switch to each field of view and move directly to the corresponding focus position to take images.

[0059] In some embodiments, Figure 5 As shown, obtaining a reference sample image set corresponding to each key focus position in the key focus position set, and determining a reference focus position corresponding to the key focus position according to the image clarity of the reference sample image set includes:

[0060] Step S502, controlling the microscope to move so that the current key focus position in the key focus position set is within the observation range;

[0061] Step S504, controlling the microscope to move and collecting images of the test sample during the movement, and determining a current reference focus position corresponding to the current key focus position based on the clarity of the images in the reference sample image set collected;

[0062] Step S506, determining whether the key focus position in the key focus position set has been updated;

[0063] Step S508: updating the current key focus position in the key focus position set.

[0064] Step S510, obtaining a reference focus position set.

[0065] The key focus position set has multiple key focus positions, which can be used as the current key focus position in turn, and the objective lens is aligned with the current key focus position for image acquisition, and the current reference focus position is determined based on the acquired image set. For example, assuming that the vertical direction is the Z axis, there are N key focus positions a1, a2, ... aN, then the stage movement can be controlled to expose the starting point a1 to the microscope lens, and the point where a1 is located is used as the zero point in the vertical direction, and then under the first magnification, such as a 10x objective lens, the microscope coarse focus is adjusted, and according to the preset focus position, the stage moves along the Z axis direction to the initial focus position, and then the stage moves vertically upward along the Z axis direction at a uniform speed for a preset number of steps s1, and the preset number of steps ensures that the stage will pass through the focus position. During the movement, the camera is in a real-time continuous shooting state, and the captured pictures are saved in the corresponding folder. The computer device calculates the clarity of each picture through an algorithm, records the picture with the highest clarity, and calculates the stage position corresponding to the picture as the focus coordinate value ff1 corresponding to a1, wherein the focus coordinate value can be expressed in steps, and the captured picture matches the movement steps and is in a linear relationship. After obtaining the focus position corresponding to a1, the current key focus position in the key focus position set is updated, and the microscope is repeatedly controlled to move so that the current key focus position in the key focus position set is within the observation range; the microscope is controlled to move and the image of the detection sample is collected during the movement, and the current reference focus position is determined based on the reference sample image set obtained, until the key focus position is updated. For example, the starting point a2 can be used as the current key focus position, exposed to the microscope lens, and the focus position corresponding to a2 is obtained by referring to the focus position acquisition method of a1, and then a3 and a4 are used as the current key focus positions in turn, until the reference focus position corresponding to aN is obtained, forming a reference node position set.

[0066] In some embodiments, the microscope is controlled to move and capture images of the detection sample during the movement, and before the current reference focus position is determined based on the reference sample image set obtained by the capture, it also includes: obtaining the forward movement step number corresponding to the forward key focus position and the forward reference focus position corresponding to the forward key focus position; controlling the microscope to perform motion compensation according to the forward movement step number, the forward reference focus position and the current movement step number corresponding to the current key focus position; the step of controlling the microscope to move and capture images of the detection sample during the movement, and determining the current reference focus position based on the reference sample image set obtained by the capture includes: starting from the position after motion compensation, controlling the microscope to move according to the current movement step number, and capturing images of the detection sample during the movement, and determining the current reference focus position based on the reference sample image set obtained by the capture.

[0067] The forward key focus position refers to the key focus position before the current key focus position, for example, when a2 is the current key focus position, a1 is the forward key focus position of a2. The forward moving step number refers to the number of steps that the forward key focus position moves when determining the reference focus position, for example, s1 steps.

[0068] The forward reference focus position is the reference focus position corresponding to the forward key focus position, such as the reference focus position ff1 corresponding to a1. The current moving step number corresponding to the current key focus position is a preset step number, for example, when the image acquisition is performed on the current key focus position a2, the number of steps moved is the preset step number S2. Among them, the current moving step number is less than the forward moving step number, that is, S2 is less than S1. After obtaining the forward moving step number, the forward reference focus position and the current moving step number corresponding to the current key focus position, the microscope can be controlled to perform motion compensation so that the focus position is located in the middle of the position moved when the S2 step number is moved, that is, when the stage of the microscope is controlled to move according to the current moving step number, the focus is located in the middle of the moving position. The formula for motion compensation can be (s1-ff1-s2 / 2) steps, and the direction of movement can be upward movement or downward movement, that is, moving in the direction of the objective lens or moving away from the objective lens. It is specifically determined according to the positive and negative number of steps obtained by the motion compensation formula. After motion compensation, the current position is s2 / 2 steps away from the forward reference focus position corresponding to the forward key focus position. After motion compensation, image acquisition can be started from the position after motion compensation. Since the focus coordinate corresponding to the forward key focus position is ff1, the focus position corresponding to the current key focus position should be near ff1. By moving (s1-ff1-s2 / 2) steps, the stage is approximately s2 / 2 steps away from the focus position after motion compensation. When the stage moves s2 steps after motion compensation, the focus position is approximately in the middle of the movement of s2 steps, making the focus calculation more accurate and saving the number of moving steps.

[0069] For example, after determining the focal position ff1 of a1, the computer device can control the stage movement so that the starting point a2 is exposed to the microscope lens, adjust the coarse focus of the microscope, and then control the stage to move (s1-ff1-s2 / 2) steps along the Z axis to perform motion compensation. After motion compensation, the position of the glass slide is above the focus. Then adjust the coarse focus of the microscope and control the stage to move s2 steps vertically downward at a uniform speed along the Z axis, where s2 is less than s1. During the movement, the camera is in a real-time continuous shooting state, and the captured pictures are saved in the corresponding folder. The clarity of each picture is calculated by the algorithm, and the picture with the highest clarity is recorded, and the corresponding focus coordinate value ff2 is calculated. At this time, after the movement is completed, the position of the glass slide is below the focus. It can be understood that for a3 to aN, compensation can also be performed by referring to the motion compensation method corresponding to a2, and the focus coordinate value ff4 is obtained, and ff1, ff2, ... ffN are used as reference focus positions, which will not be repeated here.

[0070] In some embodiments, before updating the current region of interest and determining the second focus position corresponding to the current region of interest based on the reference focus position, the method further includes: controlling the microscope to move a preset distance and perform image acquisition, and determining the acquisition focus position based on the acquired sample image set; when it is determined that the acquisition focus position is not located at the center position corresponding to the preset movement distance, performing motion compensation based on the acquisition focus position.

[0071] Specifically, the acquisition focus position is the focus position corresponding to the acquisition sample image. The preset distance can be set as needed. After obtaining the acquisition sample image set, the stage position corresponding to the image with the highest clarity in the acquisition sample image set can be obtained as the acquisition focus position, and it is determined whether the acquisition focus position is located at the center of the fixed distance of movement. If not, the stage can be moved for motion compensation so that the acquisition focus position is located in the middle of the distance after motion compensation and the position before moving the preset distance. As a result, the image can pass through the focus position during image acquisition, and the clarity of the image before the focus gradually increases, and the clarity of the image after the focus gradually decreases. Therefore, the position corresponding to the image with the highest image clarity can be obtained as the focus position, which improves the accuracy of the obtained angular position. After motion compensation, the region of interest can be switched, and the reference focus position can be used to determine the second focus position corresponding to the current region of interest.

[0072] The following takes the first magnification as 10 times and the second magnification as 100 times as an example to illustrate the method provided in the embodiment of the present application, including the following steps:

[0073] 1. Get the planned scanning area on the slide.

[0074] Specifically, the glass slide of the sample to be tested is placed flat on the stage. A camera is connected to the top of the microscope tube, and the camera interface is connected to the computer. The camera can take pictures in real time, so the image of the object under the microscope can be observed in real time on the computer.

[0075] 2. Determine the set of key focus positions corresponding to the planned scanning area.

[0076] Specifically, the rectangular area may be divided into a plurality of sub-areas, for example, at least 9 sub-areas, and the intersection points between the sub-areas are used as positioning points.

[0077] 3. Determine the reference focus position corresponding to each key focus position in the key focus position set.

[0078] Specifically, the stage can be controlled to move so that the starting point a1 is exposed under the microscope lens. At this time, the point a1 is used as the zero point in the vertical direction, and the position of the glass slide is below the focus. Then, under the 10x objective lens, the microscope coarse focus is adjusted. According to the preset focus position, the stage moves along the Z axis to the initial focus position, and then the stage moves vertically upward at a uniform speed of s1 steps along the Z axis, wherein the movement of S1 steps ensures that the movement will pass through the focus position. During the movement, the camera is in a real-time continuous shooting state, and the captured pictures are saved in the corresponding folder. The clarity of each picture is calculated by the algorithm, and the picture with the highest clarity is recorded. The computer device calculates the actual position of the clearest picture, that is, the focus position, and obtains the corresponding focus coordinate value ff1. After the movement is completed, the position of the glass slide is above the focus. The computer device controls the stage to continue to move so that the starting point a2 is exposed under the microscope lens. After adjusting the coarse focus of the microscope, the stage moves (s1-ff1-s2 / 2) steps along the Z axis, so that the movement is completed and the position of the glass slide is above the focus. The computer device continues to adjust the coarse focus of the microscope, and the stage moves vertically downward at a uniform speed of s2 steps along the Z-axis direction, where s2 is less than s1. During the movement, the camera is in a real-time continuous shooting state, and the captured pictures are saved in the corresponding folder. The clarity of each picture is calculated by an algorithm, and the picture with the highest clarity is recorded to calculate the corresponding focus coordinate value ff2. After the movement is completed, the position of the glass slide is below the focus. The computer device controls the movement of the stage so that the starting point a3 is exposed to the microscope lens... until the angle coordinate value corresponding to aN is obtained. The steps of obtaining the focus coordinate value ff3 at a3 to the focus coordinate value ffN corresponding to aN can refer to the steps of obtaining the focus coordinate value ff2 corresponding to a2, and will not be repeated here.

[0079] 4. At the first magnification, focus interpolation is performed based on the reference focus position to obtain the field of view focus position corresponding to each field of view in the planned scanning area; at the first magnification, image acquisition is performed on the detection sample based on the field of view focus position.

[0080] Specifically, the focal coordinate values ​​of other intermediate fields of view under the 10x objective lens can be calculated by interpolation method according to the focal coordinate values ​​at N locations. The computer device switches the field of view according to the obtained focal coordinate values, moves the Z axis to the focal position, and takes a picture. Repeat the step of switching the field of view until all fields of view in the rectangular area are photographed under the 10x objective lens.

[0081] 5. Adjust the magnification of the microscope to the second magnification, and determine the first focus position corresponding to the current area of ​​interest based on the reference focus position. Collect the sample image based on the first focus position to obtain the first sample image

[0082] Specifically, after the field of view corresponding to the 10x objective lens is photographed, switch to the 100x objective lens, and the stage moves to the initial focus position of the 100x objective lens in the Z-axis direction. Since the field of view of the 100x objective lens is one tenth of the field of view of the 10x objective lens, the difference between the focal length of the field of view of the 10x objective lens and the focal length of the field of view of the 100x objective lens is a fixed value m, and s3 is set as the focusing range of the 40x objective lens. Then you can move m-s3 / 2 steps in the Z-axis direction (according to the positive and negative values, the direction of movement is determined) to reach the initial focus position of the 100x objective lens. Then move to the first region of interest, calculate which region of the 10x objective lens field of view this position is in, and then calculate the focal position of this region by interpolation. This focal position is recorded as n1. The stage moves s3 steps vertically at a uniform speed along the Z-axis direction. During the movement, the camera is in a real-time continuous shooting state, and the captured pictures are saved in the corresponding folder. The clarity of each picture is calculated by the algorithm, and the picture with the highest clarity is recorded and saved.

[0083] 6. Update the current region of interest, and determine the second focus position corresponding to the current region of interest according to the reference focus position.

[0084] Specifically, the region of interest may be switched, and then the focus position of the current region of interest is obtained based on the reference focus position, and this focus position is recorded as n2.

[0085] 7. Determine motion compensation information according to the difference between the first focus position and the second focus position.

[0086] Specifically, the number and direction of the steps to be compensated in the Z-axis direction are determined by n2-n1.

[0087] 8. Control the microscope to perform motion compensation based on the motion compensation information, and start from the position after motion compensation, collect the sample image according to the second focus position to obtain a second sample image.

[0088] It should be understood that, although the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0089] In some embodiments, Figure 6As shown, an image acquisition device is provided, including: a reference sample image set acquisition module 602, a focus and region of interest acquisition module 604, a first sample image acquisition module 606, a second focus position determination module 608, a motion compensation information acquisition module 610 and a first motion compensation module 612, wherein:

[0090] A reference sample image set acquisition module 602 is used to acquire sample images of the test sample in the microscope at a first magnification to obtain a reference sample image set;

[0091] A focus and region of interest acquisition module 604, configured to determine a reference focus position corresponding to the detection sample based on a reference sample image set, and to determine a region of interest set corresponding to the detection sample based on a reference sample image set;

[0092] A first sample image obtaining module 606 is used to adjust the magnification of the microscope to a second magnification, calculate a first focus position corresponding to the current region of interest according to a reference focus position, and collect a sample image according to the first focus position to obtain a first sample image;

[0093] A second focus position determination module 608, used to update the current region of interest and determine a second focus position corresponding to the current region of interest according to the reference focus position;

[0094] A motion compensation information acquisition module 610, configured to determine motion compensation information according to a difference between a first focus position and a second focus position;

[0095] The first motion compensation module 612 is used to control the microscope to perform motion compensation based on the motion compensation information, and to collect a sample image according to the second focus position starting from the position after the motion compensation to obtain a second sample image.

[0096] In some embodiments, the focus and area of ​​interest acquisition module includes: a planned scanning area acquisition unit, used to acquire the planned scanning area corresponding to the detection sample at a first magnification; a key focus position set determination unit, used to determine the key focus position set corresponding to the planned scanning area; a reference focus position determination unit, used to acquire a reference sample image set corresponding to each key focus position in the key focus position set, and determine the reference focus position corresponding to the key focus position according to the image clarity of the reference sample image set.

[0097] In some embodiments, the reference focus position determination unit is used to: control the microscope to move so that the current key focus position in the key focus position set is within the observation range; control the microscope to move and capture images of the detection sample during the movement, and determine the current reference focus position based on the reference sample image set obtained by the capture; update the current key focus position in the key focus position set, and repeat the steps of controlling the microscope to move so that the current key focus position in the key focus position set is within the observation range; control the microscope to move and capture images of the detection sample during the movement, and determine the current reference focus position based on the reference sample image set obtained by the capture, until the key focus position in the key focus position set is updated.

[0098] In some embodiments, the device also includes: a forward information acquisition module, used to acquire the forward movement steps corresponding to the forward key focus position and the forward reference focus position corresponding to the forward key focus position; a second motion compensation module, used to control the microscope to perform motion compensation according to the forward movement steps, the forward reference focus position and the current movement steps corresponding to the current key focus position; the reference focus position determination unit is used to: start from the position after motion compensation, control the microscope to move according to the current movement steps, and collect images of the detection samples during the movement, and determine the current reference focus position based on the reference sample image set obtained by the collection.

[0099] In some embodiments, the device also includes: a field of view focus position obtaining module, which is used to perform focus interpolation based on the reference focus position at a first magnification to obtain the field of view focus position corresponding to each field of view of the planned scanning area; an image acquisition module, which is used to perform image acquisition of the detection sample based on the field of view focus position at the first magnification.

[0100] In some embodiments, the first motion compensation module is used to: subtract the first focus position from the second focus position to obtain a position difference; and obtain a motion compensation step number and a motion compensation direction based on the position difference.

[0101] In some embodiments, the device also includes a second motion compensation module, which is used to: control the microscope to move a preset distance and perform image acquisition, and determine the acquisition focus position based on the acquired sample image set; when it is determined that the acquisition focus position is not located at the center position corresponding to the preset distance of movement, motion compensation is performed according to the acquisition focus position.

[0102] For the specific definition of the image acquisition device, please refer to the definition of the image acquisition method above, which will not be repeated here. Each module in the above-mentioned image acquisition device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0103] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an image acquisition method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0104] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0105] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: at a first magnification, sample images of a detection sample in a microscope are acquired to obtain a reference sample image set; a reference focus position corresponding to the detection sample is determined based on the reference sample image set, and a set of regions of interest corresponding to the detection sample is determined based on the reference sample image set; the magnification of the microscope is adjusted to a second magnification, a first focus position corresponding to a current region of interest is calculated based on the reference focus position, sample images are acquired based on the first focus position, and a first sample image is acquired; the current region of interest is updated, and a second focus position corresponding to the current region of interest is determined based on the reference focus position; motion compensation information is determined based on the difference between the first focus position and the second focus position; based on the motion compensation information, the microscope is controlled to perform motion compensation, and sample images are acquired based on the second focus position starting from the position after motion compensation, and a second sample image is acquired.

[0106] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: at a first magnification, sample images of the detection samples in the microscope are acquired to obtain a reference sample image set; a reference focus position corresponding to the detection samples is determined based on the reference sample image set, and a set of regions of interest corresponding to the detection samples is determined based on the reference sample image set; the magnification of the microscope is adjusted to a second magnification, a first focus position corresponding to the current region of interest is calculated according to the reference focus position, and sample images are acquired according to the first focus position to obtain a first sample image; the current region of interest is updated, and a second focus position corresponding to the current region of interest is determined according to the reference focus position; motion compensation information is determined according to the difference between the first focus position and the second focus position; based on the motion compensation information, the microscope is controlled to perform motion compensation, and sample images are acquired according to the second focus position starting from the position after motion compensation to obtain a second sample image.

[0107] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0108] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0109] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. An image acquisition method, characterized in that: The method comprises: Under a first magnification, collecting sample images of the detection sample in the microscope to obtain a reference sample image set; Acquire the number of forward movement steps corresponding to the forward key focus position and the forward reference focus position corresponding to the forward key focus position; Controlling the microscope to perform motion compensation according to the forward movement step number, the forward reference focus position, and the current movement step number corresponding to the current key focus position; Starting from the position after motion compensation, controlling the microscope to move according to the current moving step number, and acquiring images of the detection sample during the movement, determining the current reference focus position based on the acquired reference sample image set, and determining the set of regions of interest corresponding to the detection sample based on the acquired reference sample image set; The magnification of the microscope is adjusted to a second magnification, a first focus position corresponding to the current region of interest is calculated according to the reference focus position, and a sample image is collected according to the first focus position to obtain a first sample image; Updating the current region of interest, and determining a second focus position corresponding to the current region of interest according to the reference focus position; determining motion compensation information according to a difference between the first focus position and the second focus position; The microscope is controlled to perform motion compensation based on the motion compensation information, and a sample image is collected according to the second focus position starting from the position after the motion compensation to obtain a second sample image.

2. The method according to claim 1, characterized in that: Before acquiring the number of forward movement steps corresponding to the forward key focus position and the forward reference focus position corresponding to the forward key focus position based on the reference sample image set, the method further includes: Under a first magnification, obtaining a planned scanning area corresponding to the detection sample; Determining a set of key focus positions corresponding to the planned scanning area; A reference sample image set corresponding to each key focus position in the key focus position set is obtained, and a reference focus position corresponding to the key focus position is determined according to the image clarity of the reference sample image set.

3. The method according to claim 2, characterized in that The step of acquiring a reference sample image set corresponding to each key focus position in the key focus position set, and determining a reference focus position corresponding to the key focus position according to the image clarity of the reference sample image set comprises: Controlling the microscope to move so that a current key focus position in the set of key focus positions is within an observation range; Controlling the microscope to move and collecting images of the test sample during the movement, and determining a current reference focus position corresponding to a current key focus position based on the clarity of images in a reference sample image set obtained by collection; updating a current key focus position in the set of key focus positions, and repeatedly controlling the microscope to move so that the current key focus position in the set of key focus positions is within an observation range; The microscope is controlled to move and to collect images of the detection sample during the movement, and a current reference focus position corresponding to the current key focus position is determined based on the clarity of the images in the reference sample image set obtained by the collection, until the key focus positions in the key focus position set are updated.

4. The method according to claim 1, characterized in that: The controlling the microscope to perform motion compensation according to the forward movement step number, the forward reference focus position and the current movement step number corresponding to the current key focus position comprises: Subtracting the focus coordinate corresponding to the forward reference focus position from the forward movement step number, and then subtracting half of the current movement step number corresponding to the key focus position, to obtain the direction and step number of motion compensation; According to the direction and number of steps of motion compensation obtained, the microscope is controlled to move in the corresponding direction by the corresponding number of steps.

5. The method according to claim 2, characterized in that: The method further comprises: Under the first magnification, performing focus interpolation based on the reference focus position to obtain a field of view focus position corresponding to each field of view of the planned scanning area; At the first magnification, an image of the detection sample is captured based on the focal position of the field of view.

6. The method according to claim 1, characterized in that The determining of motion compensation information according to the difference between the first focus position and the second focus position comprises: Subtracting the first focal position from the second focal position to obtain a position difference; The motion compensation step number and the motion compensation direction are obtained based on the position difference.

7. The method according to claim 1, characterized in that Before updating the current region of interest and determining a second focus position corresponding to the current region of interest according to the reference focus position, the method further includes: Controlling the microscope to move a preset distance and perform image acquisition, and determining an acquisition focus position based on the acquired acquisition sample image set; When it is determined that the acquisition focus position is not located at the center position corresponding to the preset movement distance, motion compensation is performed according to the acquisition focus position.

8. An image acquisition device, characterized in that: The device comprises: A reference sample image set acquisition module is used to acquire sample images of the detection sample in the microscope at a first magnification to obtain a reference sample image set; A focus and region of interest acquisition module, used to acquire the forward movement steps corresponding to the forward key focus position and the forward reference focus position corresponding to the forward key focus position; control the microscope to perform motion compensation according to the forward movement steps, the forward reference focus position and the current movement steps corresponding to the current key focus position; starting from the position after motion compensation, control the microscope to move according to the current movement steps, and perform image acquisition on the detection sample during the movement, and determine the current reference focus position based on the acquired reference sample image set; and determine the region of interest set corresponding to the detection sample based on the acquired reference sample image set; A first sample image obtaining module, used for adjusting the magnification of the microscope to a second magnification, calculating a first focus position corresponding to a current region of interest according to the reference focus position, and collecting a sample image according to the first focus position to obtain a first sample image; A second focus position determination module, used to update the current region of interest and determine a second focus position corresponding to the current region of interest according to the reference focus position; a motion compensation information acquisition module, configured to determine motion compensation information according to a difference between the first focus position and the second focus position; The first motion compensation module is used to control the microscope to perform motion compensation based on the motion compensation information, and to collect a sample image according to the second focus position starting from the position after motion compensation to obtain a second sample image.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.