A cell segmentation method for FISH microscopic images
Through traditional image processing methods, including image preprocessing, contour extraction and clustering segmentation, the problem of low cell segmentation efficiency in FISH microscopic images is solved, fast and accurate cell segmentation is achieved, and is suitable for equipment with limited resources.
Patent Information
- Application Number
- CN202410815889.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Existing cell segmentation methods in FISH microscopic images suffer from the problems of high computational complexity and poor robustness, resulting in low processing efficiency.
A method based on traditional image processing is adopted, including steps such as image preprocessing, fixed threshold segmentation, contour extraction, dilation and erosion, distance weight map calculation, cell inscribed circle positioning and cluster segmentation, through which the cell outline is achieved. Fast and accurate segmentation.
It achieves fast and accurate cell segmentation in microscopic images and can be efficiently processed on equipment with limited computing resources. It has a high cell extraction rate, accurate segmentation results, and good robustness.
Smart Images

Figure CN118379734B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image recognition, and in particular to a FISH microscopic image cell segmentation method. Background Art
[0002] Fluorescence in situ hybridization, abbreviated as FISH, is a molecular cell biology technique used to detect and locate specific nucleic acid sequences, which are DNA or RNA. FISH technology is widely used in genomic research, clinical diagnosis and cancer research. FISH technology uses fluorescently labeled probes to hybridize with specific nucleic acid sequences in cell or tissue samples. The hybridized sample is observed under a fluorescence microscope, and the area where the probe binds will show a fluorescent signal, thereby achieving the detection and location of the target nucleic acid sequence.
[0003] Image processing of fluorescence signal images captured by multiple channels can help quantitatively analyze the intensity, position and distribution of fluorescence signals, thereby obtaining the precise positioning and expression level of the target nucleic acid sequence in cells or tissues.
[0004] At present, the mainstream image segmentation method uses deep neural networks, which are highly robust and accurate. However, the problem is that it requires a large amount of sample annotation and model training, and the hardware support of the graphics processing unit (GPU) is required in the prediction and reasoning stage of image processing, which is time-consuming.
[0005] At present, cell segmentation algorithms based on traditional image processing methods either have problems of high computational complexity or poor algorithm robustness and unstable results. Summary of the invention
[0006] The invention provides a FISH microscopic image cell segmentation method to solve the technical problem of low efficiency of cell segmentation in microscopic images.
[0007] In order to solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0008] A FISH microscopic image cell segmentation method comprises the following steps:
[0009] Step S1: obtaining an original grayscale image of a microscopic image, preprocessing the image, and obtaining a preprocessed grayscale image;
[0010] Step S2: Use a fixed threshold to segment the preprocessed grayscale image to obtain a binary image. raw ;
[0011] Step S3: Based on the binary image raw , use the contour extraction algorithm to extract the contour line of the cell and obtain the initial cell contour image Contours raw ;
[0012] Step S4: Calculate the initial cell contour image Contours raw The area of each contour line in the image is obtained, and the cell contour image after contour filtering is obtained based on 1000 pixels < contour area S < 5000 pixels;
[0013] Step S5: Binary image raw Perform expansion and corrosion to obtain a binary image after expansion and corrosion. Calculate the distance from each foreground pixel to the nearest background pixel based on the binary image after expansion and corrosion. Transform the binary image after expansion and corrosion and obtain the distance weight map Dist dilation ;
[0014] Step S6: Based on the distance weight map Dist dilation , locate the cell position and size, and obtain the circular label area map Image tag ;
[0015] Step S7: Based on the circular label area image Image tag , from the binary image Binary raw Extract the image containing the outline of the cell to be segmented; obtain non-zero pixel points P(x, y) from the image containing the outline of the cell to be segmented, and classify each non-zero pixel point P(x, y) into the cell inscribed circle list List circles In a circle in the image, the cell outline image after cluster segmentation is obtained;
[0016] Step S8: Based on the cell contour image after cluster segmentation, obtain the circularity ratio Ratio of each contour line in the cell contour image after cluster segmentation, obtain all contour lines with circularity ratio Ratio>0.7, and form a cell contour image after secondary filtering.
[0017] A further technical solution is: in step S1, an original grayscale image of the microscopic image is obtained, the original grayscale image is denoised using Gaussian filtering and mean filtering to obtain a denoised grayscale image, the denoised grayscale image is contrast enhanced to obtain an enhanced grayscale image, the grayscale values of the enhanced grayscale image are remapped to the interval [0,255] to obtain a preprocessed grayscale image.
[0018] A further technical solution is that: in step S5, three dilation operations are first performed, and then an erosion operation is performed to obtain a binary image after dilation and erosion.
[0019] A further technical solution is: in step S5, the distance from each foreground pixel to the nearest background pixel is calculated according to the Euclidean distance algorithm.
[0020] A further technical solution is that: the step S6 is specifically divided into the following steps: dilation , loop through the following steps:
[0021] Step S601: traverse the distance weight graph Dist dilation Find and obtain the maximum pixel value Val among all pixels in max , get the pixel with the maximum pixel value and the position of the pixel A max (x max ,y max );
[0022] Step S602: If the minimum radius threshold Thresh of the cell inscribed circle is not set, set Thresh=Val max ×ratio; the value range of ratio is [0,1];
[0023] Step S603: Record the position A of the pixel with the maximum pixel value max (x max ,y max ) and the maximum pixel value Val max List of circles inscribed in the cell circles middle;
[0024] Step S604: In the distance weight map Dist dilation Delete the pixel with the maximum pixel value from position A max , and perform non-maximum suppression NMS;
[0025] Step S605: If the maximum pixel value Val max ≥ the minimum radius threshold Thresh of the cell inscribed circle, then return to step S601 to continue execution, otherwise obtain the cell inscribed circle list List after non-maximum suppression is completed circles And exit the loop execution step S606;
[0026] Step S606: If the cell inscribed circle list List is not completed after maximum value suppression circles If it is empty, it ends; if it is not the cell inscribed circle list after the maximum suppression is completed, circles Not empty, the list of inscribed circles in the cell after non-maximum suppression is completed circles The information of the circle including the center and radius is stored in the image. Based on the information of the circle, all circles are drawn and the circle label area map is obtained.tag , execute step S7.
[0027] A further technical solution is that: in step S604, the position A of the pixel with the maximum pixel value is max (x max ,y max ) is the center of the circle, and the maximum pixel value is Val max is the radius, in the distance weight map Dist dilation Draw a circle and set all values within the circle to 0.
[0028] A further technical solution is that in step S606, all circles are drawn based on the information of the circles and a circular label area image Image is obtained. tag , with a list of inscribed circles in the cell circles Each center and radius of the circle in the distance weight map Dist dilation Draw a circle and set all the values in the circular area from 1 to the cell inscribed circle list List circles The length of List is [1, circles . length], each circular area is filled with a value different from the other circles.
[0029] A further technical solution is that in step S7, according to formula 8, the circular label area image Image obtained in step S6 tag and the binary image obtained in step S2 raw , calculate and obtain an image containing the outline of the cells to be segmented;
[0030] Image untaged =bitwise_and(bitwise_not(Image tag ),Binary raw ) Formula 8
[0031] In formula 8, Image untaged is the image containing the outline of the cells to be segmented, i.e., the C image; tag For circular label area chart, Binary raw is the original cell binary image, bitwise_and(A,B) is the logical AND operation, A corresponds to bitwise_not(Image tag ), B corresponds to Binary raw, bitwise_and(A,B)=C, that is, the logical AND operation of two images A and B of the same size is performed to obtain the C image. The logical AND operation is performed on each pixel point (x, y) in the two images A and B of the same size. If the pixel point A(x, y) of the A image and the pixel point B(x, y) of the B image are not 0 at the same time, then the value of the corresponding pixel point C (x, y) in the C image is A(x, y), otherwise C(x, y)=0; bitwise_not(Image tag ) is to logically negate the circular label area chart.
[0032] A further technical solution is that: in step S7, each non-zero pixel point P(x, y) is classified into a cell inscribed circle list List circles The steps in a circle in List include inscribed circles in the cell List circles The number of circles in the cell is used as the number of categories, and the list of inscribed circles in the cell is used as the list of inscribed circles in the cell. circles Each center C t (x t ,y t ) as the cluster center point and apply the clustering algorithm.
[0033] The beneficial effects of adopting the above technical solution are:
[0034] A FISH microscopic image cell segmentation method comprises the following steps: step S1: obtaining an original grayscale image of a microscopic image, preprocessing the image, and obtaining a preprocessed grayscale image; step S2: segmenting the preprocessed grayscale image with a fixed threshold to obtain a binary image. raw ; Step S3: Based on the binary image Binary raw , use the contour extraction algorithm to extract the contour line of the cell and obtain the initial cell contour image Contours raw ; Step S4: Calculate the initial cell contour image Contours raw The area of each contour line in the image is obtained, and the area of each contour is obtained. Based on 1000 pixels < contour area S < 5000 pixels, the cell contour image after contour filtering is obtained; Step S5: Binary image raw Perform expansion and corrosion to obtain a binary image after expansion and corrosion. Calculate the distance from each foreground pixel to the nearest background pixel based on the binary image after expansion and corrosion. Transform the binary image after expansion and corrosion and obtain the distance weight map Dist dilation ; Step S6: Based on the distance weight map Dist dilation , locate the cell position and size, and obtain the circular label area map Image tag; Step S7: Based on the circular label area image Image tag , from the binary image Binary raw Extract the image containing the outline of the cell to be segmented; obtain non-zero pixel points P(x, y) from the image containing the outline of the cell to be segmented, and classify each non-zero pixel point P(x, y) into the cell inscribed circle list List circles In a circle in the cluster, a cell contour image after cluster segmentation is obtained; step S8: based on the cell contour image after cluster segmentation, the near-circularity ratio Ratio of each contour line in the cell contour image after cluster segmentation is obtained, and all contour lines with near-circularity ratio Ratio>0.7 are obtained to form a cell contour image after secondary filtering. Through steps S4, S5, S7 and S8, cell segmentation in the microscopic image is fast and accurate.
[0035] Please refer to the detailed description of the specific implementation method. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1a is the original grayscale image of the microscopic image;
[0037] Figure 1b is the grayscale image after denoising;
[0038] Figure 2 is the preprocessed grayscale image;
[0039] Figure 3 is a binary image;
[0040] Figure 4 is the initial cell outline image;
[0041] Figure 5 is the cell contour image after contour filtering;
[0042] Figure 6 It is the binary image after dilation and erosion;
[0043] Figure 7 is a distance weighted graph;
[0044] Figure 8a is an image of a circular labeled area map;
[0045] Figure 8b It is an image with the original cell binary image as the background and the circular label area map superimposed;
[0046] Fig. 9 is an image containing the outlines of cells to be segmented;
[0047] Fig.10 It is the cell outline image after clustering segmentation;
[0048] Fig.11 It is the cell outline image after secondary filtering;
[0049] Fig.12 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0050] For the cell segmentation task in FISH microscopic images, a well-designed segmentation method based on traditional image processing can quickly and accurately segment the vast majority of adherent cell clusters in the field of view and extract cells with excellent imaging quality and no overlap, meeting the needs of FISH image processing. It can be deployed on devices with limited computing resources for local processing.
[0051] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present application and its application or use. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present application. Therefore, the present application is not limited to the specific embodiments disclosed below.
[0053] like Fig.12 As shown, the present invention discloses a FISH microscopic image cell segmentation method comprising the following steps:
[0054] Step S1: Image preprocessing
[0055] The original grayscale image of the microscopic image is obtained, and the original grayscale image is denoised using Gaussian filtering and mean filtering to obtain a denoised grayscale image, and the contrast of the denoised grayscale image is enhanced to obtain an enhanced grayscale image, and the grayscale values of the enhanced grayscale image are remapped to the interval [0,255] to obtain a preprocessed grayscale image.
[0056] According to Formula 1, the grayscale value of the enhanced grayscale image is remapped to the interval [0, 255].
[0057] dst(x,y)=max(0,src(x,y)-Val min )×(255 / max(Val max -Val min,1)) Formula 1
[0058] In formula 1, dst(x,y) is the value of the pixel with coordinates (x,y) in the target image, src(x,y) is the value of the pixel with coordinates (x,y) in the image to be processed, max(a,b) function means taking the larger value of a and b, Val min is the minimum pixel value in the image to be processed, Val max is the maximum pixel value in the image to be processed.
[0059] like Figure 1a As shown, the original grayscale image of the fluorescent signal image, i.e., the microscopic image, is obtained by shooting.
[0060] like Figure 1b The grayscale image after denoising is shown.
[0061] like Figure 2 The grayscale image after preprocessing is shown.
[0062] Step S2: Image Binarization
[0063] Use the fixed threshold to segment the preprocessed grayscale image obtained in step S1 to obtain the binary image Binary raw .
[0064] According to Formula 2, the preprocessed grayscale image is binarized to obtain a binarized image.
[0065] Formula 2
[0066] In Formula 2, dst(x,y) is the value of the pixel with coordinates (x,y) in the target image, src(x,y) is the value of the pixel with coordinates (x,y) in the image to be processed, thresh is a fixed threshold in the range of [0,255], which is set to 70 in this application; maxval is the maximum value of the pixel, which is 255 in this application.
[0067] like Figure 3 As shown, it is a binary image Binary raw .
[0068] Step S3: Extracting initial cell outlines
[0069] Binary image obtained based on step S2 raw , use the contour extraction algorithm to extract the contour of the cell to form the initial cell contour image Contours raw The initial cell contour image contains cell contour lines, which are lines formed by connecting multiple cell contours, lines formed by a single cell contour, or lines formed by low-quality cell contours.
[0070] The low-quality cell contours include impurities and unclear cell contour lines. It is difficult to distinguish whether the low-quality cell contours are impurities or cells, so they need to be discarded. Low quality refers to poor imaging quality.
[0071] The contours are extracted using a classic contour extraction algorithm. For example, the findContours function in the OpenCV image processing library can be used to extract the contours of cells in a binary image.
[0072] like Figure 4 The following is the initial cell contour image. At this time, the adherent cells have not separated, and the contours are connected. The initial cell contour image is recorded as Contours raw .
[0073] Step S4: Contour filtering
[0074] Calculate the initial cell contour image Contours obtained in step S3 raw The area of each contour line in the image is obtained, and based on 1000 pixels < contour area S < 5000 pixels, outliers that are too large or too small in the contour area are filtered out to obtain the cell contour image after contour filtering.
[0075] Use the OpenCV function couterArea to calculate the contour area. The principle is to use Green's formula, which is the second kind of curve integral.
[0076] Formula 3
[0077] In Formula 3, S is the contour area in pixels.
[0078] The filtering rule of this application is: 1000 pixels < contour area S < 5000 pixels, and contours that do not meet this condition will be discarded.
[0079] This step filters out some impurities and some cells with poor imaging quality, which does not affect the final FISH analysis results, while ensuring the correctness of the segmented cells.
[0080] like Figure 5 Shown are the cell outlines remaining after filtering.
[0081] Step S5: Based on the binary image raw Generate distance weighted graph
[0082] Binary image obtained in step S2 rawPerform morphological dilation and erosion operations to obtain a binary image after dilation and erosion. Calculate the distance from each foreground pixel to the nearest background pixel based on the binary image after dilation and erosion. Transform the binary image after dilation and erosion to obtain the distance weight map Dist dilation .
[0083] According to Formula 4, a custom kernel is used for dilation and erosion.
[0084] Formula 4
[0085] In Formula 4, kernel is the kernel used for dilation and erosion, that is, the operator of dilation and erosion operations, which is a customizable parameter.
[0086] First, three expansion operations are performed, and then an erosion operation is performed to obtain a binary image after expansion and erosion, which is used to eliminate the influence of the irregular outer contour of the cells.
[0087] like Figure 6 As shown, it is the binary image after dilation and erosion.
[0088] Then the binary image after expansion and corrosion is converted into a distance weighted map, denoted as Dist dilation .
[0089] The main purpose of distance transformation is to calculate the distance from each foreground pixel to the nearest background pixel. This process can be done in the following ways:
[0090] Manhattan distance is also known as L1 distance:
[0091] distance=|x1-x2 |+|y1-y2 | Formula 5
[0092] In formula 5, distance is the Manhattan distance.
[0093] Euclidean distance is L2 distance:
[0094] distance=√(|x1-x2 | 2 +|y1-y2| 2 ) Formula 6
[0095] In Formula 6, distance is the Euclidean distance.
[0096] Board distance:
[0097] distance=max(|x1-x2|,|y1-y2|) Formula 7
[0098] In formula 7, distance is the chessboard distance.
[0099] This application uses formula 6 to calculate the distance weight, L2 distance, that is, Euclidean distance.
[0100] like Figure 7 As shown, it is the distance weight map Dist dilation , the brighter the area, the larger the weight value.
[0101] Step S6: Roughly locate cell position and size
[0102] According to the distance weight map Dist dilation , loop through the following steps:
[0103] Step S601: traverse the distance weight graph Dist dilation Find and obtain the maximum pixel value Val among all pixels in max , get the pixel with the maximum pixel value and the position of the pixel A max (x max ,y max ).
[0104] Step S602: If the minimum radius threshold Thresh of the cell inscribed circle is not set, set Thresh=Val max ×ratio; the ratio value range is [0,1]. In this application, the ratio is set to 0.7.
[0105] Step S603: Record the position A of the pixel with the maximum pixel value max (x max ,y max ) and the maximum pixel value Val max List of circles inscribed in the cell circles middle.
[0106] Step S604: In the distance weight map Dist dilation Delete the pixel with the maximum pixel value from position A max , and perform non-maximum suppression NMS.
[0107] NMS is the abbreviation of Non-Maximum Suppress. The specific operation is: take the position A of the pixel with the maximum pixel value max (x max ,y max ) is the center of the circle, and the maximum pixel value is Val max is the radius, in the distance weight map Dist dilation Draw a circle and set all values within the circle to 0.
[0108] Step S605: If the maximum pixel value Val max≥ the minimum radius threshold Thresh of the cell inscribed circle, then return to step S601 to continue execution, otherwise obtain the cell inscribed circle list List after non-maximum suppression is completed circles And exit the loop execution step S606.
[0109] Step S606: If the cell inscribed circle list List is not completed after maximum value suppression circles If it is empty, it ends; if it is not the cell inscribed circle list after the maximum suppression is completed, circles Not empty, the list of inscribed circles in the cell after non-maximum suppression is completed circles The information of the circle including the center and radius is stored in the image. Based on the information of the circle, all circles are drawn and the circle label area map is obtained. tag , roughly locate the cell position and size, and execute step S7.
[0110] The end means exiting the algorithm, indicating that there are no cells in this image. Exiting the algorithm means skipping all remaining steps and returning the result, which means that no suitable cells are detected in the input image, and the final output result is empty.
[0111] Draw all circles based on the circle information and obtain the circle label area map Image tag The steps of drawing these circles are almost the same as step S604, except that the filling values are different. In step S604, the filling value of non-maximum suppression NMS is 0, while the filling value here is from 1 to the cell inscribed circle list List circles The length of List is [1, circles .length], that is, each circular area is filled with a value different from other circles.
[0112] like Figure 8a The following is an image of a circular label area map. Different circles in the image represent different cells, which is a list of inscribed circles in the cell. circles The visual display of is the result of directly drawing all the circles.
[0113] like Figure 8b As shown in the figure, the original cell binary image is used as the background and the circular label area map is superimposed on the original cell binary image. raw As background and Figure 8a The superimposed display and the marked cell positions are to clearly see the positions of these circles in the original cell binary image for easier understanding. Figure 8b It is not used in subsequent calculations.
[0114] Step S7: Use clustering to divide the pixels to be segmented
[0115] Based on the circular label area image obtained in step S6 tag , the binary image obtained from step S2 raw Extract the image containing the outline of the cell to be segmented; obtain non-zero pixel points P(x, y) from the image containing the outline of the cell to be segmented, and classify each non-zero pixel point P(x, y) into the cell inscribed circle list List circles In a circle in the image, the cell outline image after clustering segmentation is obtained.
[0116] According to formula 8, the circular label area image Image obtained in step S6 tag and the binary image obtained in step S2 raw , calculate and obtain an image containing the outlines of the cells to be segmented.
[0117] Image untaged =bitwise_and(bitwise_not(Image tag ),Binary raw ) Formula 8
[0118] In formula 8, Image untaged is the image containing the outline of the cells to be segmented, i.e., the C image; tag For circular label area chart, Binary raw is the original cell binary image, bitwise_and(A,B) is the logical AND operation, A corresponds to bitwise_not(Image tag ), B corresponds to Binary raw , bitwise_and(A,B)=C, that is, the logical AND operation of two images A and B of the same size is performed to obtain the C image. The logical AND operation is performed on each pixel point (x, y) in the two images A and B of the same size. If the pixel point A(x, y) of the A image and the pixel point B(x, y) of the B image are not 0 at the same time, then the value of the corresponding pixel point C (x, y) in the C image is A(x, y), otherwise C(x, y)=0; bitwise_not(Image tag ) is the logical inversion of the circular label area image. The pixel point A(x,y) of image A!=0, which can also be understood as A(x,y)>0, because the values in image A are all positive numbers.
[0119] like Fig. 9 As shown, it is an image containing the outline of the cells to be segmented. All non-zero pixels, each non-zero pixel point P i (x i ,y i) need to be classified into the cell inscribed circle list List circles Here we can put the cell inscribed circle list List circles Each circle in is considered as a category, and all non-zero pixels are classified.
[0120] For the pixels to be segmented, use the cell inscribed circle list List circles The number of circles in the cell is used as the number of categories, and the list of inscribed circles in the cell is used as the list of inscribed circles in the cell. circles Each center C t (x t ,y t ) as the cluster center point, apply the clustering algorithm, and obtain the cell contour image after cluster segmentation. The specific method is as follows.
[0121] Calculate each non-zero pixel P i (x i ,y i ) and the list of circles inscribed in the cell List circles The center of each circle C t (x t ,y t ) distance L, find and obtain each non-zero pixel point P i (x i ,y i ) and the list of circles inscribed in the cell List circles The center of the circle C t (x t ,y t )'s shortest distance L min , get the shortest distance L min The corresponding center C min (x min ,y min ), each non-zero pixel P i (x i ,y i ) is classified to the corresponding center C min (x min ,y min ) and the non-zero pixel point P i (x i ,y i ) is recorded as the value of the circle center C min (x min ,y min ) corresponding to the circle, which is the same value as the circular label area image Image in step S606 tag Each circle in the is assigned a consistent value.
[0122] Formula 9
[0123] In formula 9, Tag i is a non-zero pixel point P i (x i ,y i ) belongs to the category, that is, the non-zero pixel point P i (x i ,y i ) belongs to the distance cell inscribed circle list List circles The circle corresponding to the center of the circle closest to the center of the circle, C t (x t ,y t ) is the list of inscribed circles in the cell List circles The center of the circle.
[0124] like Fig.10 As shown, the cell contour image after clustering segmentation is obtained.
[0125] Step S8: Secondary contour filtering
[0126] Based on the cell contour image after cluster segmentation obtained in step S7, the circularity ratio Ratio of each contour line in the cell contour image after cluster segmentation is obtained, and all contour lines with circularity ratio Ratio>0.7 are obtained to form a cell contour image after secondary filtering.
[0127] This step filters out the cell outlines whose shapes are too different from circles to ensure the quality of the cells finally screened out.
[0128] Calculate the circle ratio. For cells that deviate too much from the perfect circle, discard them directly and do not analyze them. The formula for calculating the circle ratio is:
[0129] Formula 10
[0130] In formula 10, S is the contour area, which is obtained by the contour area calculation method in step S4, and L is the contour perimeter, which is calculated as follows:
[0131] Formula 11
[0132] In formula (11), L is the contour perimeter, k is the kth element, which is any one from 0 to n, and n is the total number of summed elements.
[0133] The filtering rule of this application is: the near-circularity ratio Ratio>0.7, and the contours that do not meet this condition will be discarded.
[0134] like Fig.11 Shown is the cell outline image after secondary filtering.
[0135] In summary, the segmentation method described in the present application achieves rapid and accurate segmentation of cells in microscopic images.
[0136] Compared with the prior art, the technical solution of this application has the following advantages:
[0137] First, the calculation can be run on all machines equipped with only a CPU, and the calculation efficiency is very high. It takes less than 30ms to process a 1200*1200 pixel image on a 12th generation i5 processor.
[0138] Second, the cell extraction rate is higher than 70%. At the same time, the two-step cell contour filtering can filter out almost all segmentation errors. The comprehensive results are more accurate and have better robustness.
Claims
1. A FISH microscopic image cell segmentation method, characterized in that: The method comprises the following steps: step S1: obtaining an original grayscale image of a microscopic image, preprocessing the image, and obtaining a preprocessed grayscale image; step S2: segmenting the preprocessed grayscale image with a fixed threshold value to obtain a binary image. ; Step S3: Based on the binary image , use the contour extraction algorithm to extract the contour line of the cell and obtain the initial cell contour image ; Step S4: Calculate the initial cell contour image The area of each contour line in the equation is obtained based on , obtain the cell contour image after contour filtering; Step S5: Binarized image Perform expansion and corrosion to obtain a binary image after expansion and corrosion. Calculate the distance from each foreground pixel to the nearest background pixel based on the binary image after expansion and corrosion. Transform the binary image after expansion and corrosion to obtain a distance weight map. ; Step S6: Based on the distance weight map , locate the cell position and size, and obtain the circular label area map ; Step S7: Based on the circular label area map , from the binary image Extract the image containing the outline of the cell to be segmented; obtain non-zero pixel points P(x, y) from the image containing the outline of the cell to be segmented, and classify each non-zero pixel point P(x, y) into the cell inscribed circle list Step S8: based on the cell contour image after cluster segmentation, obtain the near-circularity rate of each contour line in the cell contour image after cluster segmentation. , and obtain the circularity All contour lines are obtained to form a cell contour image after secondary filtering; The step S6 is specifically divided into the following steps: , loop through the following steps: Step S601: traverse the distance weight graph Find and get the maximum pixel value among all pixels , get the pixel with the maximum pixel value and the position of the pixel ; Step S602: If the minimum radius threshold of the cell inscribed circle is not set , then set ; The value range is ; Step S603: Record the position of the pixel with the maximum pixel value and the maximum pixel value List of circles inscribed in the cell middle; Step S604: In the distance weight map Delete the pixel with the maximum pixel value , and perform non-maximum suppression NMS; Step S605: If the maximum pixel value ≥Minimum radius threshold of cell inscribed circle , then return to step S601 to continue execution, otherwise obtain the cell inscribed circle list after non-maximum suppression is completed And exit the loop execution step S606; Step S606: If the cell inscribed circle list is not completed after maximum suppression If it is empty, it ends; if it is not the list of inscribed circles of cells after maximum suppression is completed Not empty, list of inscribed circles of cells after non-maximum suppression is completed The information of the circle including the center and radius is saved in the file. Based on the information of the circle, all circles are drawn and the circle label area map is obtained. , execute step S7.
2. A FISH microscopic image cell segmentation method according to claim 1, characterized in that: In step S1, an original grayscale image of the microscopic image is obtained, and a Gaussian filter and a mean filter are used to perform noise reduction processing on the original grayscale image to obtain a grayscale image after noise reduction, and the contrast of the grayscale image after noise reduction is enhanced to obtain an enhanced grayscale image, and the grayscale values of the enhanced grayscale image are remapped to interval to obtain the preprocessed grayscale image.
3. A FISH microscopic image cell segmentation method according to claim 1, characterized in that: In step S5, three dilation operations are performed first, and then an erosion operation is performed to obtain a binary image after dilation and erosion.
4. A FISH microscopic image cell segmentation method according to claim 1, characterized in that: In step S5, the distance from each foreground pixel to the nearest background pixel is calculated according to the Euclidean distance algorithm.
5. The method for cell segmentation based on FISH microscopic images according to claim 1, characterized in that: In step S604, the position of the pixel with the maximum pixel value is is the center of the circle, the maximum pixel value is the radius, in the distance weight map Draw a circle and set all values within the circle to 0.
6. A FISH microscopic image cell segmentation method according to claim 1, characterized in that: In step S606, all circles are drawn based on the circle information and a circle label area map is obtained. , with a list of inscribed circles in the cell Each circle center and radius in the distance weight map Draw a circle and set all the values in the circular area to a list from 1 to the cell inscribed circle The length of the filled value is [1, .length], each circular area is filled with a value different from the other circles.
7. A FISH microscopic image cell segmentation method according to claim 1, characterized in that: In step S7, according to formula 8, the circular label area map obtained in step S6 and the binary image obtained in step S2 , calculate and obtain an image containing the outline of the cells to be segmented; Formula 8 In formula 8, is the image containing the outline of the cells to be segmented, i.e., C image; is a circular label area chart, is the original cell binary image, For the logical AND operation, correspond , B corresponds to , That is, the C image is obtained by performing a logical AND operation on two images A and B of the same size. The logical AND operation is performed on each pixel point (x, y) in the two images A and B of the same size. If the pixel point A(x, y) of the A image and the pixel point B(x, y) of the B image are both not 0, then the value of the corresponding pixel point C (x, y) in the C image is A(x, y), otherwise C(x, y)=0; To negate the logic of the circular label area chart.
8. A FISH microscopic image cell segmentation method according to claim 1, characterized in that: In step S7, each non-zero pixel point P(x, y) is classified into a cell inscribed circle list. The steps in a circle include taking a list of inscribed circles in a cell The number of circles in the middle is used as the number of categories, and the list of inscribed circles in the cell is used as the Each center of As cluster center points, apply clustering algorithm.
