Method, medium and device for segmenting visible elements of microscopic images

By performing distance transformation and contour search on the microscopic image, a seed area map is created, and the seed growth connected domain is used for the flood irrigation step. This solves the segmentation problem caused by the high dependence on seed point selection in the existing technology, and improves the stability and stability of the segmentation. Accuracy.

CN118552572BActive Publication Date: 2024-10-18HUNAN JUMPER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411002334.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-10-18
Estimated Expiration
2044-07-25

AI Technical Summary

Technical Problem

Existing microscopic image segmentation methods are highly dependent on seed point selection, which can easily lead to over-segmentation or under-segmentation problems, affecting recognition accuracy.

Method used

By obtaining the target contour binary map of the original color three-channel image, perform distance transformation and contour search, create a seed area map, and use the seed growth connected domain to replace the seed points for the flooding step, reducing the dependence on seed selection and avoiding over-segmentation or under-segmentation. segmentation.

Benefits of technology

It improves the stability and accuracy of image segmentation, reduces the possibility of unclear or wrong boundaries, and enhances the reliability of recognition results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552572B_ABST
    Figure CN118552572B_ABST
Patent Text Reader

Abstract

The present invention provides a segmentation method, medium and device for the formed components of a microscopic image. By obtaining a binary image of the target contour of an original color three-channel image, a corresponding distance map is obtained to obtain each local peak value as the center point of the initial growth region, and the growth condition termination point contained in each contour in the binary image of the target contour is obtained, and then a circle is drawn with the center point of each initial growth region as the center of the circle to obtain a seed region map and a plurality of seed growth connected domains, and the connecting line between the growth condition termination point in each contour and the center point of the corresponding connected domain is extended to the corresponding connected domain to obtain an updated connected domain, and finally each connected domain is modified to a different pixel value, and the adjacent pixel points are modified to their corresponding values ​​to obtain a segmented seed region map, and the image segmentation is completed. The method solves the problem that the prior art has a high dependence on seed selection, which leads to easy over-boundary segmentation during flooding, or easy over-segmentation or under-segmentation during flooding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image processing, and in particular to a method, medium and equipment for segmenting formed components of a microscopic image. Background Art

[0002] With the rapid development of science and technology, the segmentation of visible elements in microscopic images is gradually being replaced by intelligent equipment, which is liberating labor and lowering the professional threshold. However, in the application fields of judging pathology through blood routine and leucorrhea routine analysis in hospitals, or providing data support for water management through analysis and statistics of blue algae blooms in water pollution at environmental monitoring stations, there are still many problems in the application of intelligent equipment. Take the image segmentation step as an example: intelligent equipment needs to identify individual targets one by one, but when multiple targets are attached, it will seriously affect the recognition accuracy of intelligent equipment, and even cause the equipment to be unable to recognize. Therefore, before the intelligent equipment recognizes the target, it needs to segment the target, and the segmentation method used determines the reliability of the subsequent recognition and analysis results.

[0003] The currently commonly used segmentation method is the watershed segmentation algorithm based on seed marking, but this method is highly dependent on seed selection. When the seed point position is not selected appropriately, it is easy to cause over-boundary segmentation problems in the subsequent flooding process, resulting in unclear or erroneous boundaries between regions. When the number of seed points is calculated incorrectly, it will cause over-segmentation or under-segmentation problems in the subsequent flooding process, resulting in parts that should be the same area being cut into several sub-regions, or parts that should be cut into different regions being merged into one large area.

[0004] Therefore, how to improve it is a technical problem that needs to be solved urgently in this field. Summary of the invention

[0005] Based on this, the purpose of the present application is to provide a method, medium and device for segmenting the formed components of a microscopic image to solve at least one of the technical problems mentioned in the above background technology.

[0006] In a first aspect, the present application provides a method for segmenting a microscopic image shaped component, comprising:

[0007] Get the target contour binary image of the original color three-channel image;

[0008] Perform distance transformation on the target contour binary image, modify the pixel value of each pixel point to the corresponding distance value, and obtain a distance map, so as to obtain several local peaks in the distance map as the center points of the initial growth area;

[0009] Perform contour search on the target contour binary image to obtain several target contours and their corresponding outer contours and inner contours, and obtain the concave points of each outer contour and the convex points of the inner contour as the termination points of the growth conditions;

[0010] Create a blank image of the same size as the distance map, draw a circle in the blank image with the center point of each initial growth area as the center and the corresponding distance value as the radius, and obtain the seed area map and several seed growth connected domains therein;

[0011] Determine whether the number of seed growth connected domains in each target contour is greater than 1. If so, connect the end point of each growth condition in each target contour with the center point of the corresponding connected domain, and expand the connecting line between the two to the corresponding connected domain to obtain the updated connected domain. If not, leave it unchanged.

[0012] Various sub-growing connected domains and updated connected domains are modified to different pixel values, and the adjacent pixel points of various sub-growing connected domains and updated connected domains are modified to their corresponding values, until the pixel values ​​of all pixel points in the seed area map corresponding to the target contour coverage area in the target contour binary map are modified, and the segmented seed area map is obtained to complete the image segmentation.

[0013] Furthermore, the step of obtaining a target contour binary image of the original color three-channel image includes:

[0014] Convert the original color three-channel image to the HSV color space to obtain a saturation channel image and a brightness channel image;

[0015] Get the gradient magnitude map of the brightness channel image;

[0016] The binary image of the saturation channel image and the binary image of the gradient amplitude map are obtained, and an OR operation is performed on the two to obtain a binary map of the target contour.

[0017] Furthermore, the step of obtaining a gradient magnitude map of the brightness channel image includes:

[0018] Perform contrast enhancement on the brightness channel image to obtain an optimized brightness channel image;

[0019] Get the gradient map of the optimized brightness channel image in the X and Y directions;

[0020] Merge all gradient maps to get the gradient magnitude map.

[0021] Further, the step of obtaining a binary image of the saturation channel image and a binary image of the gradient amplitude map, and performing an OR operation on the two to obtain a target contour binary map includes:

[0022] Adaptively perform binary segmentation on the saturation channel image to obtain a binary image of the saturation channel image;

[0023] Perform threshold segmentation on the gradient amplitude map to obtain a binary image of the gradient amplitude map;

[0024] Perform an OR operation on the binary images of the gradient magnitude image and the saturation channel image to obtain a target contour binary image.

[0025] Furthermore, the step of obtaining several local peaks in the distance map includes:

[0026] Obtain the minimum distance value between each foreground point and background point, and modify the pixel value of each foreground point to the corresponding minimum distance value to obtain a distance map;

[0027] Traverse the pixel points in the distance map to determine whether the pixel value of each pixel point is greater than other pixel points within the set radius. If so, it is a local peak; and obtain several local peaks in the distance map.

[0028] Furthermore, the step of obtaining several local peaks in the distance map also includes:

[0029] Get the distance between each local peak value and determine whether it is greater than the set confidence distance threshold. If not, keep the corresponding local peak value. If so, determine the size of the two and remove the local peak value with smaller pixel value. Get several remaining local peak values ​​as the center point of the initial growth area.

[0030] Furthermore, before obtaining the distance map, it also includes:

[0031] Define a structural element, and perform an opening operation on the target contour binary image according to the structural element to obtain an optimized target contour binary image;

[0032] Furthermore, the step of obtaining the seed region map and a plurality of initial seed growth connected domains also includes:

[0033] S41: sorting the center points of each initial growth region according to the corresponding distance values ​​in a set order to obtain a coordinate set;

[0034] S42: creating a blank image of the same size as the distance map, and taking the center points of each initial growth region as the current center point in turn according to the coordinate set;

[0035] S43: Draw a circle in the blank image with the current center point as the center and the corresponding distance value as the radius, to obtain an initial seed growth connected domain corresponding to the current center point;

[0036] S44: Determine whether there is still an initial growth region center point that has not obtained the corresponding initial seed growth connected domain. If so, return to step S42; if not, obtain the seed region map and several initial seed growth connected domains.

[0037] In a second aspect, the present application further provides a computer storage medium storing an executable program code; the executable program code is used to execute the method for segmenting formed components of a microscopic image as described in any one of the first aspects.

[0038] In a third aspect, the present application further provides a terminal device comprising a memory and a processor; the memory stores program code executable by the processor; the program code is used to execute the method for segmenting formed components of a microscopic image as described in any one of the first aspects.

[0039] The present invention provides a method, medium and device for segmenting the tangible components of a microscopic image. The method comprises the following steps: obtaining a target contour binary map of an original color three-channel image, performing distance transformation on the target contour binary map, modifying the pixel value of each pixel point to a corresponding distance value, obtaining a distance map, obtaining each local peak value in the distance map as the center point of an initial growth region, performing contour search on the target contour binary map, obtaining a plurality of target contours and their corresponding outer contours and inner contours, obtaining the concave points of each outer contour and the convex points of the inner contour as the termination points of the growth conditions, creating a blank image of the same size as the distance map, drawing a circle in the blank image with the center points of each initial growth region as the center and the corresponding distance value as the radius, obtaining a seed region map and a plurality of seed growth connected domains, and performing a flooding step by replacing a seed point with a seed growth connected domain, so that the flooding step is more uniform, avoiding the instability caused by improper selection of a single seed point, and reducing the seed point. The degree of dependence of the sub-selection is determined, and then it is determined whether the number of seed growth connected domains in each target contour is greater than 1. If so, the termination point of each growth condition in each target contour is connected to the center point of the corresponding connected domain, and the connecting line between the two is expanded to the corresponding connected domain to obtain the updated connected domain. If not, it remains unchanged. Before the subsequent flooding step, the termination point of the growth condition is calculated and added to the connected domain, so that when the flooding starts, the boundaries of each area meet first to reduce the possibility of unclear boundaries or errors, and avoid the problem of over-segmentation or under-segmentation caused by the flooding process. Finally, various sub-growth connected domains and updated connected domains are modified to different values, and the adjacent pixels of various sub-growth connected domains and updated connected domains are modified to their corresponding pixel values, until the pixel values ​​of all pixels corresponding to the target contour coverage area in the target contour binary map in the seed region map are modified, and the segmented seed region map is obtained to complete the image segmentation. The problem that the prior art has a high dependence on seed selection, which leads to over-boundary segmentation in the flooding process, or over-segmentation or under-segmentation in the flooding process is easily caused. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A flow chart of a method for segmenting a microscopic image formed component according to an embodiment of the present invention;

[0041] Figure 2is a schematic diagram of an original color three-channel image according to an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of a target contour binary image according to an embodiment of the present invention;

[0043] Figure 4 is a schematic diagram of a distance map according to an embodiment of the present invention;

[0044] Figure 5 A schematic diagram of a concave point obtained when two contours intersect in an embodiment of the present invention;

[0045] Figure 6 A schematic diagram of concave and convex points obtained when three contours intersect in an embodiment of the present invention;

[0046] Figure 7 is a schematic diagram of a seed region map according to an embodiment of the present invention;

[0047] Figure 8 is a schematic diagram of an expanded connected domain according to an embodiment of the present invention;

[0048] Fig. 9 It is a schematic diagram of the final segmentation result of an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] It should be noted that if the embodiments of the present invention involve directional indications, such as up, down, left, right, front, back, etc., then the directional indication is only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly. In addition, if the embodiments of the present invention involve descriptions of "first, second", "S1, S2", "step one, step two", etc., then such descriptions are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of indicated technical features or indicating the execution order of the method, etc. Those skilled in the art can understand that anything that does not violate the gist of the invention under the technical concept of the invention should be included in the protection scope of the present invention.

[0051] like Figure 1 As shown, the present invention provides a method for segmenting a microscopic image shaped component:

[0052] S1: Get the target contour binary image of the original color three-channel image;

[0053] Specifically, it is optional but not limited to converting the original color three-channel image from the RGB color space to the HSV color space to obtain the saturation channel image and the brightness channel image of the original color three-channel image in the HSV color space, and then preferably calculating the gradient map of the brightness channel image in the x direction and the y direction, and merging the two to obtain the gradient amplitude map of the brightness channel image, and then obtaining the binary image of the saturation channel image and the binary image of the gradient amplitude map, and performing an OR operation on the two to obtain the target contour binary map corresponding to the original color three-channel image.

[0054] Preferably, the step of obtaining the target contour binary image of the original color three-channel image may optionally include but is not limited to:

[0055] S11: converting the original color three-channel image into the HSV color space to obtain a saturation channel image and a brightness channel image;

[0056] Specifically, it is optional but not limited to converting the color according to the general color conversion formula or calling the relevant function in the image processing library. Figure 2 The original color three-channel image shown is converted into the HSV color space to obtain the saturation channel image and the brightness channel image corresponding to the original color three-channel image.

[0057] For example, the pixel value of each pixel in the original three-channel color image can be divided by 255 so that the pixel value of each pixel is in the range of 0-1, and then the maximum pixel value max and the minimum pixel value min of all pixels are obtained. The pixel value of each pixel in each channel image can be calculated according to the maximum pixel value max and the minimum pixel value min and the difference between the two df=max-min to obtain the saturation channel image and the brightness channel image:

[0058] When max is 0, the pixel value S of each pixel in the saturation channel image is 0. When max is not 0, the pixel value S of each pixel in the saturation channel image is S = df / max; the pixel value V of each pixel in the brightness channel image is max.

[0059] S12: Obtaining a gradient magnitude map of a brightness channel image;

[0060] Specifically, it is optional but not limited to contrast enhancement of the brightness channel image to enhance the brightness difference in the image, improve the visual effect of the image, highlight the details and texture of the image, and then calculate the gradient map of the brightness channel image in the set direction through the gradient operator, and finally merge the gradient maps in each direction to obtain the gradient amplitude map; the gradient operator may optionally include common gradient operators such as Sobel operator, Prewitt operator, Roberts operator, Laplace operator, etc.; the set direction may optionally include x direction, y direction, z direction, etc., which can be arbitrarily set by technical personnel in this field according to specific needs.

[0061] Preferably, the step of obtaining the gradient magnitude map of the brightness channel image may optionally include but is not limited to:

[0062] S121: performing contrast enhancement on the brightness channel image to obtain an optimized brightness channel image;

[0063] S122: Obtaining the gradient map of the optimized brightness channel image in the X and Y directions;

[0064] S123: Merge all gradient maps to obtain a gradient amplitude map.

[0065] Specifically, it is optional but not limited to performing contrast enhancement on the brightness channel image through an image contrast enhancement algorithm to improve the contrast and visual quality of the image. To optimize the brightness channel image, the Sobel operator is preferably used to calculate the gradient maps of the optimized brightness channel image in the X and Y directions to obtain the edge features in the horizontal and vertical directions of the image respectively, and then the gradient maps of the optimized brightness channel image in the X and Y directions are merged to obtain a gradient amplitude map to more clearly display the edge information of the image; the image contrast enhancement algorithm may optionally include commonly used image contrast enhancement algorithms such as histogram equalization algorithm, contrast stretching algorithm, contrast-limited adaptive histogram equalization algorithm and gamma correction algorithm.

[0066] For example, it is optional but not limited to obtaining the gradient map of the brightness channel image in the X and Y directions according to equations 2-3 and 2-4, and then merging the gradient maps of the brightness channel image in the X and Y directions according to equation 2-5 to obtain the gradient amplitude map:

[0067] 2-1

[0068] 2-2

[0069] 2-3

[0070] 2-4

[0071] 2-5

[0072] Among them, Sobelx and Sobely are the kernels of the Sobel operator in the x and y directions respectively, Gx and Gy are the gradient maps of the optimized brightness channel image in the X and Y directions respectively, Img_V_Enhance is the optimized brightness channel image, and Img_V_Gradinet is the gradient amplitude map of the optimized brightness channel image.

[0073] S13: Obtain a binary image of the saturation channel image and a binary image of the gradient amplitude map, and perform an OR operation on the two to obtain a target contour binary map.

[0074] Specifically, the specific steps of obtaining the target contour binary image may include but are not limited to:

[0075] S131: performing adaptive binary segmentation on the saturation channel image to obtain a binary image of the saturation channel image;

[0076] Specifically, it is optional but not limited to performing adaptive binary segmentation on the saturation channel image obtained in step S1 according to an image segmentation algorithm, taking the target contour covered area as the foreground area and the non-target contour covered area as the background area, and dividing the saturation channel image into a foreground area and a background area, and then modifying the pixel values ​​of the pixels covered in the foreground area to the first pixel value, and modifying the pixel values ​​of the pixels covered in the background area to the second pixel value, so as to obtain a binary image of the saturation channel image; the image segmentation algorithm may be optional but not limited to commonly used algorithms such as Otsu algorithm OSTU, Canny edge detection algorithm, and region growing algorithm; preferably, the image segmentation algorithm selects Otsu algorithm OSTU, the first pixel value is 255, and the second pixel value is 0.

[0077] S132: performing threshold segmentation on the gradient amplitude map to obtain a binary image of the gradient amplitude map;

[0078] Specifically, it is optional but not limited to optimizing the gradient amplitude of the brightness channel image according to the image threshold segmentation method Figure 2 The image is quantized to obtain a binary image of the gradient amplitude map, so as to extract the more obvious target edge and internal texture information in the gradient amplitude map; the image threshold segmentation method can adopt the maximum inter-class variance method (Otsu), the minimum error method (Minimum Error Method), the entropy-based method (Entropy-based Methods), the clustering-based method (Clustering-based Methods) and other commonly used segmentation methods.

[0079] Taking the steps of threshold segmentation of the gradient amplitude map according to the maximum inter-class variance method as an example, first calculate the grayscale histogram of the gradient amplitude map to obtain the number of pixels at each grayscale level, then traverse all possible thresholds T (0 to 255), and calculate the inter-class variance of the foreground and background for each threshold (that is, the difference in grayscale distribution between the target contour coverage area and the non-target contour coverage area) to find the threshold that maximizes the inter-class variance , even if the difference between the foreground and the background is the largest threshold, the final threshold Binarize the gradient magnitude map, that is, convert the pixel value greater than the threshold The pixel value of the pixel is changed to 255, and the pixel value is less than the threshold By changing the pixel value of the pixel to 0, the binary image of the gradient amplitude map can be obtained.

[0080] S133: Perform an OR operation on the binary images of the gradient amplitude image and the saturation channel image to obtain a target contour binary image.

[0081] Specifically, it is optional but not limited to perform an OR operation on the binary image of the saturation channel image and the binary image of the gradient amplitude map of the brightness channel image, calculate and modify the pixel value of each pixel in the binary image of the gradient amplitude map, and obtain the following: Figure 3 The target contour binary image is shown.

[0082] For example, an OR operation is performed on the binary image of the saturation channel image and the binary image of the gradient amplitude map. Because there is a one-to-one correspondence between each pixel in the two binary images, when the pixel value of each corresponding pixel is 255 or 0, the pixel value remains unchanged. When the pixel values ​​of the corresponding pixels are one 0 and one 255, the pixel value of the corresponding pixel in the binary image of the gradient amplitude map is modified to 255. The final binary image is the target contour binary map.

[0083] S2: Perform distance transformation on the target contour binary image, modify the pixel value of each pixel point to the corresponding distance value, obtain a distance map, and obtain several local peaks in the distance map as the center points of the initial growth area;

[0084] Specifically, it is optional but not limited to performing distance transformation on the target contour binary image through the image distance transformation method, replacing the pixel value of each pixel in the target contour binary image with the minimum distance value between it and the preset target pixel, and then traversing the pixel points in the distance map, comparing the distance value between the current pixel point and other pixel points within the set radius. If the distance value of the current pixel point is the largest, it is a local peak. After the traversal is completed, several local peaks can be obtained, which are the center points of the initial growth area; the image distance transformation method can be optional but not limited to using common distance transformation methods such as Euclidean distance method, Manhattan distance transformation, Chebyshev distance transformation, deep learning method, etc.; the preset target pixel and the set range are arbitrarily set by those skilled in the art. Preferably, the preset target pixel is a pixel point in the background area.

[0085] More specifically, step S2 may optionally include but is not limited to:

[0086] S21: Obtain the minimum distance value between each foreground point and the background point, and modify the pixel value of each foreground point to the corresponding minimum distance value to obtain a distance map;

[0087] Specifically, it is optional but not limited to taking the pixel points covered by the foreground area in step S131 as the foreground point and the pixel points covered by the background area as the background point, then obtaining the distance value between each foreground point and each background point, obtaining the minimum distance value between each foreground point and the background point, and replacing the pixel value of each foreground point with the minimum distance value between it and the background point, so as to obtain the following: Figure 4 As shown, the distance map corresponding to the target contour binary image.

[0088] S22: traverse the pixel points in the distance map, determine whether the pixel value of each pixel point is greater than other pixel points within the set radius, if so, it is a local peak; obtain several local peaks in the distance map;

[0089] Specifically, after obtaining the distance map according to step S21, it is optional but not limited to setting a radius range, traversing the pixel points in the distance map, comparing the pixel value between the current pixel point and other pixel points within the set radius range, if the pixel value of the current pixel point is the maximum value of all pixel points within the set radius range centered on it, then the pixel point is a local peak, and after the traversal is completed, several local peaks can be obtained; the radius range is set arbitrarily by technical personnel in this field.

[0090] Preferably, in order not to miss any possible local peaks in step 22, the radius range may be set too small, resulting in too small distances between local peaks, so that multiple local peaks are identified as one peak in subsequent steps, and different local peaks cannot be accurately distinguished, affecting the accuracy and stability of local peaks. Therefore, after obtaining several local peaks in the distance map according to step S22, it is necessary to optimize them, and the optimization step may optionally include:

[0091] S23: Obtain the distance between each local peak value, and determine whether it is greater than the set confidence distance threshold. If not, retain the corresponding local peak value. If so, determine the size of the two and remove the local peak value with smaller pixel value. Obtain several remaining local peak values ​​as the center point of the initial growth area.

[0092] Specifically, it is optional but not limited to setting a confidence distance threshold and creating a new mask image, marking the positions of all local peaks in the mask image, and then determining whether the distance between any two local peaks is greater than the set confidence distance threshold. If not, the corresponding local peak is considered to have a high reliability and can be retained. If so, it is considered that the distance between the two is too small, affecting the accuracy and stability of the local peak. It is necessary to remove the local peak with a smaller pixel value between the two and retain the local peak with a higher reliability. If the pixel values ​​of the two are equal, one of them can be selected. After all local peaks are compared, several remaining local peaks can be obtained, which are the center points of the initial growth area. The confidence distance threshold is set, which can be arbitrarily set by technicians in this field.

[0093] Preferably, before step S21, the method further includes:

[0094] S20: defining a structural element, and performing an opening operation on the target contour binary image according to the structural element to obtain an optimized target contour binary image;

[0095] Specifically, it is optional but not limited to pre-setting a structural element, and then comparing the size of the structural element with all connected components in the target contour binary map, removing the connected components with an area smaller than the structural element, thereby eliminating small noise and / or fine connections in the image, while retaining large structural features and contours, and then traversing each pixel in the target contour binary map through the structural element. When there is a white pixel (i.e., the pixel value is 255) in the coverage range of the structural element, all pixels covered by the structural element become white, otherwise they remain black (i.e., the pixel value is 0), thereby filling the contour gaps and obtaining a clearer contour, so as to obtain an optimized contour binary map, so as to accurately extract the center point of the initial growth area in the subsequent process, reduce the amount of calculation during contour segmentation, eliminate contour edge burrs, and reduce the misrecognition rate when extracting outer contour concave points and inner contour convex points in the subsequent process.

[0096] Preferably, the structural element may be optionally defined as an elliptical structural element as shown in Formula 2-6 to reduce the number of mistakenly deleted areas during the opening operation:

[0097] 2-6

[0098] Among them, elementEllipse33 is the defined structural element.

[0099] S3: Perform contour search on the target contour binary image to obtain several target contours and their corresponding outer contours and inner contours, and obtain the concave points of each outer contour and the convex points of the inner contour as the termination points of the growth condition;

[0100] Specifically, it is optional but not limited to performing contour search on the target contour binary image according to the image segmentation algorithm to obtain all target contours in the target contour binary image. Since multiple target contours may partially overlap to form a new target contour, the contour edge of the new target contour can be regarded as the outer contour, and the contour edges of the several target contours that constitute the new target contour located in the coverage area of ​​the new target contour can be regarded as the inner contour; when the target contours partially overlap, the contour edges of the target contours will produce several intersection points, the intersection points located on the outer contour are the concave points of the outer contour, and the intersection points located on the inner contour are the convex points of the inner contour, and the concave points of the outer contour and the convex points of the inner contour in each target contour can be obtained by contour analysis method as the termination points of the growth condition; the image segmentation algorithm can be optional but not limited to common algorithms such as Otsu algorithm OSTU, Canny edge detection algorithm, and region growing algorithm; the contour analysis method can be optional. Common algorithms such as convex hull algorithm and Harris corner detection algorithm are used.

[0101] For example, Figure 5 As shown in , when two contours intersect to form a new contour, two intersection points are generated, both located on the edge of the newly formed contour. The solid line part is the outer contour of the new contour, and the dotted line part is its inner contour. Therefore, there are two concave points on the outer contour corresponding to the contour, and the contour edges of the two contours located inside the new contour do not generate intersection points. Therefore, there are no convex points on the inner contour corresponding to the contour, as shown in Figure 6 As shown, when the three contours intersect, six intersection points are formed, three of which are located on the edge of the newly formed contour, that is, there are three concave points on the outer contour corresponding to the contour, and the other three intersection points are located inside the newly formed contour, that is, there are three convex points on the inner contour corresponding to the contour.

[0102] S4: creating a blank image of the same size as the distance map, drawing a circle in the blank image with the center point of each initial growth region as the center and the corresponding distance value as the radius, and obtaining a seed region map and several initial seed growth connected domains therein;

[0103] Specifically, it is optional but not limited to creating a blank image of the same size as the distance map, and drawing a circle in the blank image with the pixel point corresponding to the center point of each initial growth area in the blank image as the center and the distance value corresponding to the center point of each initial growth area as the radius. The drawn circle is the initial seed growth connected domain obtained.

[0104] More specifically, step S4 is preferably:

[0105] S41: sorting the center points of the initial growth regions in a set order according to the corresponding distance values ​​to obtain a coordinate set.

[0106] S42: creating a blank image of the same size as the distance map, and taking the center points of each initial growth region as the current center point in turn according to the coordinate set;

[0107] S43: Draw a circle in the blank image with the current center point as the center and the corresponding distance value as the radius, to obtain an initial seed growth connected domain corresponding to the current center point;

[0108] Specifically, it is optional but not limited to arranging the center points of each initial growth area in a set order according to the corresponding distance values, treating the arranged center points of each initial growth area as a coordinate set, and then creating a blank image of the same size as the distance map, and according to the arrangement order of the center points of each initial growth area in the coordinate set, taking the center point of each initial growth area as the current center point and taking it as the center and the corresponding distance value as the radius to draw a circle in the blank image to obtain the initial seed growth connected domain corresponding to the current center point.

[0109] Preferably, the setting order is to sort from large to small according to the distance value of the center point of each initial growth area.

[0110] S43: remove all the center points of the initial growth area in the initial seed growth connected domain corresponding to the current center point, and execute step S44;

[0111] S44: Determine whether there is still an initial growth region center point that has not obtained the corresponding initial seed growth connected domain. If so, return to step S42; if not, obtain the seed region map and several initial seed growth connected domains.

[0112] Specifically, all the center points of the initial growth regions in the initial seed growth connected domain corresponding to the current center point may be removed from the coordinate set, and the remaining center points of the initial growth regions continue to be arranged in the set order, and then the process returns to step S42, and the process iterates continuously until there are no remaining center points of the initial growth regions in the coordinate set, and the following can be obtained: Figure 7 The seed region diagram shown, and several of the initial seed growth connected domains.

[0113] S5: Determine whether the number of connected domains in each contour is greater than 1. If so, connect the end point of each growth condition in each target contour with the center point of the corresponding connected domain, and expand the connecting line between the two to the corresponding connected domain to obtain an updated connected domain. If not, keep it unchanged.

[0114] Specifically, it is optional but not limited to obtaining the center point of each connected domain according to the image geometry analysis method, and then judging whether there are multiple connected domains in each contour according to the several contours obtained in step S3 and the connected domains of the several initial seed growth areas obtained in step S4. If so, the center point of each connected domain is connected to the growth condition termination point in the contour according to the set rules, and the part of the line connecting the two except the growth condition termination point is regarded as the extension part of the corresponding connected domain. If not, the connected domain of the initial seed growth area contained in the contour is not processed; the image geometry analysis method may optionally include commonly used analysis methods such as contour analysis method, minimum circumscribed rectangle method, geometric feature analysis method, model fitting method, etc.; the setting rules are arbitrarily set by those skilled in the art.

[0115] Preferably, when there are multiple connected domains in the contour, the connection setting rule between the center point of each connected domain and the growth condition termination point in the contour where it is located can be selected as follows:

[0116] Connect the corresponding growth condition termination points in order according to the size of each connected domain. The larger connected domain will be connected first to the growth condition termination point closest to it.

[0117] The connecting lines between the center points of all connected domains and the termination points of the growth conditions do not intersect;

[0118] The connecting line between the center point of the connected domain and the growth condition termination point does not include the growth condition termination point itself.

[0119] Further preferably, when the number of connected domains in the contour is greater than 2, the connected domains with the closest distance are combined in pairs, and the minimum convex hull is fitted to determine whether there is a growth condition termination point in the fitted convex hull. If so, the lines are connected according to the set rules.

[0120] For example, it is optional to first determine whether the number of connected domains in each contour is greater than 1. If the contour contains only one connected domain, it means that the contour is a single target and there is no need to expand the seed area. When the contour contains multiple connected domains, it means that the target contained in the contour is a sticky multiple target, and the connected domain needs to be expanded to ensure the segmentation accuracy. Then it is also necessary to determine whether there is a growth condition termination point in the contour. When there is a growth condition termination point in the contour, the multiple connected domains in the contour can be expanded. Then, the connected domains with the closest distance in the contour are combined in pairs and fitted into a minimum convex hull. The growth condition termination points contained in the convex hull are connected by straight lines along the center of the seed area according to the set rules, and the formed straight lines are added to the corresponding connected domains to obtain the expanded connected domains, such as Figure 8 As shown in the figure, the white circular area is the connected domain before expansion, the several white straight lines extending outward from each connected domain are the extended parts, and the white circular area plus the several extended straight lines are the connected domain after expansion. The rules for connecting lines include:

[0121] 1) Prioritize links with larger seed connectivity areas.

[0122] 2) All the lines drawn must fall within the outline.

[0123] 3) The current line does not intersect with any drawn lines and does not intersect with other connected domains

[0124] 4) The line does not include the end point of the growth condition.

[0125] S6: Modify various sub-growing connected domains and updated connected domains to different pixel values, and modify the adjacent pixel points of various sub-growing connected domains and updated connected domains to their corresponding values, until the pixel values ​​of all pixel points in the seed area map corresponding to the target contour coverage area in the target contour binary map are modified, and the segmented seed area map is obtained, thereby completing the image segmentation.

[0126] Specifically, it is optional but not limited to marking various sub-growing connected domains and updated connected domains as different pixel values ​​between (0--N] (where N represents the number of connected domains), and then modifying the adjacent foreground point pixels to the same value as the nearest connected domain based on the image processing algorithm with each growing region as the center, until the pixel values ​​of all pixels corresponding to the target contour coverage area in the target contour binary image in the seed region map are modified, such as Fig. 9 As shown, several regions with different pixel values ​​in the seed region map are obtained as the final segmentation result; the image processing algorithm may be selected but is not limited to the common algorithms including watershed segmentation algorithm, flood fill algorithm, region-based segmentation algorithm, edge-based segmentation algorithm, graph-based segmentation algorithm, clustering-based segmentation algorithm, etc. Preferably, the image processing algorithm adopts the watershed segmentation algorithm.

[0127] In this embodiment, a segmentation method of a microscopic image tangible component of the present invention is provided, by obtaining a target contour binary map of an original color three-channel image, and then performing distance transformation on the target contour binary map, modifying the pixel value of each pixel point to a corresponding distance value, obtaining a distance map, and obtaining each local peak in the distance map as the center point of an initial growth area, and then performing contour search on the target contour binary map to obtain a number of target contours and their corresponding outer contours and inner contours, and obtaining the concave points of each outer contour and the convex points of the inner contour as the growth condition termination points, and then creating a blank image of the same size as the distance map, and drawing a circle in the blank image with the center point of each initial growth area as the center and the corresponding distance value as the radius, to obtain a seed area map and a number of seed growth connected domains, and performing the flooding step by using the seed growth connected domain instead of the seed point, so that the flooding step is more uniform, avoiding the instability caused by improper selection of a single seed point, and reducing the The degree of dependence on seed selection is determined, and then it is determined whether the number of seed growth connected domains in each target contour is greater than 1. If so, each growth condition termination point in each target contour is connected to the center point of the corresponding connected domain, and the connecting line between the two is expanded to the corresponding connected domain to obtain an updated connected domain. If not, it remains unchanged. Before the subsequent flooding step, the growth condition termination point is first calculated and added to the connected domain, so that when the flooding starts, the boundaries of each area meet first to reduce the possibility of unclear boundaries or errors, and avoid the problem of over-segmentation or under-segmentation caused by the flooding process. Finally, various sub-growth connected domains and updated connected domains are modified to different values, and the adjacent pixels of various sub-growth connected domains and updated connected domains are modified to their corresponding pixel values, until the pixel values ​​of all pixels corresponding to the target contour coverage area in the target contour binary map in the seed region map are modified, and the segmented seed region map is obtained to complete the image segmentation. The high dependence of the prior art on seed selection is solved, which leads to the problem that over-boundary segmentation is easily caused in the flooding process, or over-segmentation or under-segmentation is easily caused in the flooding process.

[0128] On the other hand, the present invention further provides a computer storage medium storing executable program code; the executable program code is used to execute any of the above-mentioned methods for segmenting formed components of microscopic images.

[0129] On the other hand, the present invention also provides a terminal device, including a memory and a processor; the memory stores program codes that can be executed by the processor; the program codes are used to execute any of the above-mentioned methods for segmenting visible components of microscopic images.

[0130] Exemplarily, the program code may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the program code in the terminal device.

[0131] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the terminal device may also include an input / output device, a network access device, a bus, etc.

[0132] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0133] The memory may be an internal storage unit of the terminal device, such as a hard disk or a memory. The memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device. Further, the memory may also include both an internal storage unit of the terminal device and an external storage device. The memory is used to store the program code and other programs and data required by the terminal device. The memory may also be used to temporarily store data that has been output or is to be output.

[0134] The above-mentioned computer storage medium and terminal device are created based on the above-mentioned method for segmenting the visible components of the microscopic image. Their technical functions and beneficial effects are not repeated here. The various technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the various technical features in the above-mentioned embodiments are not 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.

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

Claims

1. A method for segmenting a microscopic image shaped component, characterized in that: include: Get the target contour binary image of the original color three-channel image; Perform distance transformation on the target contour binary image, modify the pixel value of each pixel point to the corresponding distance value, and obtain a distance map, so as to obtain several local peaks in the distance map as the center points of the initial growth area; Perform contour search on the target contour binary image to obtain several target contours and their corresponding outer contours and inner contours, and obtain the concave points of each outer contour and the convex points of the inner contour as the termination points of the growth conditions; Create a blank image of the same size as the distance map, draw a circle in the blank image with the center point of each initial growth area as the center and the corresponding distance value as the radius, and obtain the seed area map and several seed growth connected domains therein; Determine whether the number of seed growth connected domains in each target contour is greater than 1. If so, connect the end point of each growth condition in each target contour with the center point of the corresponding connected domain, and expand the connecting line between the two to the corresponding connected domain to obtain the updated connected domain. If not, leave it unchanged. Various sub-growing connected domains and updated connected domains are modified to different pixel values, and the adjacent pixel points of various sub-growing connected domains and updated connected domains are modified to their corresponding values, until the pixel values ​​of all pixel points in the seed area map corresponding to the target contour coverage area in the target contour binary map are modified, and the segmented seed area map is obtained to complete the image segmentation.

2. The method according to claim 1, characterized in that The steps of obtaining the target contour binary image of the original color three-channel image include: Convert the original color three-channel image to the HSV color space to obtain a saturation channel image and a brightness channel image; Get the gradient magnitude map of the brightness channel image; The binary image of the saturation channel image and the binary image of the gradient amplitude map are obtained, and an OR operation is performed on the two to obtain a binary map of the target contour.

3. The method according to claim 2, characterized in that The steps of obtaining the gradient magnitude map of the brightness channel image include: Perform contrast enhancement on the brightness channel image to obtain an optimized brightness channel image; Get the gradient map of the optimized brightness channel image in the X and Y directions; Merge all gradient maps to get the gradient magnitude map.

4. The method according to claim 3, characterized in that The step of obtaining a binary image of a saturation channel image and a binary image of a gradient amplitude map, and performing an OR operation on the two to obtain a target contour binary map includes: Adaptively perform binary segmentation on the saturation channel image to obtain a binary image of the saturation channel image; Perform threshold segmentation on the gradient amplitude map to obtain a binary image of the gradient amplitude map; Perform an OR operation on the binary images of the gradient magnitude image and the saturation channel image to obtain a target contour binary image.

5. The method according to claim 1, characterized in that The steps of obtaining several local peaks in the distance map include: Obtain the minimum distance value between each foreground point and background point, and modify the pixel value of each foreground point to the corresponding minimum distance value to obtain a distance map; Traverse the pixel points in the distance map to determine whether the pixel value of each pixel point is greater than other pixel points within the set radius. If so, it is a local peak; and obtain several local peaks in the distance map.

6. The method according to claim 5, characterized in that The step of obtaining a number of local peaks in the distance map also includes: Get the distance between each local peak and determine whether it is greater than the set confidence distance threshold. If not, retain the corresponding local peak. If so, determine the size of the two and remove the local peak with smaller pixel value. Get several remaining local peaks, which are the center points of the initial growth area.

7. The method according to claim 6, characterized in that Before getting the distance map, it also includes: A structural element is defined, and an opening operation is performed on the target contour binary image according to the structural element to obtain an optimized target contour binary image.

8. The method according to claim 1, characterized in that The step of obtaining a seed region map and a plurality of initial seed growth connected domains also includes: S41: sorting the center points of each initial growth region according to the corresponding distance values ​​in a set order to obtain a coordinate set; S42: creating a blank image of the same size as the distance map, and taking the center points of each initial growth region as the current center point in turn according to the coordinate set; S43: Draw a circle in the blank image with the current center point as the center and the corresponding distance value as the radius, to obtain an initial seed growth connected domain corresponding to the current center point; S44: Determine whether there is still an initial growth region center point that has not obtained the corresponding initial seed growth connected domain. If so, return to step S42; if not, obtain the seed region map and several initial seed growth connected domains.

9. A computer storage medium, characterized in that An executable program code is stored; the executable program code is used to execute the method for segmenting the formed components of a microscopic image according to any one of claims 1 to 8.

10. A terminal device, characterized in that: It comprises a memory and a processor; the memory stores a program code executable by the processor; the program code is used to execute the method for segmenting a microscopic image shaped component according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Cell image segmentation method and device and computer readable storage medium

    CN113781515A

  • Multi-colony body counting method based on image segmentation algorithm

    CN113902713A