Fluorescent biological cell photography precise focusing method, device and storage medium thereof

By combining image gradient and contrast focusing methods, the problem of unclear focusing and slow speed in existing focusing algorithms when the slide samples are sparse is solved, and a more accurate and faster focusing effect is achieved.

CN118890548BActive Publication Date: 2025-02-25SHENZHEN SHENGQIANG TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411375432.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-02-25
Estimated Expiration
2044-09-30

AI Technical Summary

Technical Problem

Existing focusing algorithms for fluorescent biological cell imaging are insufficient to meet the requirement of clear focus in sparse slide samples, and suffer from problems such as focusing failure, large computational load, slow focusing speed, and misjudgment.

Method used

By acquiring a focused image, calculating the optimal focus height using image gradients, and combining it with contrast focusing as a supplementary method, precise focusing is achieved.

Benefits of technology

It improves focusing accuracy and speed, reduces computational load, enhances focusing reliability, adapts to sparse sample conditions, and avoids focusing errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118890548B_ABST
    Figure CN118890548B_ABST
Patent Text Reader

Abstract

The present application proposes a method, device and storage medium for precise focusing of fluorescent biological cell photography, including first determining the acquisition parameters of the captured image, generating and saving the region of interest using bilinear interpolation. Capture images from the initial focus position, extract images of the specified position of the region of interest, and perform noise suppression and gradient calculation. A new image is obtained with the image gradient and the processed image as specific weights, and the statistical value score is calculated and cached. Adjust the focus height and repeat the operation to complete the image sequence, and select the optimal focus height index position by the hill climbing method. If it is 0 or the maximum index value, the coarse focus is repeated for the complete focus. After determining the image index, contrast focus is used as a supplementary solution for the range of [index‑2,index+2], including steps such as splitting the region of interest and calculating the contrast value, and finally selecting the maximum value index as the optimal focus height. This method improves the focus accuracy of fluorescent biological cell photography and adapts to the needs of different samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of fluorescent biological cell photography, and in particular to a method and device for precise focusing of fluorescent biological cell photography and a storage medium thereof. Background Art

[0002] In the field of fluorescent biological cell photography, clear focus is crucial for obtaining high-quality sample images. However, there are many problems with the existing focus algorithms. The focus algorithms written by the previous system mainly include full-image focus and fixed or manual ROI area focus when shooting natural images. The fixed area focus method is prone to focus failure due to the absence of samples in the ROI area; the full-image gradient-dependent focus is easily affected by impurities and background. On the one hand, it is easy to cause the highest focus score to stay on the impurities, causing some focus points to focus incorrectly. On the other hand, the relative amount of calculation is too large, resulting in a long focusing process, and then fitting the wrong surface when fitting the focus height through the focus point, affecting the accuracy of the slide scanning. Contrast focus determines the focus position by evaluating the grayscale level changes in different areas of the image, but it is sensitive to noise and is prone to misjudgment when the image is noisy or the contrast is low. It has good adaptability only in images with high contrast. The judgment of texture based on image gradient has less dependence on lighting conditions and noise. However, when close to the correct focus position, image gradient focus cannot select the best focus distance when the background is used as the gradient weight.

[0003] In summary, the existing focusing algorithms are difficult to meet the requirements of sparse glass slide samples but clear focus in fluorescent biological cell photography. Summary of the invention

[0004] The embodiments of the present application provide a method, device and storage medium for precise focusing of fluorescent biological cell photography, which aims to solve the problems of unsatisfactory focusing effect and slow focusing speed existing in the current technology.

[0005] The core technology of the present invention is to obtain the best focus height sequence by collecting the focus image and calculating the image gradient using the fixed ROI image, and then use contrast focus as a supplementary solution in a specific range after determining the image index to achieve precise focus of fluorescent biological cell shooting.

[0006] In a first aspect, the present application provides a method for accurately focusing fluorescent biological cells, the method comprising the following steps:

[0007] S00, determining acquisition parameter information of the captured image, generating a region of interest with a set distribution, and saving it to a variable with a life cycle in the entire shooting and focusing process for image focusing operation;

[0008] S10, collecting an image from the initial focus position, marking it as a base image, and caching it in a set image sequence set;

[0009] S20, extracting the designated position image of the region of interest from the basic image, performing noise suppression processing on each region of interest to obtain a noise-suppressed image;

[0010] S30, performing gradient calculation on the noise suppressed image to obtain image gradient information;

[0011] S40, taking the image gradient information and the image after noise suppression as specific weights to obtain a new image, calculating the statistical values ​​of the new images of all regions of interest as scores, and saving them to a storage unit indexed corresponding to the image sequence set for caching;

[0012] S50, adjusting the focus height, acquiring a new image and caching it at the corresponding image sequence set index;

[0013] S60, looping steps S20-S50 until the image sequence is completed;

[0014] S70, selecting the index position of the best focus height in the image sequence as the best focal length to complete focusing.

[0015] Further, in step S70, the index position of the best focus height is selected by the hill climbing method and recorded as index. If the index is 0 or the maximum index value, the focus height is adjusted and a complete focus operation is repeated during the rough focusing process of the hill climbing method.

[0016] Furthermore, in step S00, a region of interest with a set interval is generated by bilinear interpolation and saved in a variable whose life cycle is the entire focusing process for image focusing.

[0017] Furthermore, when the image index is determined, the range of the index is set and contrast focusing is performed again as a supplementary solution.

[0018] Furthermore, the specific steps of using contrast focusing as a supplementary solution are as follows:

[0019] Split the region of interest into multiple small blocks and determine the step size parameters of each small block;

[0020] Calculate the contrast value of each small block along the X and Y directions respectively to reduce the influence of background noise, perform integration operation in each small block and make a difference between the left and right sides, and record the contrast value as the middle value;

[0021] After calculating the contrast values ​​of the small blocks in sequence with the set step length, the maximum value of the middle values ​​is recorded as the maximum middle value and accumulated into the comprehensive score;

[0022] When the maximum value reaches a specific value, the next small block is compared, and the above operation is repeated until all small blocks are calculated, thereby obtaining the contrast scores in the X and Y directions;

[0023] Repeat the above operation for all the regions of interest in the image, and add the obtained contrast score values ​​to the comprehensive contrast score to obtain the contrast score of the image;

[0024] Add the final contrast value to the score of the corresponding index in step S40 to obtain a comprehensive focusing result, and save it to the corresponding index;

[0025] The above operations are performed sequentially for all index values ​​in the index setting range to complete the score calculation of the corresponding index value of the supplementary solution;

[0026] The maximum value among the index values ​​of the supplementary solutions is directly selected as the optimal focus height.

[0027] Furthermore, the range of the index setting is [index-2, index+2], and the index is the index position of the best focus height selected by the hill climbing method.

[0028] Further, the region of interest is split into 8X8 small blocks, and the step size of each small block is recorded as step_y and step_x, the size of step_y is roi_height / 8+1, indicating the x direction, the size of step_y is roi_width / 8+1, indicating the y direction, roi_height is the height of the region of interest, and roi_width is the width of the region of interest.

[0029] In a second aspect, the present application provides a method and device for accurately focusing fluorescent biological cell photography, including:

[0030] The parameter confirmation module determines the acquisition parameter information of the captured image, generates a region of interest with a set distribution, and saves it in a variable with a life cycle during the entire shooting and focusing process for image focusing operations;

[0031] The image sequence collection module collects images from the initial focus position, marks them as basic images, and caches them in the set image sequence collection; extracts the designated position images of the region of interest from the basic image, performs noise suppression on each region of interest, and obtains the noise-suppressed image; performs gradient calculation on the noise-suppressed image to obtain image gradient information; uses the image gradient information and the noise-suppressed image as specific weights to obtain a new image, calculates the statistical values ​​of the new images of all regions of interest as scores, and saves them to the storage unit with the index corresponding to the image sequence collection for caching; adjusts the focus height, collects new images, and caches them at the corresponding image sequence collection index until the image sequence is completed;

[0032] The selection module selects the index position of the best focus height in the image sequence as the best focal length to complete the focusing.

[0033] In a third aspect, the present application provides an electronic device including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the above-mentioned precise focusing method for fluorescent biological cell photography.

[0034] In a fourth aspect, the present application provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute a process. The process includes the precise focusing method for photographing fluorescent biological cells according to the above-mentioned method.

[0035] The main contributions and innovations of the present invention are as follows:

[0036] 1. Improve focusing accuracy:

[0037] By combining image gradient focusing and contrast focusing, the limitations of a single focusing method are overcome. When approaching the correct focus position, multiple factors are comprehensively considered to avoid focus errors caused by impurities, background noise, etc., and the optimal focus height can be found more accurately, making the images taken of fluorescent biological cells clearer.

[0038] 2. Reduce the amount of calculation and increase the focusing speed:

[0039] The bilinear interpolation method is used to generate the region of interest, which reduces the amount of calculation in the focusing process without downsampling and improves the overall focusing speed. At the same time, through reasonable focusing steps and algorithm optimization, unnecessary calculations are reduced and the efficiency of the system is improved.

[0040] 3. Adapting to sparse samples:

[0041] It is especially optimized for the situation where the slide samples are sparse, avoiding the focus failure of fixed area focus caused by the absence of samples in the ROI area, and can better meet the needs of fluorescent biological cell photography.

[0042] 4. Enhance the reliability of focus:

[0043] When the optimal focus height index position selected by the hill climbing method is a boundary value, the complete focusing process is repeated through coarse focusing, which increases the reliability of focusing. At the same time, contrast focusing is used as a supplementary solution to further improve the accuracy and stability of focusing.

[0044] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0046] Figure 1 is a flow chart of a method for accurately focusing fluorescent biological cells according to an embodiment of the present application;

[0047] Figure 2 It is a schematic diagram of focusing effect of the prior art;

[0048] Figure 3 is a diagram showing the effect of focusing according to an embodiment of the present application;

[0049] Figure 4 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0051] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0052] Embodiment 1

[0053] This application aims to propose a method for accurately focusing fluorescent biological cells. Specifically, refer to Figure 1 , the method comprises the following steps:

[0054] S00, determining acquisition parameter information of the captured image, generating a region of interest with a set distribution, and saving it to a variable with a life cycle in the entire shooting and focusing process for image focusing operation;

[0055] S10, collecting an image from the initial focus position, marking it as a base image, and caching it in a set image sequence set;

[0056] S20, extracting the designated position image of the region of interest from the basic image, performing noise suppression processing on each region of interest to obtain a noise-suppressed image;

[0057] S30, performing gradient calculation on the noise suppressed image to obtain image gradient information;

[0058] S40, taking the image gradient information and the image after noise suppression as specific weights to obtain a new image, calculating the statistical values ​​of the new images of all regions of interest as scores, and saving them to a storage unit indexed corresponding to the image sequence set for caching;

[0059] S50, adjusting the focus height, acquiring a new image and caching it at the corresponding image sequence set index;

[0060] S60, looping steps S20-S50 until the image sequence is completed;

[0061] S70, selecting the index position of the best focus height in the image sequence as the best focal length to complete focusing.

[0062] In actual operation, the first step is to acquire a focused image and calculate the image gradient by a fixed ROI (roi) image to obtain the best focus height sequence:

[0063] A1. Determine the width and height information of the focused image, generate a certain interval of roi area through bilinear interpolation, and save it to the variable rois whose life cycle is the entire focusing process for image focusing. In practical applications, this processing method reduces the amount of calculation in the focusing process and improves the overall focusing speed without downsampling.

[0064] A2. Collect a focus image from the initial focus height, record it as I, and cache it in the focus sequence diagram Is.

[0065] A3. Take the image of the specified position area in rois of image I, perform 3x3 Gaussian blur processing on each roi to suppress the obvious image noise and obtain image G.

[0066] A4. Calculate the gradient of the image G and obtain the image gradient, which is recorded as gradient.

[0067] A5. Take the image gradient gradient and G as a certain weight of the gradient, get a new image, calculate the statistics of the new image of all roi regions (different statistics will be calculated for a single roi region), such as the sum of the mean and variance of the image as the score, record it as score, and save it to the scores with the same index as the image sequence for cache. Different statistical values ​​reflect the features of the image at different angles. The mean reflects the average grayscale of the image, and the standard deviation reflects the image contrast.

[0068] A6. Adjust the focus height, collect the new image and cache it in the corresponding Is index.

[0069] A7. Repeat the process of A3-A6 until the focus point sequence diagram is completed.

[0070] A8. The index position of the best focus height is selected by the hill climbing method and recorded as index. If the index is 0 or the maximum index value, the focus height is adjusted during the rough (rough) focus process and the complete focus is repeated. The actual focus is still the same focus. The first focus is to improve the focus speed and determine the range of the clear focus height more quickly. The second focus is to calculate the focus score value of a small range more accurately and determine the final focus height.

[0071] Among them, the hill climbing method starts from an initial focus height, gradually adjusts the focus height and evaluates the focus effect of the image. At each step, it will adjust in the direction of making the image focus better, just like a person climbing a mountain, always moving higher to find the highest point (i.e. the best focus height). Through a series of image processing, the scores at different focus heights are calculated, and then the focus height is adjusted according to the trend of the score change. If the score increases in a certain direction, continue to adjust the focus height in that direction; if the score stops increasing or starts to decrease, stop adjusting and determine the current position as a candidate position for the best focus height.

[0072] If the optimal focus height index position selected by the hill climbing method is 0 or the maximum index value, it indicates that the true optimal focus height may not be found. In this case, it is necessary to adjust the focus height during the coarse focus process and repeat the full focus to improve the accuracy and reliability of the focus.

[0073] See also Figure 2 , the focusing method of the prior art is closer to focusing on impurities in terms of focusing effect, that is, Figure 2 With full-view focusing, the overall score of the impurities on the image will be higher, resulting in the final focus on the clearest focus height of the impurities. In addition, for the single-layer image acquisition and scanning requirements, this solution has two requirements: 1. The focusing speed must be fast; 2. The focusing effect is mainly based on the sample;

[0074] To meet the requirement of 1, the focus image is downsampled to reduce the amount of calculation, and the roi method is adopted, such as Figure 3 This processing method has two advantages (eliminating the interference of impurities to a certain extent; reducing the area involved in the focus calculation); the disadvantage is that the extremely sparse sample will affect the focus effect (increasing the amount of calculation to determine whether the area is a sample). In the case of sparse samples, during the actual focusing process of the instrument, it is highly likely that the focus point will fail to focus and enter the next focus point; because this situation is generally outside the edge of the glass slide sample; it has a greater impact on the fitting of the focus plane. Therefore, the second step of processing can be performed to make a more detailed selection of several adjacent focus sequence images without downsampling. That is Figure 3 It focuses more on a balance and can reasonably choose the focus height for a clear sample.

[0075] The second step is to take the index in the range of [index-2, index+2] when the image index has been determined (the image sequence is completed), and re-focus through contrast as a supplementary solution. In order to improve the execution efficiency and calculation amount, this solution is implemented as follows:

[0076] B1. Split the roi region into 8X8 small blocks, and record the step size of each small block as step_y (size is roi_height / 8+1) and step_x (size is roi_width / 8+1).

[0077] B2. Calculate the contrast value of each small block in the y direction to reduce the influence of background noise. Split each small block into a small block of roi_width / 16X4 and do the integral (total gray value) and the difference between the left and right. The contrast value is recorded as contrast.

[0078] a) Calculate the contrast values ​​of the small blocks in the y direction with a step length of 4, and take the maximum value of the contrast, max_contrast, and accumulate it to contrast_score+=max_contrast;

[0079] b) max_contrast = 0, compare the next small block and repeat operation a until the calculation of the 8x8 small block is completed to obtain the contrast_score.

[0080] Among them, "subtracting the left and right values" specifically means that after performing the integration operation in each small block, two adjacent values ​​are selected from left to right for subtraction. The difference is calculated by subtracting the previous value from the latter value, that is, the larger value is smaller, and the difference is a positive number;

[0081] B3. Similar to B2, calculate the contrast value of each small block in the x direction, split each small block into 4Xroi_height / 16 small blocks, perform integration (total grayscale value), and make the difference between the left and right sides. The contrast value is recorded as contrast.

[0082] a) Calculate the contrast value of each small block with a step size of 4 in the x direction (the sum of the last four pixel values ​​minus the first four pixel values ​​in the horizontal direction for an 8x8 image block) and take the maximum value of the contrast, max_contrast, and accumulate it to contrast_score+=max_contrast;

[0083] b) max_contrast = 0, compare the next small block and repeat a) until the calculation of the 8x8 small block is completed to obtain the contrast_score.

[0084] B4. Repeat B1-B3 for all ROIs in the image, and add the obtained contrast_score values ​​to contrast_score. The contrast score of the image is still recorded as contrast_score.

[0085] B5. Add the final contrast value contrast_score to the scores of the corresponding index in the first step, and save the comprehensive result of contrast focus and gradient focus to the index corresponding to scores.

[0086] B6. Perform the above five index values ​​(index-2, index-1, index, index+1, index+2) in sequence according to B1-B5 to complete the score calculation of the corresponding index values ​​of the supplementary plan.

[0087] B7. Directly select the maximum value index among these five index values ​​as the optimal focus height.

[0088] In this embodiment, since the initial focus in the first step selects a sequence by downsampling, and the images near the sequence have sufficient contrast, the contrast focus in the second step selects several adjacent focus sequence images in a more detailed manner without downsampling. Normal focus can be achieved under low contrast, and the correct focus height can be selected more comprehensively under high contrast, providing a better guarantee for the image quality of the slide scan, while taking into account the focus speed.

[0089] Embodiment 2

[0090] Based on the same concept, the present application also proposes a method and device for accurately focusing fluorescent biological cell photography, including:

[0091] The parameter confirmation module determines the acquisition parameter information of the captured image, generates a region of interest with a set distribution, and saves it in a variable with a life cycle during the entire shooting and focusing process for image focusing operations;

[0092] The image sequence collection module collects images from the initial focus position, marks them as basic images, and caches them in the set image sequence collection; extracts the designated position images of the region of interest from the basic image, performs noise suppression on each region of interest, and obtains the noise-suppressed image; performs gradient calculation on the noise-suppressed image to obtain image gradient information; uses the image gradient information and the noise-suppressed image as specific weights to obtain a new image, calculates the statistical values ​​of the new images of all regions of interest as scores, and saves them to the storage unit with the index corresponding to the image sequence collection for caching; adjusts the focus height, collects new images, and caches them at the corresponding image sequence collection index until the image sequence is completed;

[0093] The selection module selects the index position of the best focus height in the image sequence as the best focal length to complete the focusing.

[0094] Embodiment 3

[0095] This embodiment also provides an electronic device, referring to Figure 4 , comprises a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to execute the steps in any of the above method embodiments.

[0096] Specifically, the processor 402 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0097] Among them, the memory 404 may include a large capacity memory 404 for data or instructions. For example, but not limitation, the memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 404 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 404 may be inside or outside the data processing device. In a specific embodiment, the memory 404 is a non-volatile memory. In a specific embodiment, the memory 404 includes a read-only memory (ROM) and a random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (Programmable Read-Only Memory, PROM for short), an erasable PROM (Erasable Programmable Read-Only Memory, EPROM for short), an electrically erasable PROM (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), an electrically alterable ROM (Electrically Alterable Read-Only Memory, EAROM for short) or a flash memory (FLASH) or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.

[0098] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .

[0099] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any of the fluorescent biological cell shooting and precise focusing methods in the above embodiments.

[0100] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .

[0101] The transmission device 406 can be used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired or wireless network provided by a communication provider of the electronic device. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 406 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0102] Input / output devices 408 are used to input or output information.

[0103] Embodiment 4

[0104] This embodiment also provides a readable storage medium, in which a computer program is stored. The computer program includes a program code for controlling a process to execute the process. The process includes the precise focusing method for photographing fluorescent biological cells according to the first embodiment.

[0105] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0106] In general, various embodiments may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the boxes, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0107] Embodiments of the present invention may be implemented by computer software that is executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros may be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. A computer program product may include one or more computer executable components configured to perform an embodiment when the program is run. One or more computer executable components may be at least one software code or a portion thereof. In addition, at this point, it should be noted that, for example, Figure 1 Any block of the logic flow in the program may represent program steps, or interconnected logic circuits, blocks and functions, or a combination of program steps and logic circuits, blocks and functions. The software may be stored on physical media such as memory chips or storage blocks implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and their data variants, CDs, etc. Physical media are non-transitory media.

[0108] Those skilled in the art should understand that 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 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 present application. 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 present application shall be subject to the attached claims.

Claims

1. A method for accurately focusing fluorescent biological cells, characterized in that: The following steps are involved: S00, determining width and height information for acquiring a focused image, generating a plurality of regions of interest distributed at set intervals based on the width and height information, and saving the regions of interest to a variable rois used in the entire shooting and focusing process; S10, collecting a focus image from an initial focus height, marking it as a base image, and caching it in a set focus image sequence set; S20, extracting a series of images corresponding to each region of interest from the base image based on the variable rois, performing noise suppression processing on the image of each region of interest, and obtaining a noise-suppressed image; S30, performing gradient calculation on the noise suppressed image to obtain image gradient information; S40, using the image gradient information as a specific weight of the image after noise suppression, calculating a new image corresponding to each region of interest, calculating a statistical value of the new images corresponding to all regions of interest, taking the sum of all the statistical values ​​as a score, and saving the score in a score storage unit corresponding to the index position of the base image in the focused image sequence set; wherein the statistical value is an average grayscale or contrast; S50, continuously adjusting the focus height, acquiring new basic images and caching them into a focused image sequence set, and executing steps S20-S40 until the focused image sequence set is completed; S70, selecting the index position of the basic image with the best focus height in the focused image sequence set based on the score, and taking the focal length of the basic image corresponding to the selected index position as the best focal length; S80, after obtaining the optimal focal length, setting a range for the index position of the optimal focal length, and using a contrast focusing method to accurately determine a new optimal focal length using a basic image corresponding to the index position of the set range; The specific steps of the contrast focusing method are as follows: S81, splitting a single region of interest of a single basic image into multiple first small blocks; S82, calculating multiple contrast values ​​of each first small block along the X direction on the single region of interest, taking the maximum value among the multiple contrast values ​​of each first small block and accumulating them into the comprehensive contrast value score; S83, calculating multiple contrast values ​​of each first small block along the Y direction on the single region of interest, and similarly taking the maximum value of the multiple contrast values ​​of each first small block and accumulating it into the comprehensive contrast value score; The contrast value of the first small block is the difference between the sum of the grayscale values ​​of the first small block and the sum of the grayscale values ​​of the first small block selected in the X direction or the Y direction according to a certain step length; S84, looping steps S81-S83, accumulating the maximum contrast values ​​in the X direction and the Y direction of each region of interest in the single basic image into the comprehensive contrast value score, and obtaining the final comprehensive contrast value score of the single basic image; S85, adding the final comprehensive contrast value score of the single basic image to the score of the single basic image calculated in step S40 to obtain a comprehensive score result of the single basic image and save it; S86, executing steps S81-S85 in sequence for the basic images corresponding to all index positions in the set range, to obtain a comprehensive score result of the basic images at all index positions in the set range; S87 . Select the focal length corresponding to the basic image with the largest comprehensive score among the comprehensive score results of the basic images at all index positions in the set range as the new optimal focal length.

2. The fluorescent biological cell photography and precise focusing method according to claim 1, characterized in that: In step S70, the index position of the basic image with the best focus height in the focus image sequence set is selected by the hill climbing method, and the focal length of the basic image corresponding to the selected index position is used as the best focal length.

3. The fluorescent biological cell photography and precise focusing method according to claim 1, characterized in that: In step S00, based on the width and height information, multiple regions of interest with set interval distribution are generated by bilinear interpolation and saved in the variable rois used in the entire shooting and focusing process.

4. The fluorescent biological cell photography and precise focusing method according to claim 2, characterized in that: In step S80, the range of the index position of the best focal length is set to [index-2, index+2], where index is the index position of the basic image of the best focus height in the focus image sequence set selected by the hill climbing method in step S70.

5. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the fluorescent biological cell photography and precise focusing method according to any one of claims 1 to 4.

6. A readable storage medium, characterized in that: The readable storage medium stores a computer program, wherein the computer program includes a program code for controlling a process to execute a process, wherein the process includes the method for precise focusing of fluorescent biological cell photography according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Automatic focusing algorithm

    CN109361849A

  • Focusing method and device, electronic equipment and computer readable storage medium

    CN110572573A