Automatic focusing method and device, electronic equipment and shooting system

By combining the first and second automatic focusing models to calculate the clarity of the embryo image and using the weight parameter optimization focus algorithm, the problem of large focus position error in the traditional method is solved, and more accurate embryo imaging is achieved.

CN116405775BActive Publication Date: 2025-08-08HUA YUE MEDICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310207945.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2025-08-08
Estimated Expiration
2043-03-06

AI Technical Summary

Technical Problem

The error between the optimal focus position obtained by traditional automatic focus technology in the field of assisted reproduction is large and the actual optimal focus position is large. The existing methods ignore the importance of the embryonic equatorial plane, resulting in the loss of key features, large calculation volume and slow search speed.

Method used

The first and second automatic focusing models are used to calculate the clarity of the target band area and the target area respectively, and the fine-adjustment clarity is calculated in combination with the weight parameters. The target focus position is obtained by fine-adjustment of the clarity change trend, and the focus algorithm is optimized to be close to the embryonic equatorial plane.

Benefits of technology

The error between the optimal focus position and the actual optimal focus position is reduced, the accuracy and search speed of the focus position are improved, and the integrity of key features during embryo imaging is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116405775B_ABST
    Figure CN116405775B_ABST
Patent Text Reader

Abstract

The present application relates to an autofocus method and device, electronic equipment, and a shooting system. The method comprises: when adjusting a shooting device to a coarse focus position, using a first autofocus model to calculate a first clarity of a target strip region, and calculating a second clarity of the target region based on a second autofocus model; calculating a fine-tuning clarity of a candidate embryo image based on a weight parameter, the first clarity, and the second clarity, and obtaining a target focus position of the shooting device based on a changing trend of the fine-tuning clarity; the present application calculates focus clarity for different regions by combining different autofocus models, and then obtains a target focus position through weighted calculation, thereby ensuring that the target focus position is both close to the equatorial plane and has a small error from the actual optimal focus position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of medical image data processing, and in particular to an automatic focusing method and device, an electronic device, and a shooting system. Background Art

[0002] With the development of image processing technology, autofocus technology based on image processing has developed rapidly and is widely used in scenarios requiring imaging, such as daily life, scientific research, industrial production, and military applications.

[0003] Currently, in the field of assisted reproduction, during the analysis and evaluation of pre-selected embryo images, autofocus technology uses a corresponding autofocus model to calculate the image clarity of the pre-selected embryo at different focus positions. The focus position corresponding to the maximum pre-selected embryo image clarity is then selected as the optimal focus position. However, traditional autofocus technology suffers from a large error between the acquired optimal focus position and the actual optimal focus position. Summary of the Invention

[0004] Based on this, it is necessary to provide an automatic focusing method and device, electronic equipment and shooting system that can reduce the error between the acquired best focus position and the actual best focus position in order to address the above technical problems.

[0005] In a first aspect, the present application provides an autofocus method, which is applied to an electronic device, wherein the electronic device is communicatively connected to a photographing device, and the method includes:

[0006] determining a coarse focus position of a camera, acquiring images of the candidate embryo captured by the camera at different focal planes based on the coarse focus position, and determining a target band-shaped region where the zona pellucida is located in the candidate embryo image, and a target region located inside the target band-shaped region;

[0007] Calculating a first definition of a target strip area using a first auto-focusing model, and calculating a second definition of the target area based on a second auto-focusing model;

[0008] The fine-tuning clarity of the candidate embryo image is calculated according to the weight parameter, the first clarity and the second clarity, the changing trend of the fine-tuning clarity on different focal planes based on the coarse-tuning focus position is determined, and the target focus position of the shooting device is obtained based on the changing trend of the fine-tuning clarity.

[0009] In one embodiment, the step of determining a coarse focus position of a camera device includes:

[0010] Acquire preselected embryo images captured by a camera at different focal planes, and determine a strip-shaped area to be processed where the zona pellucida is located in the preselected embryo image, and a strip-shaped area to be processed located inside the strip-shaped area to be processed;

[0011] Calculating a third definition of the strip area to be processed using the first auto-focus model, and calculating a fourth definition of the strip area to be processed based on the second auto-focus model;

[0012] The coarse adjustment clarity of the preselected embryo image is calculated according to the weight parameter, the third clarity and the fourth clarity, the variation trend of the coarse adjustment clarity on different focal planes is determined, and the coarse adjustment focus position of the shooting device is determined based on the variation trend of the coarse adjustment clarity.

[0013] In one embodiment, the weight parameters include a first weight coefficient corresponding to the band-shaped area where the transparent band is located, and a second weight coefficient corresponding to the inner area of the band-shaped area.

[0014] In one embodiment, the step of calculating the fine-tuning definition of the candidate embryo image according to the weight parameter, the first definition, and the second definition includes:

[0015] Calculating a first fine-tuning definition based on a first weight coefficient and the first definition;

[0016] Calculating a second fine-tuning definition according to a second weight coefficient and the second definition;

[0017] The sum of the first fine adjustment definition and the second fine adjustment definition is used as the fine adjustment definition.

[0018] In one embodiment, the step of calculating the coarse definition of the preselected embryo image according to the weight parameter, the third definition, and the fourth definition comprises:

[0019] Calculating a first coarse adjustment definition based on the first weight coefficient and the third definition;

[0020] Calculating a second coarse adjustment definition according to the second weight coefficient and the fourth definition;

[0021] The sum of the first coarse adjustment definition and the second coarse adjustment definition is used as the coarse adjustment definition.

[0022] In one embodiment, the step of acquiring images of candidate embryos captured by a capturing device at different focal planes based on a coarse focus position includes:

[0023] A preset interval of the focal plane corresponding to the coarse focus position is selected, and a control parameter is output; the control parameter is used to instruct the shooting device to shoot within the preset interval to obtain a candidate embryo image.

[0024] In a second aspect, the present application further provides an autofocus device, which is applied to an electronic device, the electronic device being communicatively connected to a photographing device, and the device comprising:

[0025] a target image acquisition module, configured to determine a coarse focus position of a camera, acquire images of candidate embryos captured by the camera at different focal planes based on the coarse focus position, and determine a target band-shaped region where the zona pellucida is located in the candidate embryo image, as well as a target region located inside the target band-shaped region;

[0026] a definition acquisition module, configured to calculate a first definition of a target strip area using a first auto-focusing model, and calculate a second definition of the target area based on a second auto-focusing model;

[0027] The position acquisition module is used to calculate the fine-tuning clarity of the candidate embryo image based on the weight parameter, the first clarity and the second clarity, determine the changing trend of the fine-tuning clarity on different focal planes based on the coarse-tuning focus position, and obtain the target focus position of the shooting device based on the changing trend of the fine-tuning clarity.

[0028] In a third aspect, the present application further provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned automatic focusing method when executing the computer program.

[0029] In a fourth aspect, the present application further provides a photographing system. The photographing system includes an electronic device and a photographing device communicatively connected to the electronic device, wherein the photographing device is configured with an imaging component, a linear sliding platform, and a motor;

[0030] The imaging component and the motor are both connected to the electronic device for communication, and the linear sliding platform is connected to the motor and the imaging component respectively;

[0031] The motor drives the linear sliding platform to move under the control of the electronic equipment; the electronic equipment controls the imaging component to take pictures.

[0032] In one embodiment, a grating ruler and a zero position sensor are mounted on the linear sliding platform;

[0033] The grating ruler and the zero position sensor are connected to the electronic device for communication, and the grating ruler and the zero position sensor are used to feed back the moving distance of the linear sliding platform to the electronic device.

[0034] The above-mentioned automatic focusing method and device, electronic device and shooting system, when adjusting the shooting equipment to the coarse focus position, use the first automatic focusing model to calculate the first clarity of the target strip area, and calculate the second clarity of the target area based on the second automatic focusing model; calculate the fine-tuning clarity of the candidate embryo image according to the weight parameter, the first clarity and the second clarity, and obtain the target focus position of the shooting equipment based on the change trend of the fine-tuning clarity; the present application calculates the focus clarity of different areas by combining different automatic focusing models, and then obtains the target focus position through weighted calculation, thereby ensuring that the target focus position is close to the equatorial plane and the error between it and the actual optimal focus position is small. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of a process for acquiring multi-focal plane images of an embryo in one embodiment;

[0036] Figure 2 is a structural block diagram of a shooting system in one embodiment;

[0037] Figure 3 1 is a flow chart of an automatic focusing method according to an embodiment;

[0038] Figure 4a is a schematic diagram of segmenting a template image in one embodiment;

[0039] Figure 4b A main body positioning map of a candidate embryo image in one embodiment;

[0040] Figure 4c A schematic diagram of a target band area in one embodiment;

[0041] Figure 5 is a schematic diagram of a first auto-focusing model and a second auto-focusing model in one embodiment;

[0042] Figure 6a is a schematic diagram of a sampling area in one embodiment;

[0043] Figure 6b is a schematic diagram of an area requiring clarity calculation in one embodiment;

[0044] Figure 7 is a schematic flow chart of an automatic focusing method in another embodiment;

[0045] Figure 8 A graph showing the changing trends of the clarity evaluation scores and the overall clarity score in different Z-axis image sequences in one embodiment;

[0046] Figure 9 Schematic diagram of 50 mouse embryo images in one embodiment;

[0047] Figure 10a FIG1 is a schematic diagram of obtaining an optimal focal plane by calculating the Tenegrad evaluation function in one embodiment;

[0048] Figure 10b is a schematic diagram of obtaining an optimal focal plane by weighted fusion of two image clarity evaluation functions in one embodiment;

[0049] Figure 10c FIG. 1 is a schematic diagram of obtaining an optimal focal plane by calculating a Brenner gradient evaluation function in one embodiment;

[0050] Figure 11 is a graph showing the changing trends of the clarity evaluation scores and the overall clarity score in different Z-axis image sequences in another embodiment;

[0051] Figure 12a is a schematic diagram of obtaining the optimal focal plane by calculating the Tenegrad evaluation function in another embodiment;

[0052] Figure 12b is a schematic diagram of obtaining the optimal focal plane by weighted fusion of two image clarity evaluation functions in another embodiment;

[0053] Figure 12c FIG. 1 is a schematic diagram of obtaining an optimal focal plane by calculating a Brenner gradient evaluation function in another embodiment;

[0054] Figure 13 is a structural block diagram of an automatic focusing device in one embodiment;

[0055] Figure 14 is a diagram of the internal structure of an electronic device in one embodiment;

[0056] Figure 15 is a structural block diagram of a shooting system in another embodiment;

[0057] Figure 16 A schematic diagram of absolute position information of Z-axis focusing in one embodiment;

[0058] Figure 17 Schematic diagram of the structure of a shooting device in one embodiment. DETAILED DESCRIPTION

[0059] To facilitate understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. The accompanying drawings provide embodiments of the present application. However, the present application may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make the disclosure of the present application more thorough and comprehensive.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application pertains. The terms used herein in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application.

[0061] It is to be understood that the terms "first" and "second" in this application are used to distinguish different objects rather than to describe a specific order.

[0062] When used herein, the singular forms "a", "an", and "the" may also include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, integers, steps, operations, components, parts, or combinations thereof, but do not preclude the possibility of the presence or addition of one or more other features, integers, steps, operations, components, parts, or combinations thereof.

[0063] At present, automatic focusing technology is an optomechanical and electromechanical intersection technology developed under the drive of machine intelligence and automation. It is widely used in daily life, scientific research, industrial production, military applications and other places where imaging is required. It is also a key technology in microscopic imaging systems. With the development of science and technology and the improvement of application requirements, the demand for automatic focusing technology with high precision, fast speed and good stability is becoming more and more urgent.

[0064] Since the early 20th century, domestic and foreign experts and scholars have conducted extensive research on automatic focusing technology, which has led to the rapid development of various theories and methods of automatic focusing technology. However, due to the diversity of imaging targets and test conditions, the automatic focusing technology in existing optical imaging systems is not very mature and needs to be improved.

[0065] In the field of assisted reproduction, the acquisition of multifocal plane data and the selection of the optimal focal plane for embryo observation are crucial factors in embryo analysis and evaluation. Designing a rational focusing algorithm to select the optimal focal plane in a multifocal stack image sequence along the embryo's Z axis has become a crucial issue.

[0066] In traditional technology, the current frame of image captured by the image collector is generally processed into blocks. Based on the clarity value of each block, the clarity value of each block is determined, and the intra-frame block weight of each block is determined. Then, based on the clarity change rate of each block in the current frame of image, the inter-frame block weight of each block in the current frame of image is determined. Finally, based on the intra-frame block weights and the inter-frame block weights, the target area in the current frame of image is determined and focused on. By adaptively adjusting the block weights, the target area in the current frame of image is determined, and the appropriate focus step size is selected to focus on the target area. For example, by acquiring multiple original images of culture dishes at different shooting heights, the image clarity of the area where the culture dishes are cut out of the original image is calculated, and the shooting height corresponding to the culture dish image with the highest clarity is used as the optimal shooting point.

[0067] However, the existing focusing methods have at least the following problems: ① In the focusing process, only the image clarity is considered, and the problem of whether the image with the highest clarity is related to the equatorial plane image of the embryo is ignored, resulting in the defect that the best focusing position obtained does not necessarily have all the embryo features contained in the equatorial plane; ② According to clinical experience, the best observation plane of the embryo is the equatorial plane of the embryo, and the best shooting reference plane for embryo imaging should also be in the equatorial plane of the embryo. The choice of the equatorial plane determines whether there is a problem of loss of key features of the embryo during embryo imaging. Therefore, the design of the automatic focusing algorithm for embryo imaging cannot rely solely on conventional clarity evaluation models for embryo images or culture dish images. When calculating the clarity, the issue of whether it is close to the equatorial plane should also be considered; ③ Over-reliance on the selection of the focusing window. If the focusing window is too large, the calculation amount will be large, and if the focusing window is too small, it will be easily interfered by random noise; ④ The method of layer-by-layer calculation is used to screen the best focal plane. Each time the second round of search is performed, it is necessary to reset and restart the scan. The search speed is slow, the operation is cumbersome and time-consuming; for the Timelapse incubator, the real-time and stability of the imaging system are crucial. Therefore, when designing the search algorithm and focusing structure, it is necessary to ensure the real-time and accuracy of the algorithm. At the same time, it is also necessary to take into account the impact of frequent exposure on the embryo, and the frequency and number of photos need to be controlled.

[0068] In order to improve the above technical problems raised in this application, the embodiments of this application provide an automatic focusing method and device, an electronic device and a shooting system, such as Figure 1 As shown, Figure 1 The process of acquiring multi-focal plane images of the embryo is to "slice" the embryonic cells in the culture dish by moving the Z axis of the imaging structure up and down to take pictures, and then obtain the embryo Z axis multi-focal images. Among them, the embryo F0 focal plane can refer to the embryo equatorial plane. The embryo Z axis multi-focal images are obtained by moving the imaging structure up and down at equal intervals of ΔZ and taking pictures. Figure 1The figure exemplifies the embryonic cell section images from the F30 focal plane to the F-30 focal plane (one-to-one correspondence with the embryonic Z-axis multifocal image stack sequence).

[0069] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0070] The automatic focusing method provided in the embodiment of the present application can be applied to Figure 2 In the shooting system shown, the electronic device 210 is in communication with the shooting device 220 to calculate the target focus position based on the image data captured by the shooting device 220. It should be noted that the electronic device 210 can refer to a server, processing device, processing platform, etc. capable of data exchange and processing; the shooting device 220 can refer to a device capable of capturing embryo images, such as a microscope.

[0071] In one embodiment, Figure 3 As shown, an automatic focusing method is provided, which is applied to Figure 2 The electronic device in FIG is taken as an example to illustrate, including the following steps:

[0072] S302, determining the coarse focus position of the shooting device, obtaining candidate embryo images shot by the shooting device at different focal planes based on the coarse focus position, and determining the target band area where the zona pellucida is located in the candidate embryo image, and the target area located inside the target band area.

[0073] Among them, the target band area where the transparent band is located can be set according to actual conditions. In the embodiment of the present application, the target band area is annular for example, and the target area is circular for example.

[0074] Among them, the shooting device may include a sliding platform, which can move along the X-axis, Y-axis and Z-axis directions. The electronic device can control the movement of the sliding platform to obtain image data on different focal planes, and the moving direction of the sliding platform can be set according to actual conditions; it should be noted that, in the embodiment of the present application, the electronic device controls the sliding platform to move along the Z-axis direction to obtain pre-selected embryo images on different focal planes.

[0075] Specifically, the electronic device controls the shooting device to adjust to the coarse focus position, and the electronic device controls the shooting device to move at equal intervals along the Z-axis direction while shooting, wherein the moving distance can be set according to actual conditions; the electronic device obtains the candidate embryo images on different focal planes, and then determines the target band area where the transparent zone in the candidate embryo image is located, and the target area located inside the target band area based on the candidate embryo image.

[0076] In one embodiment, the step of acquiring images of candidate embryos captured by a capturing device at different focal planes based on a coarse focus position includes:

[0077] A preset interval of the focal plane corresponding to the coarse focus position is selected, and a control parameter is output; the control parameter is used to instruct the shooting device to shoot within the preset interval to obtain a candidate embryo image.

[0078] Among them, the focal plane position interval corresponding to the preset interval is set according to the actual situation based on the coarse focus position; the control parameter can refer to the distance parameter (fine focus distance) used to instruct the sliding platform in the shooting device to move along the Z axis for equal spacing, and the control parameter can be set manually according to the actual situation.

[0079] Specifically, the electronic device selects the preset interval of the focal plane corresponding to the coarse focus position and outputs the control parameters to the shooting device. Based on the received control parameters, the shooting device controls the sliding platform to move at equal intervals along the Z-axis direction and shoot. The shooting device outputs the captured candidate embryo image to the electronic device.

[0080] To facilitate understanding by those skilled in the art, a specific example is provided below for explanation: the electronic device controls the sliding platform in the shooting device to start shooting along the 0µm scale on the Z axis, and sets the coarse focus distance to 10µm, that is, the sliding platform in the shooting device takes a shot every time it moves 10µm in the positive direction (negative direction) of the Z axis. A total of 20 pre-selected embryo images are shot, and the coarse adjustment clarity of each pre-selected embryo image is calculated and compared. When the coarse adjustment clarity of the fifth pre-selected embryo image is a maximum value, a preset interval is set to an area of 40µm to 60µm, the first round of focusing is completed, and the second round of focusing is started. The electronic device controls the sliding platform in the shooting device to start shooting along the 40µm scale on the Z axis, and sets the fine focus distance to 1µm, that is, the sliding platform in the shooting device takes a shot every time it moves 1µm in the positive direction (negative direction) of the Z axis. A total of 20 candidate embryo images are shot, and the shooting device outputs the candidate embryo images to the electronic device.

[0081] In the embodiment of the present application, a preset interval is determined based on the coarse focus position, which saves time for determining the subsequent target focus position and improves the accuracy of the subsequent target focus position determination.

[0082] In some examples, the step of the electronic device determining the target band region where the zona pellucida is located in the candidate embryo image and the target region located inside the target band region may include:

[0083] The embryo centroid position of the candidate embryo image is determined based on the candidate embryo image, and the pre-selected embryo image is segmented based on the segmentation template image and the embryo centroid position to obtain the target band area and the target area; wherein the segmentation template image is selected according to the actual situation; the segmentation template image has a standard centroid position and standard size parameters corresponding to the band area where the zona pellucida is located.

[0084] Among them, the embryo centroid position can refer to the center position of the embryo in the candidate embryo image; the segmentation template image can be selected according to different situations. For example, the segmentation template image can be obtained according to the target selection of the candidate focus; in the embodiment of the present application, the target band area is annular and the target area is circular, that is, the segmentation template image has a standard centroid position, corresponding to the inner circle radius parameter and the outer circle radius parameter of the band area where the transparent zone is located, and the inner circle radius parameter can also be used to segment the target area. In some examples, the segmentation template image can be as follows Figure 4a As shown, Figure 4a The position of the black cross in the figure corresponds to the center of mass of the embryo. Figure 4a The circular area inside the small and medium circles corresponds to the target area. Figure 4a The annular area between the small and medium circles and the large circle corresponds to the target strip area, and the image outside the large circle is an irrelevant background image.

[0085] Specifically, the electronic device performs subject positioning on the candidate embryo image, e.g. Figure 4b As shown, the main part of the candidate embryo image and the embryo centroid position are extracted, where Figure 4b The position of the black cross graphic in the image corresponds to the center of mass of the embryo; the electronic device selects the corresponding segmentation template image according to the embryo category to which the candidate embryo image belongs to segment the candidate embryo image to obtain the target strip area and the target area, and further, Figure 4c The target strip area is shown.

[0086] In some examples, the segmentation template image also includes an image corresponding to a culture dish in which no embryo is placed. At this time, the segmentation template image is used to focus on the bottom of the culture dish, and then quickly confirm the position of the bottom of the culture dish, so that even in the case of an empty dish, it can be in the clearest observation plane, which can assist the user in making quick judgments and performing other operations during the observation process, and ensure that the shooting system can guarantee the optimal observation plane in real time; that is, the present application segments the candidate embryo image based on the corresponding segmentation template image, and can selectively select the clearest area of the focus target (target strip area and target area), and discard irrelevant background parts, thereby reducing the error between the optimal focus position and the actual optimal focus position.

[0087] S304 : Calculate a first clarity of the target strip area using a first auto-focusing model, and calculate a second clarity of the target area based on a second auto-focusing model.

[0088] Among them, the first auto-focus model and the second auto-focus model can both refer to evaluation functions or operators that can calculate image clarity, such as Tenengrad evaluation function, Brenner gradient evaluation function, Laplace evaluation function, Deviation evaluation function, EOG evaluation function (Energy of Gradient, energy gradient evaluation function), SMD evaluation function (Sumof Modulus of gray Difference, grayscale variance evaluation function), Sobel operator, etc.; Figure 5 As shown, the first auto-focus model is used to calculate the first clarity of the target strip area, and the second clarity of the target area is calculated based on the second auto-focus model. In the embodiment of the present application, the first auto-focus model is a Tenengrad evaluation function, and the second auto-focus model is a Brenner gradient evaluation function as an example for illustration.

[0089] Furthermore, in the embodiment of the present application, two clarity evaluation algorithms (the first automatic focusing model and the second automatic focusing model) are selected for comprehensive judgment, which comprehensively considers the purpose of identifying different focusing targets. For example, the judgment of focusing on the zona pellucida mainly depends on the clarity of the edge, while the focusing on the inside of the embryo is mainly based on the rich feature information contained in the area, thereby reducing the error in selecting the optimal focal plane.

[0090] Specifically, the electronic device calculates the first clarity of the target strip area through the first auto-focus model, and then calculates the second clarity of the sampling area in the target area through the second auto-focus model. It should be noted that the sampling area in the target area is obtained by sampling the target area at equal intervals, wherein the specific interval distance can be set according to actual conditions; in the embodiment of the present application, Figure 6a As shown, the target area is sampled at equal intervals using the 9-point method. Figure 6a The black frame area is the corresponding sampling area. Further, Figure 6b Shows the target strip area and the corresponding sampling area for clarity calculation ( Figure 6b gray area in the .

[0091] In some examples, when taking images of the bottom of a culture dish without embryos, there is no area corresponding to the zona pellucida. Therefore, only the bottom of the culture dish needs to be focused and sampled at equal intervals. Figure 6a The black frame area is the corresponding sampling area. The electronic device only uses the Brenner gradient evaluation function to evaluate the sampling area, obtains the corresponding image clarity, and determines the target focus position based on the image clarity. That is, when focusing on the image of the bottom of the culture dish without embryos, only one round of focusing can be performed.

[0092] S306, calculating the fine-tuning clarity of the candidate embryo image according to the weight parameter, the first clarity and the second clarity, determining the changing trend of the fine-tuning clarity on different focal planes based on the coarse-tuning focus position, and obtaining the target focus position of the shooting device based on the changing trend of the fine-tuning clarity.

[0093] Among them, the weight parameter can refer to the parameter that can reflect the target band area where the transparent band is located, and the proportion of each target area in the fine-tuning clarity, which can be set according to actual conditions; the fine-tuning focus position can refer to the focus position corresponding to the maximum value of the fine-tuning clarity in the changing trend of the fine-tuning clarity.

[0094] Specifically, the electronic device calculates the fine-tuning clarity of the candidate embryo image based on the weight parameter, the first clarity and the second clarity, determines the changing trend of the fine-tuning clarity on different focal planes, and selects the focus position corresponding to the maximum value of the fine-tuning clarity as the fine-tuning focus position of the shooting device.

[0095] In one embodiment, the weight parameters include a first weight coefficient corresponding to the band-shaped area where the transparent band is located, and a second weight coefficient corresponding to the inner area of the band-shaped area.

[0096] The weight parameters can be obtained based on actual application scenarios and actual test results. The electronic device sets a first weight coefficient corresponding to the strip area where the transparent band is located, and a second weight coefficient corresponding to the inner area of the strip area.

[0097] In an embodiment of the present application, by setting appropriate first and second weight coefficients for different focusing areas, such separate calculations can make the screened optimal focal plane closer to the equatorial plane. Through the focusing test on the embryo, it is found that the clarity of the embryo's zona pellucida can be used to judge whether the current focal plane is in the embryo's equatorial plane. The clearer the edge of the zona pellucida, the closer the current focal plane is to the equatorial plane. When obtaining the clearest image of the zona pellucida edge, it is also necessary to ensure that the internal area of the zona pellucida is also in the clearest and most feature-information-rich focal plane. Selecting two different clarity evaluation functions (operators) for combination can not only ensure that the obtained optimal focal plane is close to the equatorial plane, but also ensure that the internal feature information is clearer for easy observation and analysis.

[0098] In one embodiment, the step of calculating the fine-tuning definition of the candidate embryo image according to the weight parameter, the first definition, and the second definition includes:

[0099] Calculating a first fine-tuning definition based on a first weight coefficient and the first definition;

[0100] Calculating a second fine-tuning definition according to a second weight coefficient and the second definition;

[0101] The sum of the first fine adjustment definition and the second fine adjustment definition is used as the fine adjustment definition.

[0102] Among them, the first fine-tuning clarity may refer to the image clarity corresponding to the target band area where the transparent zone is located in the candidate embryo image; the second fine-tuning clarity may refer to the image clarity corresponding to the target area located inside the target band area in the target embryo image.

[0103] Specifically, the electronic device multiplies the first weight coefficient and the first clarity to obtain the first fine-tuning clarity; the electronic device multiplies the second weight coefficient and the second clarity to obtain the second fine-tuning clarity; the electronic device uses the sum of the first fine-tuning clarity and the second fine-tuning clarity as the fine-tuning clarity.

[0104] In the embodiment of the present application, by setting appropriate first weight coefficients and second weight coefficients for different focus areas and performing corresponding image clarity calculations, the speed of clarity calculation is optimized and the accuracy of clarity calculation is guaranteed.

[0105] In one embodiment, the step of determining a coarse focus position of a camera device includes:

[0106] Acquire preselected embryo images captured by a camera at different focal planes, and determine a strip-shaped area to be processed where the zona pellucida is located in the preselected embryo image, and a strip-shaped area to be processed located inside the strip-shaped area to be processed;

[0107] Calculating a third definition of the strip area to be processed using the first auto-focus model, and calculating a fourth definition of the strip area to be processed based on the second auto-focus model;

[0108] The coarse adjustment clarity of the preselected embryo image is calculated according to the weight parameter, the third clarity and the fourth clarity, the variation trend of the coarse adjustment clarity on different focal planes is determined, and the coarse adjustment focus position of the shooting device is determined based on the variation trend of the coarse adjustment clarity.

[0109] Among them, the strip area to be processed where the transparent band is located can be set according to actual conditions. In the embodiment of the present application, the strip area to be processed is a ring-shaped area as an example for explanation, and the area to be processed is a circle as an example for explanation.

[0110] Among them, the weight parameter can refer to a parameter that can reflect the strip area to be processed where the transparent band is located, and the proportion of each area to be processed in the coarse adjustment clarity, which can be set according to actual conditions; the coarse adjustment focus position can refer to the focus position corresponding to the maximum value of the coarse adjustment clarity in the changing trend of the coarse adjustment clarity.

[0111] Specifically, the electronic device controls the shooting device to perform zero point reset. After the shooting device completes the zero point reset, the electronic device controls the shooting device to shoot while controlling the shooting device to move at equal intervals along the Z-axis direction, wherein the moving distance can be set according to actual conditions; the electronic device obtains the preselected embryo images on different focal planes, and then determines the strip area to be processed where the transparent zone in the preselected embryo image is located, and the area to be processed located inside the strip area to be processed based on the preselected embryo image.

[0112] In some examples, the step of determining the to-be-processed zone region where the zona pellucida is located in the preselected embryo image and the to-be-processed zone located inside the to-be-processed zone region includes:

[0113] The embryo centroid position of the preselected embryo image is determined based on the preselected embryo image, and the preselected embryo image is segmented based on the segmentation template image and the embryo centroid position to obtain a strip region to be processed and a region to be processed.

[0114] Specifically, the electronic device locates the main body of the preselected embryo image and extracts the main part of the preselected embryo image and the position of the embryo's center of mass; the electronic device selects a corresponding segmentation template image according to actual conditions to segment the preselected embryo image and obtains a strip area to be processed and an area to be processed; it should be noted that, in the embodiment of the present application, the preselected embryo image and the candidate embryo image are embryo images obtained from the same embryonic cell at different focal planes, and the segmentation template images corresponding to the preselected embryo image and the candidate embryo image are the same.

[0115] Furthermore, the electronic device calculates the third clarity of the strip area to be processed by the first autofocus model, and then calculates the fourth clarity of the sampling area in the area to be processed by the second autofocus model. It should be noted that the sampling area in the area to be processed is obtained by performing equal-interval sampling on the area to be processed, wherein the specific interval distance can be set according to actual conditions; in the embodiment of the present application, the area to be processed is sampled at equal intervals using the 9-point method to obtain the sampling area in the area to be processed, such as Figure 6a As shown, Figure 6a The black frame area is the corresponding sampling area. Further, Figure 6b Shows the strip area to be processed and the corresponding sampling area that needs to be calculated for clarity ( Figure 6b gray area in the .

[0116] The electronic device calculates the coarse adjustment clarity of the preselected embryo image based on the weight parameter, the third clarity and the fourth clarity, determines the change trend of the coarse adjustment clarity on different focal planes, and selects the focus position corresponding to the maximum value of the coarse adjustment clarity as the coarse adjustment focus position of the shooting device.

[0117] In one embodiment, the step of calculating the coarse definition of the preselected embryo image according to the weight parameter, the third definition, and the fourth definition comprises:

[0118] Calculating a first coarse adjustment definition based on the first weight coefficient and the third definition;

[0119] Calculating a second coarse adjustment definition according to the second weight coefficient and the fourth definition;

[0120] The sum of the first coarse adjustment definition and the second coarse adjustment definition is used as the coarse adjustment definition.

[0121] Among them, the first coarse adjustment clarity may refer to the image clarity corresponding to the strip area to be processed where the transparent zone is located in the preselected embryo image; the second coarse adjustment clarity may refer to the image clarity corresponding to the area to be processed located inside the strip area to be processed in the preselected embryo image.

[0122] Specifically, the electronic device multiplies the first weight coefficient and the third clarity to obtain a first coarse adjustment clarity; the electronic device multiplies the second weight coefficient and the fourth clarity to obtain a second coarse adjustment clarity; and the electronic device uses the sum of the first coarse adjustment clarity and the second coarse adjustment clarity as the coarse adjustment clarity.

[0123] In the embodiment of the present application, by setting appropriate first weight coefficients and second weight coefficients for different focus areas and performing corresponding image clarity calculations, the speed of clarity calculation is optimized and the accuracy of clarity calculation is guaranteed.

[0124] To facilitate understanding by those skilled in the art, a specific example is given below: Figure 7 A flowchart of an automatic focusing method is exemplarily shown, wherein the sliding platform can refer to a Z-axis moving platform; a set of embryo multi-focal plane data can refer to preselected embryo images or candidate embryo images on different focal planes; the embryo image can refer to a preselected embryo image or a candidate embryo image; the transparent zone area can refer to a strip area to be processed or a target strip area; the inner area of the transparent zone can refer to an area to be processed or a target area; the clarity evaluation score W can refer to a first clarity; the clarity evaluation score V can refer to a second clarity; the overall clarity score S can refer to fine-tuning clarity; a can refer to a second weight coefficient, and b can refer to a first weight coefficient; the peak interval where the peak search S (max) optimal focal plane is located can refer to determining the coarse-tuning focus position of the shooting device based on the changing trend of the coarse-tuning clarity, and determining a preset interval based on the coarse-tuning focus position; the peak search S (max) optimal focal plane can refer to determining the target focus position of the shooting device based on the changing trend of the fine-tuning clarity.

[0125] In some examples, the process of the electronic device performing the second round of focusing calculation can be: the electronic device controls the shooting device to take a picture every 2 μm, and takes a total of 50 images. The shooting process is from the upper surface of the mouse embryo to the equatorial plane, and then from the equatorial plane to the lower surface. The electronic device obtains 50 mouse embryo images, and selects the Tenegrad evaluation function to calculate the focus clarity evaluation score W of the zona pellucida, and the Brenner gradient evaluation function to calculate the focus clarity evaluation score V of the inner sampling area of the zona pellucida, and calculates the overall clarity score S with each weight coefficient of 0.5 (the weight coefficient in this calculation is only used for the mouse embryo focusing in this example, and the weight coefficient needs to be readjusted for other focusing targets).

[0126] Specifically, if Figure 8 As shown, Figure 8 The dotted line in the figure shows the relationship between the overall clarity score S and the Z-axis movement position. Figure 8The two solid lines in the figure represent the changing relationship between the focus clarity evaluation score W and the Z-axis movement position, and the changing relationship between the focus clarity evaluation score V and the Z-axis movement position, respectively. The peak value corresponding to each curve indicates the position of the selected optimal focal plane, among which the Z-axis movement position can be represented by the corresponding Z-axis stack image sequence (embryo Z-axis stack image sequence).

[0127] Further, if Figure 9 The image shows 50 mouse embryo images, with the corresponding overall clarity score (S) displayed below each image. The image with an overall clarity score of 55.8108 corresponds to the focal plane selected based on zona pellucida focusing, the image with an overall clarity score of 59.8375 corresponds to the focal plane selected based on the sampling area within the zona pellucida, and the image with an overall clarity score of 60.3676 corresponds to the optimal focal plane (target focus position) determined after weighted calculation. Compared to the other two images, the image with an overall clarity score of 60.3676 is closer to the equatorial plane of the embryonic cells.

[0128] Figure 10a Displays the image of the optimal focal plane calculated by the Tenegrad evaluation function. Figure 10c Displays the image of the optimal focal plane calculated by the Brenner gradient evaluation function. Figure 10b It is the image of the best focal plane obtained by weighted fusion of the two image clarity evaluation functions. From the perspective of the overall clarity of the image, Figure 10b Relatively high clarity, Figure 10b The edge of the middle zone of pellucidity is larger and closer to the equatorial plane.

[0129] In other examples, the process of the electronic device performing the second round of focus calculation can also be: the electronic device controls the shooting device to shoot a picture every 1 μm, and shoots a total of 100 images. The shooting process is from the upper surface of the mouse embryo to the equatorial plane, and then from the equatorial plane to the lower surface. The electronic device obtains 100 mouse embryo images, and selects the Tenegrad evaluation function to calculate the focus clarity evaluation score W of the zona pellucida, and the Brenner gradient evaluation function to calculate the focus clarity evaluation score V of the sampling area inside the zona pellucida, and calculates the overall clarity score S with a weight coefficient of 0.5 for each (the weight coefficient in this calculation is only used for the mouse embryo focus in this example, and the weight coefficient needs to be readjusted for other focusing targets). Figure 11 As shown, Figure 11 The dotted line in the figure shows the relationship between the overall clarity score S and the Z-axis movement position. Figure 11The two solid lines in the figure represent the changing relationship between the focus clarity evaluation score W and the Z-axis movement position, and the changing relationship between the focus clarity evaluation score V and the Z-axis movement position, respectively. The peak value corresponding to each curve indicates the position of the selected optimal focal plane, where the Z-axis movement position can be represented by the corresponding Z-axis stack image sequence.

[0130] Specifically, Figure 11 The optimal focal plane calculated by the Tenegrad evaluation function is F37, while the optimal focal plane calculated by the Brenner gradient evaluation function is F45. The difference between the two is 8µm. After weighted fusion of the two image clarity evaluation functions, the optimal focal plane is 42. From the perspective of the selected strategy, the optimal focal plane obtained after weighted fusion is a trade-off between the two calculation methods. Figure 12a Displays the image of the optimal focal plane calculated by the Tenegrad evaluation function. Figure 12c Displays the image of the optimal focal plane calculated by the Brenner gradient evaluation function. Figure 12b It is the image of the best focal plane obtained by weighted fusion of the two image clarity evaluation functions. From the perspective of the overall clarity of the image, Figure 12b The overall effect will be better.

[0131] In the above-mentioned automatic focusing method, after adjusting the shooting device to the coarse focus position, the first automatic focusing model is used to calculate the first clarity of the target strip area, and the second clarity of the target area is calculated based on the second automatic focusing model; the fine-tuning clarity of the candidate embryo image is calculated according to the weight parameter, the first clarity and the second clarity, and the target focus position of the shooting device is obtained based on the change trend of the fine-tuning clarity; the focus clarity of different areas is calculated by combining different automatic focusing models, and the target focus position is obtained by weighted calculation, thereby ensuring that the target focus position is close to the equatorial plane and the error between it and the actual optimal focus position is small.

[0132] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed 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 portion of steps or stages in other steps.

[0133] Based on the same inventive concept, embodiments of the present application also provide an autofocus device for implementing the aforementioned autofocus method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more of the following autofocus device embodiments can be found in the above-described limitations of the autofocus method and are not further elaborated here.

[0134] In one embodiment, Figure 13 As shown, an automatic focusing device 1300 is provided, comprising: a target image acquisition module 1301, a clarity acquisition module 1302 and a position acquisition module 1303, wherein:

[0135] The target image acquisition module 1301 is configured to determine a coarse focus position of a camera, acquire candidate embryo images captured by the camera at different focal planes based on the coarse focus position, and determine a target band-shaped region where the zona pellucida is located in the candidate embryo image, as well as a target region located inside the target band-shaped region.

[0136] A clarity acquisition module 1302 is configured to calculate a first clarity of a target strip region using a first auto-focusing model, and calculate a second clarity of the target region based on a second auto-focusing model;

[0137] The position acquisition module 1303 is used to calculate the fine-tuning clarity of the candidate embryo image based on the weight parameter, the first clarity and the second clarity, determine the changing trend of the fine-tuning clarity on different focal planes based on the coarse-tuning focus position, and obtain the target focus position of the shooting device based on the changing trend of the fine-tuning clarity.

[0138] In one embodiment, the target image acquisition module 1301 is used to acquire preselected embryo images on different focal planes captured by a photographing device, and determine the to-be-processed band region where the zona pellucida is located in the preselected embryo image, and the to-be-processed region located inside the to-be-processed band region;

[0139] Calculating a third definition of the strip area to be processed using the first auto-focus model, and calculating a fourth definition of the strip area to be processed based on the second auto-focus model;

[0140] The coarse adjustment clarity of the preselected embryo image is calculated according to the weight parameter, the third clarity and the fourth clarity, the variation trend of the coarse adjustment clarity on different focal planes is determined, and the coarse adjustment focus position of the shooting device is determined based on the variation trend of the coarse adjustment clarity.

[0141] In one embodiment, the weight parameters include a first weight coefficient corresponding to the band-shaped area where the transparent band is located, and a second weight coefficient corresponding to the inner area of the band-shaped area.

[0142] In one embodiment, the position acquisition module 1303 is configured to calculate a first fine-tuning definition based on a first weight coefficient and a first definition;

[0143] Calculating a second fine-tuning definition according to a second weight coefficient and the second definition;

[0144] The sum of the first fine adjustment definition and the second fine adjustment definition is used as the fine adjustment definition.

[0145] In one embodiment, the position acquisition module 1303 is further configured to calculate a first coarse adjustment definition based on the first weight coefficient and the third definition;

[0146] Calculating a second coarse adjustment definition according to the second weight coefficient and the fourth definition;

[0147] The sum of the first coarse adjustment definition and the second coarse adjustment definition is used as the coarse adjustment definition.

[0148] In one embodiment, the target image acquisition module 1301 is further used to select a preset interval where the focal plane corresponding to the coarse focus position is located and output a control parameter; the control parameter is used to instruct the shooting device to shoot within the preset interval to obtain a candidate embryo image.

[0149] Each module in the aforementioned autofocus device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0150] In one embodiment, an electronic device is provided. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 14 As shown. The electronic device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the electronic device is used to store image data. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an automatic focusing method is implemented.

[0151] Those skilled in the art will understand that Figure 14 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 shown in the figure, or combine certain components, or have a different component arrangement.

[0152] In one embodiment, a shooting system is provided, which includes an electronic device and a shooting device communicatively connected to the electronic device, wherein the shooting device is configured with an imaging component, a linear sliding platform and a motor; the imaging component and the motor are both communicatively connected to the electronic device, and the linear sliding platform is respectively connected to the motor and the imaging component; the motor drives the linear sliding platform to move under the control of the electronic device; and the electronic device controls the imaging component to shoot.

[0153] Specifically, if Figure 15 As shown, the electronic device may include an MCU control unit and a focusing algorithm and instrument software control unit; the imaging component may include a light source, an objective lens and a camera; and the sliding platform may include a linear sliding platform.

[0154] In actual applications, the MCU control unit can first reset the zero point by controlling the motor to drive the linear sliding platform, and then the light source illuminates the culture dish. After the light passes through the embryo in the culture dish, it passes through the objective lens and is finally imaged in the camera. After the linear sliding platform is reset, the instrument software control unit triggers the camera to take pictures, and at the same time, the MCU control unit controls the motor to drive the linear sliding platform to move at equal intervals. After the movement is completed, the focusing algorithm control unit selects the best focal plane for the acquired image data, and finally feeds back the best focusing position to the MCU control unit based on the judgment result. The MCU control unit controls the motor to drive the linear sliding platform for focusing.

[0155] Further, if Figure 16 As shown, in order to obtain a clear image, the camera needs to focus on and image the embryo in each microwell. There are multiple microwells in a culture dish, and an embryo is placed in each microwell for culture. The camera will take pictures of each microwell or the embryo in the microwell. The maximum movable range of the linear sliding platform along the Z axis is 6mm, the microstep of a single grid can be 1μm, the repeatability can be 1μm, and the positioning accuracy can be 1μm. In addition, when recording the focal plane of each embryo's imaging, the MCU control unit can record the absolute position information of each Z-axis focus after the focus is completed, so as to facilitate the rapid completion of focus imaging during the cyclic shooting process. The absolute position information of the Z-axis focus can include each focal length on the Z axis and the corresponding clarity score at each focal length, such as Figure 16 As shown, it can be recorded from start to end, and max can be the optimal focal plane.

[0156] In the embodiment of the present application, by selecting a linear sliding platform, the time requirement for rapid focusing is guaranteed, and the accuracy requirement for focusing is met; in addition, by storing the absolute position information of each Z-axis focusing, it can flexibly adapt to the user's requirements for different focal planes and provide a reasonable reference range for the user to manually adjust the focal length.

[0157] In one embodiment, a grating ruler and a zero position sensor are mounted on the linear sliding platform;

[0158] The grating ruler and the zero position sensor are connected to the electronic device for communication, and the grating ruler and the zero position sensor are used to feed back the moving distance of the linear sliding platform to the electronic device.

[0159] Specifically, if Figure 17 As shown, the shooting device can be a microscope and can also be equipped with a condenser, wherein the light source can be a red LED backlight light source, the camera can be a high-resolution camera, the objective lens can be a Hoffman module phase contrast objective lens, and the motor can be a servo motor or a stepper motor; in addition, the microscope is also configured with a camera imaging surface and the position of the culture dish is marked.

[0160] In an embodiment of the present application, in order to further control the focusing accuracy, a grating scale and a zero position sensor are installed on the shooting equipment. The ranging function of the grating scale can compensate for the movement error of the linear sliding platform, and the zero position sensor can assist in the rapid resetting of the linear sliding platform.

[0161] It should be noted that the embryo images (including but not limited to pre-selected embryo images, candidate embryo images, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0162] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. 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 above-mentioned embodiments. In particular, any reference to memory, 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, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0163] The technical features of the above embodiments can be combined arbitrarily. 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.

[0164] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. An automatic focusing method, characterized in that: Applied to an electronic device, the electronic device is communicatively connected to a photographing device, and the method includes: determining a coarse focus position of the photographing device, acquiring candidate embryo images taken by the photographing device at different focal planes based on the coarse focus position, and determining a target band-shaped area where the zona pellucida is located in the candidate embryo image, and a target area located inside the target band-shaped area; Calculating a first definition of the target strip area using a first auto-focusing model, and calculating a second definition of the target area based on a second auto-focusing model; Calculating the fine-tuning clarity of the candidate embryo image based on a weight parameter, the first clarity, and the second clarity, determining a change trend of the fine-tuning clarity at different focal planes based on the coarse-tuning focus position, and obtaining a target focus position of the photographing device based on the change trend of the fine-tuning clarity; the weight parameter includes a first weight coefficient corresponding to a band-shaped area where the zona pellucida is located, and a second weight coefficient corresponding to an inner area of the band-shaped area; The step of determining the coarse focus position of the shooting device includes: Acquire preselected embryo images on different focal planes captured by the photographing device, and determine a strip-shaped area to be processed where the zona pellucida is located in the preselected embryo images, and a strip-shaped area to be processed located inside the strip-shaped area to be processed; Calculating a third definition of the strip-shaped area to be processed using a first auto-focusing model, and calculating a fourth definition of the area to be processed based on a second auto-focusing model; The coarse adjustment clarity of the preselected embryo image is calculated according to the weight parameter, the third clarity and the fourth clarity, the change trend of the coarse adjustment clarity on different focal planes is determined, and the coarse adjustment focus position of the shooting device is determined based on the change trend of the coarse adjustment clarity.

2. The method according to claim 1, characterized in that The step of calculating the fine-tuning clarity of the candidate embryo image according to the weight parameter, the first clarity, and the second clarity comprises: Calculating a first fine-tuning definition based on the first weight coefficient and the first definition; Calculating a second fine-tuning definition according to the second weight coefficient and the second definition; The sum of the first fine adjustment definition and the second fine adjustment definition is used as the fine adjustment definition.

3. The method according to claim 1, characterized in that The step of calculating the coarse adjustment clarity of the preselected embryo image according to the weight parameter, the third clarity and the fourth clarity comprises: Calculating a first coarse adjustment definition based on the first weight coefficient and the third definition; Calculating a second coarse adjustment definition according to the second weight coefficient and the fourth definition; The sum of the first coarse adjustment definition and the second coarse adjustment definition is used as the coarse adjustment definition.

4. The method according to any one of claims 1 to 3, characterized in that The step of acquiring the candidate embryo images captured by the shooting device at different focal planes based on the coarse focus position comprises: A preset interval in which the focal plane corresponding to the coarse focus position is located is selected, and a control parameter is output; the control parameter is used to instruct the shooting device to shoot within the preset interval to obtain the candidate embryo image.

5. An automatic focusing device, characterized in that: Applied to an electronic device, the electronic device is communicatively connected to a photographing device, and the device includes: a target image acquisition module, configured to determine a coarse focus position of the photographing device, acquire candidate embryo images taken by the photographing device at different focal planes based on the coarse focus position, and determine a target band-shaped area where the zona pellucida is located in the candidate embryo image, and a target area located inside the target band-shaped area; a definition acquisition module, configured to calculate a first definition of the target strip area using a first auto-focusing model, and calculate a second definition of the target area based on a second auto-focusing model; a position acquisition module, configured to calculate the fine-tuning clarity of the candidate embryo image based on a weight parameter, the first clarity, and the second clarity, determine a changing trend of the fine-tuning clarity at different focal planes based on the coarse-tuning focus position, and acquire a target focus position of the photographing device based on the changing trend of the fine-tuning clarity; the weight parameter comprising a first weight coefficient corresponding to a band-shaped region where the zona pellucida is located, and a second weight coefficient corresponding to an inner region of the band-shaped region; Among them, the target image acquisition module is also used to obtain the pre-selected embryo images on different focal planes shot by the shooting device, determine the strip area to be processed where the transparent zone is located in the pre-selected embryo image, and the area to be processed located inside the strip area to be processed; use the first automatic focusing model to calculate the third clarity of the strip area to be processed, and calculate the fourth clarity of the area to be processed based on the second automatic focusing model; calculate the coarse adjustment clarity of the pre-selected embryo image according to the weight parameter, the third clarity and the fourth clarity, determine the change trend of the coarse adjustment clarity on different focal planes, and determine the coarse adjustment focus position of the shooting device based on the change trend of the coarse adjustment clarity.

6. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the automatic focusing method according to any one of claims 1 to 4 is implemented.

7. A shooting system, characterized in that: The electronic device according to claim 6 and a photographing device communicatively connected to the electronic device, wherein the photographing device is configured with an imaging component, a linear sliding platform and a motor; The imaging component and the motor are both communicatively connected to the electronic device, and the linear sliding platform is respectively connected to the motor and the imaging component; The motor drives the linear sliding platform to move under the control of the electronic device; and the electronic device controls the imaging component to shoot.

8. The shooting system according to claim 7, wherein: A grating ruler and a zero position sensor are installed on the linear sliding platform; The grating ruler and the zero position sensor are in communication with the electronic device, and the grating ruler and the zero position sensor are used to feed back the moving distance of the linear sliding platform to the electronic device.

Citation Information

Patent Citations

  • Automatic focusing method and device thereof and electronic equipment

    CN111641781A

  • Automatic focusing method and device, electronic equipment and storage medium

    CN115567778A