Method for quickly obtaining effective scanning area in fully-automatic optical microscopic examination system

CN118229537BActive Publication Date: 2026-10-16EAST CHINA NORMAL UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410438125.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-12
Publication Date
2026-10-16
Estimated Expiration
2044-04-12

AI Technical Summary

Technical Problem

[0003]现有技术的全自动光学显微镜在100倍物镜下按顺序扫描会产生空扫或扫到很少目标,在实际扫描时,扫描相机每移动一下,视野在高倍镜下都将进行较大幅度移动,因此利用人工操作机器定位是复杂且难以实现的问题,获得的扫描图像,费时又费力

Benefits of technology

[0032] Compared with existing technologies, this invention can quickly acquire the effective scanning area of ​​pure bacteria under high magnification objectives, providing the possibility for subsequent scanning with a scanner to obtain high-quality images. The method is simple, effective, time-saving and labor-saving, and effectively solves the problem that sequential scanning under high magnification objectives of fully automatic optical microscopes may result in blank scans or scans of very few targets. It has good application prospects and commercial value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118229537B_ABST
    Figure CN118229537B_ABST
Patent Text Reader

Abstract

The application discloses a method for quickly obtaining an effective scanning area in a full-automatic optical microscope system, and has the characteristics that the method comprises the following steps: filtering an image twice; extracting pink and purple pixel areas and merging the same, preliminarily screening all connected domains of a binary image obtained, and extracting the outline and position of a reserved connected domain; performing non-normalized sliding window frame filtering on the connected domains in turn, drawing a frame on the area and judging whether there is a new connected domain around the frame, if yes, then stepwise assigning a weight around the frame; scoring after color judgment on all obtained frames, and a frame with a higher score is preferentially selected as a pure bacteria scanning candidate area under a 100 times objective lens, and the frame position and the score are returned to the scanner for subsequent operation. Compared with the prior art, the application has the advantages of quickly obtaining a pure bacteria effective scanning area under a high-power objective lens, and better solves the problems of empty scanning or scanning a few targets possibly generated by sequentially scanning under a high-power objective lens of a full-automatic optical microscope.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital image processing technology, and in particular to a method for rapidly acquiring an effective scanning area in a fully automated optical microscopy system. Background Technology

[0002] In recent years, microscopy has become an indispensable part of modern medical diagnosis. By observing and analyzing scanned images of smears under a microscope, doctors can quickly make a preliminary judgment on the patient's condition. Therefore, the quality of the scanned images is particularly important for medical testing. According to testing standards, each smear must be scanned multiple fields of view under a certain magnification objective lens before the images are provided to the doctor for interpretation. For example, a pure bacterial smear requires scanning 300 fields of view under a 100x objective lens. Currently, fully automated optical microscopes mostly use S-shaped or spiral scanning methods to scan the entire smear. Both of these scanning methods have a high probability of scanning some fields of view without the target or with very few targets. Therefore, after obtaining all the scanned images, manual screening is still required to obtain the actual effective area containing the desired target.

[0003] Existing fully automated optical microscopes, when scanning sequentially under a 100x objective lens, may produce blank scans or scan very few targets. In actual scanning, every time the scanning camera moves, the field of view will shift significantly under high magnification. Therefore, using manual operation to position the machine is a complex and difficult problem to achieve, and the obtained scanned images are time-consuming and laborious. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for rapidly acquiring effective scanning areas in a fully automated optical microscopy system. The filtered scanned image is processed using a pure bacteria localization algorithm and a scoring algorithm, enabling rapid localization of the target aggregation area before scanning the smear under the microscope. This allows for the rapid acquisition of effective scanning areas of pure bacteria under high-magnification objectives in a fully automated optical microscopy system, providing the possibility for subsequent scanner scans to obtain high-quality images. The method is simple, effective, time-saving, and labor-saving, effectively solving the problem of easily scanning fields of view with no or very few targets during fully automated optical microscopy smear scanning. It has good application prospects and commercial value.

[0005] The specific technical solution to achieve the objective of this invention is: a method for rapidly acquiring an effective scanning area in a fully automated optical microscope inspection system, characterized by the following steps:

[0006] Step 1: Read in an image with a fixed pixel size captured by a microscope camera, and apply Gaussian and mean filtering techniques to the image twice to complete the image preprocessing.

[0007] Step 2: Split the filtered image into RGB and LAB channels respectively, extract the target color (including pink and purple) regions using an adaptive thresholding algorithm, and then merge them. Perform preliminary screening and contour extraction on the merged regions based on certain conditions, and record the position of the contours.

[0008] Step 3: Perform non-normalized sliding window box filtering on each connected component within a certain range, select the sliding window containing the most targets for positioning and drawing a box. This box will be the scanning field of view under the subsequent 100x objective lens. Determine if there are other targets around the box. If so, assign weights to the boxes in a stepwise manner so that each box is as close as possible without overlapping too much.

[0009] Step 4: Determine whether each pixel in each connected region of the original image is pinkish or purple. Assign different scores based on the amount of pink or purple in each box. Reflect the score of each box in the upper left corner of the box and return the box position and score to the scanner.

[0010] Step 1 uses filtering techniques to preprocess the image, specifically including the following steps:

[0011] Step 1.1: Read in an image with a fixed pixel value taken using a microscope camera, and define its width and height as iWidth and iHeight, respectively.

[0012] Step 1.2: Use Gaussian filtering to blur the image. The convolution template for Gaussian filtering is 3×3 pixels in size.

[0013] Step 1.3: Process the Gaussian filtered image again using the mean filtering method. The mean filtering filter is 3×3 pixels in size.

[0014] Step 2 specifically includes the following operations:

[0015] Step 2.1: After converting the filtered image to RGB format, separate the channels to obtain the R channel image, G channel image, and B channel image, and create a new image img_r, such that the pixel values ​​of img_r satisfy the following equation (a):

[0016] img_r = 2 × RGB (a).

[0017] Step 2.2: Perform an adaptive thresholding operation on img_r. Pixels exceeding the threshold are set to 1, and pixels within the threshold are set to 0. The result is saved as image r_binary.

[0018] Step 2.3: After converting the image obtained in Step 1.2 into LAB format, separate the channels to obtain the L channel image, A channel image, and B channel image. Extract the A channel image and perform an adaptive threshold operation. The pixel value of the part exceeding the threshold is 1, and the pixel value of the part not exceeding the threshold is 0. The result is saved as image a_binary.

[0019] Step 2.4: Merge the r_binary image and the a_binary image to obtain a binary image of the pure bacterial region, and extract the contour from the image.

[0020] Step 2.5: Traverse each connected component obtained from the contour extraction, filter out connected components with too small an area or extreme size, calculate the average color of the background within 10 pixels of each connected component and its width and height, and remove connected components whose colors do not resemble pure bacteria (non-pink, purple) according to preset conditions to reduce the interference of impurities and cluttered backgrounds on the algorithm results.

[0021] Step 2.6: Use the filtered connected components as the final target segmented connected components, extract the contour of the connected components and draw it on a new binary image filter_img. The pixel value of the region contained in the connected component is 1, and the rest is 0.

[0022] Step 3 specifically includes the following operations:

[0023] Step 3.1: Define the filtering region range for the non-normalized sliding window box filtering operation, and define two weight ranges rect1 and rect2 added outside the box after drawing the box. Determine whether more than 50% of the area of ​​the current connected component is covered by other boxes. If it is covered, the operation on the pure bacterial region is considered complete, and the next connected component is evaluated.

[0024] Step 3.2: Determine whether there are other connected components within the range of rect1 and rect2 of the bounding box obtained in the previous operation. If there are connected components, increase the weight of that range by a step weight.

[0025] Step 3.3: Perform non-normalized sliding window box filtering and record the region with the largest filtered value. Select the connected component with the largest area among all the connected components formed by the maximum values, and record its center position as the center position of the frame.

[0026] Step 3.4: Calculate the background pixel values ​​around all connected components within the bounding box, and create a new image mask_color, so that the pixel value of each connected component is equal to the background pixel value around its corresponding connected component, for use in the scoring operation in step 4; at the same time, set the pixel value of the current bounding box to -1, so that the sum of the pixel values ​​of the bounding box positions is smaller in the next box filtering, thereby reducing the overlap between boxes.

[0027] Step 3.5: Repeat the above operation until all connected components have been traversed.

[0028] Step 4 specifically includes the following operations:

[0029] Step 4.1: Read in mask_color, which records the background pixel value of each connected component, obtained at the end of step 3. Perform five channel operations and threshold segmentation on the image and the original image to make the pixel value of the originally pinkish pixels 1 and the pixel value of the originally purple pixels 0.

[0030] Step 4.2: Assign different scores to each frame based on the relative and absolute values ​​of the number of pink and purple pixels in each frame. Frames with a more pinkish color and a larger area will receive higher scores and become priority areas for scanning under the 100x objective lens in the subsequent scan.

[0031] Step 4.3: Mark the score corresponding to each box on the image, and input the box position and score into the instrument for subsequent operations.

[0032] Compared with existing technologies, this invention can quickly acquire the effective scanning area of ​​pure bacteria under high magnification objectives, providing the possibility for subsequent scanning with a scanner to obtain high-quality images. The method is simple, effective, time-saving and labor-saving, and effectively solves the problem that sequential scanning under high magnification objectives of fully automatic optical microscopes may result in blank scans or scans of very few targets. It has good application prospects and commercial value. Attached Figure Description

[0033] Figure 1 This is a flowchart of the present invention;

[0034] Figure 2 A flowchart for filtering and positioning operations of a sliding window box;

[0035] Figure 3 To capture images of pure bacteria on a glass slide at 10x magnification;

[0036] Figure 4 Image of pure bacteria at 10x magnification, captured using a microscope camera;

[0037] Figure 5 This is a diagram showing the results of the operation of this invention. Detailed Implementation

[0038] See Figure 1 The rapid acquisition of effective scanning areas in a fully automated optical microscopy system mainly includes three parts: image preprocessing, pure bacteria localization algorithm, and scoring algorithm.

[0039] (I) Image preprocessing, which specifically includes the following steps: 1-1: Read in an image with a fixed pixel value taken by a microscope camera, whose width and height are represented by iWidth and iHeight respectively, and perform two filtering operations on the image.

[0040] 1-2: The first filtering is Gaussian filtering. Its operating principle is to scan each pixel in the image using a template, and replace the value of the center pixel of the template with the weighted average gray value of the pixels in the neighborhood determined by the template. The Gaussian template is calculated using a Gaussian function, which is calculated by the following equation (b):

[0041]

[0042] Where σ is the variance of the Gaussian function and μ is the expected value.

[0043] The Gaussian filter uses a 3×3 Gaussian template to scan each pixel of the image.

[0044] 1-3: The second filtering is mean filtering. Its operation involves calculating the average value of all pixels surrounding each pixel (including the pixel itself). This average value is the filtered value of the current pixel. Mean filtering typically calculates the average value by summing all pixels within a rectangular window centered on the current pixel. The size of the rectangular window is usually an odd number, with common parameters being 3×3, 5×5, ..., (2n+1)×(2n+1). For a window of size (2n+1)×(2n+1), the average filtered value at a point (x, y) is calculated using the following formula (c):

[0045]

[0046] Where i and j are the pixel coordinates within the ranges (xn, x+n) and (yn, y+n) respectively, and P(i, j) is the pixel value at point (i, j). The mean filter selects a window of size n = 1, i.e., 3×3.

[0047] 1-4: After performing the above two filtering operations, convert the image to RGB format and split it into R, G, and B channels; create a new image img_r such that the pixel values ​​of img_r satisfy the following equation (a):

[0048] img_r = 2 × RGB (a).

[0049] 1-5: Perform adaptive thresholding algorithm operation on img_r. The adaptive thresholding method can calculate the local threshold according to the brightness distribution of different regions of the image. That is, for different regions of the image, it can adaptively calculate different thresholds, so that the threshold of each pixel in the image will change with the changes of its surrounding neighboring pixels.

[0050] Pixels exceeding a threshold are set to a value of 255, and the ADAPTIVE_THRESH_MEAN_C calculation method is used, meaning that the weight values ​​of all neighboring pixels are consistent. The neighborhood average is calculated and then incremented by 12 (12 is a user-defined parameter). The size of the local neighborhood block is set to 21, and the result is saved as image r_binary.

[0051] 1-6: Convert the images obtained after the first two filtering steps into LAB format for channel separation to obtain L channel image, A channel image, and B channel image respectively. Extract the A channel image and repeat the above adaptive thresholding algorithm, but change the neighborhood average value to add 3, while keeping other parameters unchanged. Save the result as image a_binary.

[0052] 1-7: Merge the r_binary image and the a_binary image, extract the region contour to obtain several connected components, calculate the meanColor of each connected component and the meanColorBk of the surrounding 10×10 pixel range, and filter out connected components whose pixels are not pink or purple.

[0053] 1-8: Extract the outline of the filtered region to obtain a new set of connected components, and draw it on a new binary image filter_img. Set the pixel value in the connected component to 1, and the pixel value in the rest to 0.

[0054] (II) Localization of pure bacteria using traditional image algorithms. This method specifically includes the following steps: 2-1: Define the top-left coordinates of the current connected component contour as (vRect[i].x, vRect[i].y), and the width and height of the contour as (vRect[i].width, vRect[i].height); the original image width is iWidth,

[0055] iHeight; X-axis coordinate offset x_offset, Y-axis coordinate offset y_offset.

[0056] 2-2: Copy the binary image filter_img to a new image rect_test. Since the pixel values ​​inside the already located boxes are set to -1 in rect_test after each bounding box drawing, the ratio of the number of pixels with non--1 values ​​in the connected component to the area of ​​the connected component can be calculated. If the ratio is less than 50%, it is considered that it has been located previously, and no further operation is performed on that connected component; if it exceeds 50%, the next step is performed.

[0057] 2-3: Define the range for sliding window filtering:

[0058]

[0059] Box filtering is a special case of mean filtering, and its principle is similar to mean filtering, but each pixel in the box filter has equal weight. In this method, it is not normalized, and the filtering result is the sum of the values ​​of neighboring pixels (including the current pixel).

[0060] 2-4: Perform sliding window-based box filtering within the above range of the image filter_img.

[0061] See Figure 2 The filter is applied pixel by pixel by using a sliding window of a fixed size (iWidth / 10+1 and iHeight / 10+1 in this method). Figure 2 Steps one, two, three, and four illustrate four boundary cases of the sliding window's operation. Through... Figure 2 As can be seen, within this range, regardless of how the sliding window moves, the current connected component will be included. x_offset and y_offset are the minimum distances of the connected component from the long and short sides of the frame when the sliding window reaches the boundary. Because the motor may have slight offsets during scanning, which are reflected as large offsets in a 100x field of view, x_offset and y_offset are set to prevent the original target from being lost due to motor offsets.

[0062] 2-5: After filtering, the threshold is set to the maximum value of all results generated by the current filtering, and global threshold segmentation is performed within the filtering range to obtain the maximum value region. If multiple maximum value regions exist, the region with the largest area is selected, and this rectangular region is set as the center of the frame position. Based on the obtained frame center position, a frame with a width and height that are both one-tenth of the original image width and height is drawn as the scanning field of view under the subsequent 100x objective lens.

[0063] 2-6: Define the boundaries of the two weighted frames, centered on the center of the frame:

[0064]

[0065] Determine if there are other connected components around the frame. If so, add 0.5 to the pixel value within the first layer weight range and add 0.3 to the pixel value within the second layer weight range (the weight increase is the second layer weight range minus the first layer weight range) so that the sum of the pixel values ​​of the connected components near the frame is higher in the next filtering operation, making them easier to locate.

[0066] 2-7: Finally, calculate the average background pixel value within an 80×80 pixel area surrounding all connected components within the current bounding box, and create a new image `mask_color`, ensuring that the pixel value of each connected component is equal to the background pixel value surrounding that component, for use in the next scoring operation. Simultaneously, set the pixel value of the current bounding box to -1 in both the image `rect_test` (used to determine if a connected component is covered and the percentage covered) and the image `filter_img` (used for non-normalized sliding window box filtering), so that the sum of pixel values ​​at the already drawn box position is smaller in the next box filtering, thus reducing overlap between boxes. Repeat the above operations for the next connected component until all connected components have been traversed.

[0067] (III) Each frame is scored based on pixel color. Pixels with a pinkish tint are more likely to be pure bacteria and should be scored higher than pixels with a purplish tint. Finally, each frame is assigned a different score based on the color characteristics of its pixels. This method specifically includes the following steps:

[0068] 3-1: Read in the image mask_color, which records the background pixel values ​​of each connected component. Perform five channel operations and global thresholding on this image and the original image. Retain pinkish pixels from the original image and set their pixel values ​​to 1; reset the pixel values ​​of other pixels below the threshold to purplish pixels. Calculate the number of non-zero pixel values ​​in each connected component; this number represents the number of pinkish pixels. The number of purplish pixels = total number - number of pinkish pixels. The scoring objective of this method is: the box with the most pinkish pixels receives the highest score; if both pink and purplish pixels exist, the box with more pinkish pixels should receive a higher score than the box with more purplish pixels; boxes with few pink pixels or only purplish pixels should also be marked and assigned a lower score.

[0069] 3-2: Traverse each frame position in the original image, calculate the number of pinkish pixels and purpleish pixels within that frame, and obtain a score based on the number of pixels. The score ranges from 0 to 1, and the score calculation method is as follows:

[0070] Let the number of pink pixels be pink_num and the number of purple pixels be purple_num, then:

[0071] If the number of pink pixels is less than or equal to 5, the score is calculated using the following formula (d):

[0072] score = 1 - 0.9 purple_num / 200 +1 (d).

[0073] If the number of pink pixels is greater than 200, the score is calculated using the following formula (e):

[0074] score = (1 - 0.9) pink_num / 200 )+6 (e).

[0075] If the number of pink pixels is greater than 5 but less than 70, or the number of pink pixels is less than the number of purple pixels, then the score is calculated using the following formula (f):

[0076] score = (1 - 0.9) pink_num / 200 )+2+(1-0.9 purple_num / 200 )+1 (f).

[0077] The remaining cases are calculated using the following formula (g):

[0078] score = (1 - 0.9) pink_num / 200 )+3+(1-0.9 purple_num / 200 )+1 (g).

[0079] 3-3: After the calculation is complete, the score is normalized, and finally all boxes are drawn on the original image, with the score of each box marked in the upper left corner. The position and score of each box are also returned to the instrument for further processing.

[0080] To make the objectives, technical solutions, and advantages of this invention clearer, the following detailed description of this invention will be based on the processing of pure bacterial smears.

[0081] Example 1

[0082] See Figure 4 In this embodiment, the image taken using a microscope camera under a 10x objective lens is as follows: Figure 4 As shown, the image size is 1600×1100, and the specific process is as follows:

[0083] S101: Read in an image of fixed pixel size taken using a microscope camera, whose width and height are represented by iWidth and iHeight respectively, and perform two filtering operations on the image.

[0084] The first filtering is Gaussian filtering, using a 3×3 Gaussian template to scan each pixel of the image. The second filtering is mean filtering, where n=1 (3×3 window size) is chosen for mean filtering in this method. After the two filtering processes, the image is converted to RGB format and split into R, G, and B channels; a new image img_r is created, ensuring that the pixel values ​​of img_r satisfy the following equation (a):

[0085] img_r = 2 × RGB (a).

[0086] An adaptive thresholding algorithm is applied to img_r, and the result is saved as image r_binary. The images obtained after the first two filtering operations are then converted to LAB format for channel separation, resulting in L-channel, A-channel, and B-channel images. The A-channel image is extracted and subjected to an adaptive thresholding algorithm, and the result is saved as image a_binary.

[0087] The r_binary and a_binary images are merged, and the region contours are extracted to obtain several connected components. The meanColor of pixels in each connected component and the meanColorBk of pixels within a surrounding 10×10 pixel range are calculated, and connected components whose pixels are not pinkish or purpleish are filtered out.

[0088] Extract the outlines of the filtered regions to obtain a new set of connected components. Draw all connected components in this set on a new binary image filter_img, and set the pixel value within the connected components to 1, and the pixel value of the rest to 0.

[0089] S102: Perform traversal and positioning operations on each connected component in the binary image filter_img, traversing from top to bottom and from left to right. The flow of one operation during traversal is as follows:

[0090] Define the top-left coordinate of the current connected component contour as (vRect[i].x,vRect[i].y), and the width and height of the contour as (vRect[i].width,vRect[i].height); the original image width iWidth = 1600, height iHeight = 1100; X coordinate offset x_offset, Y coordinate offset y_offset.

[0091] Copy the binary image `filter_img` to a new image `rect_test`. Calculate the number of pixels in the current connected component of the `rect_test` image that are not -1. If the number is less than 50% of the connected component's area, it means that the connected component is covered by more than 50% of other bounding boxes, and it is considered already located; no further operation is performed on this connected component. If it is greater than 50%, proceed to the next operation. The range for sliding window filtering is defined as shown in the figure below. This range ensures that the connected component to be located is included regardless of how the sliding window moves.

[0092]

[0093] See Figure 2Within the aforementioned range, non-normalized box filtering based on a sliding window is performed. A sliding window of a fixed size (iWidth / 10+1 and iHeight / 10+1, i.e., 161×111 in this method) is moved pixel by pixel in the order from top to bottom and from left to right for filtering. Figure 2 Steps one, two, three, and four illustrate the four boundary cases of the sliding window's operation. (Through...) Figure 2 As can be seen, within this range, regardless of how the sliding window moves, the current connected component will be included. x_offset and y_offset are the minimum distances of the connected component from the long and short sides of the frame when the sliding window reaches the boundary. Because the motor may have slight offsets during scanning, which are reflected as large offsets in a 100x field of view, x_offset and y_offset are set to prevent the original target from being lost due to motor offsets.

[0094] After filtering, a thresholding operation is performed within this range, with the threshold set to the maximum value of the filtered result, thus obtaining one or more maximum value regions. If multiple maximum value regions exist, the region with the largest area is selected, and the center of this rectangular region is set as the center of the frame position.

[0095] Based on the center position of the obtained frame, draw a frame with a width and height that are one-tenth of the original image's width and height, i.e., 160×110, as the scanning field of view under the subsequent 100x objective lens.

[0096] Define the boundaries of the two weighted bounding boxes, centered on the center of the frame:

[0097]

[0098] Determine if other connected components exist around the frame. If so, add 0.5 to the pixel value within the first-layer weight range and 0.3 to the pixel value within the second-layer weight range (the weight increase is the second-layer weight range minus the first-layer weight range). By increasing the weights, the frames can be brought closer together with minimal overlap.

[0099] Calculate the average background pixel value within an 80×80 pixel area surrounding all connected components within the drawn bounding box. Create a new image `mask_color`, ensuring that the pixel value of each connected component is equal to the background pixel value surrounding that component, for use in the next scoring operation. Simultaneously, set the pixel value of the current bounding box to -1 in both the image `rect_test` (used to determine if connected components are covered and the percentage covered) and the image `filter_img` (used for non-normalized sliding window box filtering). This ensures that the sum of pixel values ​​at the already drawn box position is smaller during the next box filtering, thus reducing overlap between boxes.

[0100] Repeat the above operation for the next connected component until all connected components have been traversed.

[0101] S103: For each obtained frame, perform pixel-based color scoring, where frames with more pinkish pixels receive a higher score than frames with more purple pixels. Similarly, in the case of pinkish pixels, frames with more target pixels receive a higher score than frames with fewer target pixels. Finally, assign different scores to the frames based on the color characteristics of the pixels within each frame. This method includes:

[0102] The method reads in the image `mask_color`, which records the background pixel values ​​of each connected component. It then performs five channel operations and global thresholding on this image and the original image to filter out pinkish pixels, setting their values ​​to -1. Pixels below the threshold are classified as purplish pixels and set to 0. The number of non-zero pixel values ​​in each connected component is calculated, representing the number of pinkish pixels. The number of purplish pixels is obtained by subtracting the number of pinkish pixels from the total number of pinkish pixels. The scoring objective of this method is: the highest score is given to the box with the most pinkish pixels; if both pink and purplish pixels exist, the box with more pinkish pixels should score higher than the box with more purplish pixels; boxes with few pink pixels or only purplish pixels should also be marked and assigned a lower score.

[0103] Iterate through each frame position in the original image, calculating the number of pinkish pixels and the number of purpleish pixels within that frame. Based on these quantities, obtain a score using a specific calculation method. The score ranges from 0 to 1. The score calculation method is as follows:

[0104] Let the number of pink pixels be pink_num, the number of purple pixels be purple_num, and the number of pink pixels be less than or equal to 5. Then the score is calculated by the following formula (d):

[0105] score = 1 - 0.9 purple_num / 200 +1 (d).

[0106] If the number of pink pixels is greater than 200, the score is calculated using the following formula (e):

[0107] score = (1 - 0.9) pink_num / 200 )+6 (e).

[0108] If the number of pink pixels is greater than 5 but less than 70, or the number of pink pixels is less than the number of purple pixels, then the score is calculated using the following formula (f):

[0109] score = (1 - 0.9) pink_num / 200 )+2+(1-0.9 purple_num / 200 )+1 (f).

[0110] The remaining cases are calculated using the following formula (g):

[0111] score = (1 - 0.9) pink_num / 200 )+3+(1-0.9 purple_num / 200 )+1 (g).

[0112] After the calculation is complete, the score is normalized.

[0113] Finally, all frames are drawn on the original image, and the score for each frame is marked in the upper left corner. The position and score of each frame are then returned to the instrument for further processing.

[0114] In this embodiment, based on an Intel i5-7500 processor and an NVIDIA GeForce RTX 2070 GPU, the size of the image to be processed is 1600×1100, and the processing time for a single image with multiple pure bacterial targets is 0.365s, which can achieve rapid positioning before scanning under 100x field of view of the instrument.

[0115] See Figure 3 This is an example of a pure bacterial smear used in the research process of this method.

[0116] See Figure 4 This is an image obtained by scanning with the instrument at 10x field of view.

[0117] See Figure 5 The result after processing by this method is as follows: Figure 5 As shown in the figure, the comparison shows that all suspected pure bacteria locations have been located, with fewer duplicate boxes. Furthermore, the scores of dense pure bacteria areas are significantly higher than those of sparse pure bacteria areas and suspected impurity areas, indicating good localization and scoring ranking effects.

[0118] The above is merely a further description of the present invention and is not intended to limit the scope of this patent. Any equivalent implementation of the present invention should be included within the scope of the claims of this patent.

Claims

1. A method for rapidly acquiring an effective scanning area in a fully automated optical microscopy system, characterized in that: This method quickly acquires the effective scan area by following these steps: Step 1: Read in the image with fixed pixel values ​​captured by the microscope camera, and apply Gaussian filtering and mean filtering to the image respectively; Step 2: The filtered image above is split into RGB and LAB channels respectively, and the target color region is extracted using an adaptive thresholding algorithm and then merged to generate a binary image. At the same time, the background image is obtained. The contour and position information of the binary image are extracted and then preliminarily screened. Step 3: Traverse the connected components that meet the conditions, perform non-normalized sliding window box filtering in a certain range in sequence, select the fixed-size region containing the most connected components as the scanning candidate region under the 100x objective lens based on the filtering results, record the border position of the region and draw a box, determine whether there is a new target around the current box, if there is a new target, assign weights around the box in a stepwise manner and repeat the above operation for the next connected component. Step 4: Determine whether each pixel in each connected component of the original image is pinkish or purple. Assign different scores based on the amount of pink or purple in each box. Reflect the score of each box in the upper left corner of the box and return the box position and score to the scanner. Step 3 specifically includes the following steps: Step 3.1: Define the convolution region range for which non-normalized sliding window box filtering is required. Define two weight ranges rect1 and rect2 added outside the box after drawing the box. Determine whether more than 50% of the area of ​​the current connected component has been covered by other boxes. If it has been covered, the operation of the region is considered to have been completed, and the next connected component is judged. Step 3.2: Determine whether there are other connected components within the range of rect1 and rect2 outside the bounding box in the previous traversal. If there are connected components, increase the weight of the range by a step-like weight. Step 3.3: Perform non-normalized sliding window box filtering on the current image, record the region with the largest value within the range of the sliding window filtering operation, select the connected component with the largest area among all the connected components formed by the maximum values, and the position of this connected component is the center position of the frame; Step 3.4: Calculate the background pixel values ​​around all connected components within the bounding box, and create a new image mask_color. Make each pixel value of each connected component equal to the background pixel value around its corresponding connected component. At the same time, set the pixel value of the current bounding box to -1 in the mask_color image and the image after sliding window filtering. Step 3.5: Repeat the above operation until all connected components have been traversed.

2. The method for rapidly acquiring an effective scanning area in a fully automated optical microscopy system according to claim 1, characterized in that, Step 1 specifically includes the following steps: Step 1.1: Read in the image with fixed pixel values ​​captured by the microscope camera, and define its width and height as iWidth and iHeight, respectively; Step 1.2: Blur the image using a Gaussian filter, where the convolution template for the Gaussian filter is 3×3 pixels; Step 1.3: The image after Gaussian filtering is processed again using the mean filtering method, where the mean filtering filter is 3×3 pixels.

3. The method for rapidly acquiring an effective scanning area in a fully automated optical microscopy system according to claim 1, characterized in that, Step 2 specifically includes the following steps: Step 2.1: After converting the images after Gaussian filtering and mean filtering into RGB format, perform channel separation to obtain R channel, G channel and B channel images respectively, and create a new image img_r as the image after RGB three-channel operation; Step 2.2: Perform an adaptive thresholding operation on the new image img_r, and save the result as image r_binary; Step 2.3: After converting the images after Gaussian filtering and mean filtering into LAB format, perform channel separation to obtain L channel, A channel and B channel images respectively. Extract the A channel image and perform adaptive thresholding operation. Save the result as image a_binary. Step 2.4: Merge the r_binary image and the a_binary image to obtain the first pure bacterial region image, and perform contour extraction on this image; Step 2.5: Traverse each extracted connected component, filter out connected components with too small an area or extreme size, calculate the average color of the background within 10 pixels of the connected component and its width and height, and remove connected components whose color and shape do not resemble pure bacteria according to preset conditions, so as to reduce the interference of impurities and messy background on the algorithm results. Step 2.6: Take the connected components that have been filtered above as the final target segmented connected components, extract the contour of the connected components and draw it on a new binary map. The connected components contain regions with pixel values ​​of 1 and the rest with values ​​of 0.

4. The method for rapidly acquiring an effective scanning area in a fully automated optical microscopy system according to claim 1, characterized in that, Step 4 specifically includes the following steps: Step 4.1: Read in the mask_color of the background pixel value of each connected component. By performing five channel operations and thresholding on the image and the original image, the pixel value of the originally pinkish pixels is 1, and the pixel value of the originally purple pixels is 0. Step 4.2: Based on the relative and absolute values ​​of the number of pink and purple pixels in each box, score each box, and give the highest score to the box with the target that is more pink and has a larger area. Step 4.3: Mark the score corresponding to each box on the image, and send the box position and score back to the scanner for subsequent operations.

Citation Information

Patent Citations

  • Microimaging scanning method and scanning system

    CN113344958A

  • Nucleus marker watershed transformation-based method for splitting adhered white blood cells

    WO2016091016A1