Cervical pathology image processing method and device
By iteratively solving the circumferential circle and performing mask cutting, the problem of low accuracy and efficiency of cervical pathological image segmentation processing is solved, the accuracy and efficiency of image processing is improved, subsequent analysis is simplified, and the reliability of diagnosis is improved.
Patent Information
- Application Number
- CN202210482530.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-05
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-05-05
AI Technical Summary
The accuracy and efficiency of the segmentation processing method of cervical pathological images in the prior art is low, resulting in computer-assisted technology analysis taking time and affecting the diagnostic accuracy.
By acquiring the cervical pathological image, converting it into a grayscale image, obtaining the mask image, determining the circumference circle, iteratively solve until all cervical cells are covered, and mask cutting is used for mask cutting to obtain the target segmented image.
It improves the accuracy and efficiency of cervical pathological image processing, ensures that the target segmented image contains all cervical cells, reduces irrelevant white background areas, simplifies the amount of subsequent analysis and improves diagnostic reliability.
Smart Images

Figure CN114972209B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method and device for processing cervical pathology images. Background Art
[0002] Cervical cancer screening is a key means of cervical cancer prevention and control. At present, the commonly used cervical cancer screening method in my country is liquid-based thin-layer cell bubble test (TCT). TCT images can be obtained through TCT, and pathologists can observe cell morphology through TCT images.
[0003] With the increasing number of potential patients and the increasing requirements for diagnostic accuracy, the workload of pathologists has also increased dramatically. In order to ease the workload of pathologists, digital TCT pathological images can be analyzed by computer-assisted technology. Computer-assisted technology refers to the use of imaging, medical image processing technology and other possible physiological and biochemical means, combined with computer analysis and calculation to assist pathologists in finding lesions and improve the accuracy of diagnosis. First, a digital TCT image is obtained through TCT, and then the digital TCT image is analyzed and calculated using computer-assisted technology to determine the abnormal features in the TCT image. The TCT image itself has high resolution and large scale, and it usually takes a long time to analyze TCT pathological images using computer-assisted technology. Therefore, before calculation and auxiliary technology analysis, the TCT image is usually segmented to remove the irrelevant white background generated when the TCT image is digitally scanned.
[0004] However, the current segmentation processing methods for TCT images have low accuracy and efficiency. Summary of the invention
[0005] The present disclosure provides a cervical pathology image processing method and device to solve the technical problem of low accuracy and efficiency of the TCT image segmentation processing method in the prior art.
[0006] According to a first aspect of the present disclosure, a method for processing a cervical pathology image is provided, comprising:
[0007] Acquire a cervical pathological image, and convert the cervical pathological image into a grayscale image;
[0008] Acquire a mask image of the grayscale image;
[0009] Solving the image edge of the mask image to determine a first mask image having a first circumscribed circle;
[0010] Detecting an area outside a region of interest of the grayscale image to determine whether there is an out-of-bounds point, wherein the region of interest is a region in the grayscale image that intersects with the first mask image;
[0011] If there are out-of-bounds points in the area outside the region of interest, the first circumscribed circle is solved again until a second mask image with a second circumscribed circle is determined, and the second mask image ensures that there are no out-of-bounds points in the area outside the region of interest;
[0012] The second mask image is used to perform mask cutting on the cervical pathology image to obtain a target segmented image of the cervical pathology image.
[0013] According to a second aspect of the present disclosure, there is provided a cervical pathology image processing device, comprising:
[0014] A conversion module, used for acquiring a cervical pathology image and converting the cervical pathology image into a grayscale image;
[0015] An acquisition module, used for acquiring a mask image of the grayscale image;
[0016] A first solving module, used for solving the image edge of the mask image to determine a first mask image having a first circumscribed circle;
[0017] A detection module, configured to detect an area outside a region of interest of the grayscale image to determine whether there is an out-of-bounds point, wherein the region of interest is a region in the grayscale image that intersects with the first mask image;
[0018] A second solving module is used for solving the first circumscribed circle again if there is an out-of-bounds point in the area outside the area of interest, until a second mask image with a second circumscribed circle is determined, wherein the second mask image makes it possible for the area outside the area of interest to have no out-of-bounds point;
[0019] A cutting module is used to perform mask cutting on the cervical pathology image using the second mask image to obtain a target segmented image of the cervical pathology image.
[0020] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0021] at least one processor and memory;
[0022] The memory stores computer-executable instructions;
[0023] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the cervical pathology image processing method described in the first aspect.
[0024] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the cervical pathology image processing method described in the first aspect.
[0025] The presently disclosed embodiments provide a method and device for processing cervical pathology images. The method obtains a mask image of the cervical pathology image and solves the edge of the mask image to obtain a mask image containing a first circumscribed circle, and then iteratively solves the first circumscribed circle until the mask image can cover all cervical cells in the cervical pathology image. This improves the accuracy of cervical pathology image processing, and improves the efficiency of the iterative solution process by approximately fitting the edge of the mask image into a circle, thereby further improving the efficiency of acquiring the target pathology image. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0027] Figure 1 A schematic diagram of a processing object provided in an embodiment of the present application;
[0028] Figure 2 The process of the cervical pathology image processing method provided in the embodiment of the present application Figure 1 ;
[0029] Figure 3 A schematic diagram of a process of obtaining a mask image provided in an embodiment of the present application;
[0030] Figure 4 The process of the cervical pathology image processing method provided in the embodiment of the present application Figure 2 ;
[0031] Figure 5 A schematic diagram of the expansion process provided in an embodiment of the present application;
[0032] Figure 6 A schematic diagram of the corrosion treatment process provided in an embodiment of the present application;
[0033] Figure 7 A schematic diagram of a specific example process provided in an embodiment of the present application;
[0034] Figure 8 A schematic diagram of the structure of a cervical pathology image processing device provided in an embodiment of the present application;
[0035] Fig. 9 A schematic diagram of the structure of a cervical pathology image processing device provided in an embodiment of the present application.
[0036] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0037] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0038] To facilitate understanding, the application scenarios of the embodiments of the present disclosure are first introduced.
[0039] Figure 1 FIG. 1 is a schematic diagram of a cervical pathology image processing object involved in an embodiment of the present disclosure. Figure 1 As shown, the cervical pathology image 101 is a digital image obtained by scanning a cervical cell smear. The cervical pathology image 101 includes a cervical cell distribution area and an irrelevant white background area. The shape of the cervical cell distribution area is close to a circle, which enables the cervical pathology image processing method to cut out an image of the cervical cell distribution area from the cervical pathology image 101, that is, the target segmentation image 102. The target segmentation image 102 contains all cervical cells and significantly reduces the irrelevant white background area, which can significantly reduce the amount of calculation for the subsequent analysis of the cervical pathology image 101 by computer-aided technology, and improve the reliability of the analysis.
[0040] In the prior art, a mask image of the cervical pathology image 101 is usually obtained first, and then the mask image is used to cut the cervical pathology image 101 to obtain the target segmented image 102. However, not all cervical cell distribution areas in all cervical pathology images 101 are continuous with each other and can form a complete area. In some cases, the cervical cells in the cervical pathology image 101 are not evenly distributed, that is, there are many irrelevant white background areas in the cervical cell distribution area, so that the obtained mask image also presents several areas that are not continuous with each other.
[0041] When the cervical pathology image 101 is cut by the mask image, the target segmented image 102 obtained may have some cervical cells missing, or the target segmented image 102 may be cut into multiple separate small images, which affects the subsequent analysis and calculation of the target segmented image 102 by computer-aided technology.
[0042] In order to solve at least one of the above problems, the embodiments of the present disclosure provide a method and device for processing cervical pathology images, which are applied to the field of image processing technology. In the method for processing cervical pathology images provided by the embodiments of the present disclosure, the edge of the obtained mask image is solved to obtain a mask image containing a first circumscribed circle. Through the continuous iterative solution process, the radius of the first circumscribed circle is increased until the mask image can cover all cervical cells in the cervical pathology image 101, so that the obtained target segmented image 102 not only contains all cervical cells, but is also a complete image.
[0043] The following uses a detailed embodiment to explain in detail the cervical pathology image processing method and device of the embodiment of the present disclosure.
[0044] The disclosed embodiment provides a method for processing cervical pathology images, which can improve the accuracy and efficiency of obtaining the target segmented image 102. The method for processing cervical pathology images can be performed by a terminal device, or can be performed by the terminal device and a server in collaboration. The terminal device can be a desktop computer, a laptop computer, etc., and an application program can be installed on the terminal device. This embodiment does not impose any special restrictions on the execution subject of the method.
[0045] Figure 2 The process of the cervical pathology image processing method provided in the embodiment of the present disclosure is as follows: Figure 1 .like Figure 2 As shown, the method includes:
[0046] S201, obtaining a cervical pathological image, and converting the cervical pathological image into a grayscale image;
[0047] The cervical pathology image is an image obtained by scanning the TCT smear. It is understandable that the cervical pathology image needs to include cervical cells, so that the part containing cervical cells can be extracted by the cervical pathology image processing method.
[0048] Cervical pathology images are color images. The color values of pixels are composed of three channels: red, green, and blue. The computer uses numbers to describe the color range of each channel, and the color value is specified as 0-225. The color values of the three channels in the color image are different. For example, the color values of the three channels can be (146, 184, 132). A grayscale image is an image with only one sampled color per pixel. The color values of the three channels of the grayscale image are equal, which is equivalent to having only one channel, so that visually, each pixel in the grayscale image is a transition color between white and black.
[0049] There are many methods to convert the cervical pathology image into a grayscale image, such as the average method, that is, averaging the color values of the three channels of each pixel, the maximum and minimum average method, the weighted average method, etc. In the embodiments of the present disclosure, there is no particular limitation on the specific method of converting the grayscale image.
[0050] S202, obtaining a mask image of the grayscale image;
[0051] The mask image is used in this application to extract the cervical cell distribution area in the cervical pathology image to obtain the target segmentation image. The mask image is a binary image composed of 0 and 1. By multiplying the mask image with the cervical pathology image, the part of the cervical pathology image multiplied by the value 0 can be removed.
[0052] Figure 3 The process diagram of mask image acquisition provided in the embodiment of the present application is as follows. Figure 3 The process of obtaining the mask image is described.
[0053] The black filled area in the original image 301 is the cervical cells, and the blank area is the irrelevant blank background. The acquisition of the mask image 302 is achieved by identifying the cervical cells and the irrelevant blank background of the original image 301. When the site is identified as the irrelevant blank background through calculation, the point is recorded as 0; if the site is identified as the cervical cell, the site is recorded as 1. Among them, how to achieve the distinction between the irrelevant blank background and the cervical cells can be achieved through various algorithms, such as the maximum inter-class variance method.
[0054] S203, solving the image edge of the mask image to determine a first mask image having a first circumscribed circle;
[0055] Those skilled in the art can understand that in a cervical pathology image, the area where cervical cells are distributed is close to a circle, so the area where the position is 1 in the corresponding mask image is close to a circle.
[0056] In the process of solving the edge of the area with the point 1 in the mask image, the edge of the area with the point 1 in the mask image is first fitted into a circle, and the edge of the circle obtained by fitting is the first circumscribed circle. The mask image containing the first circumscribed circle is the first mask image.
[0057] S204, detecting an area outside the region of interest of the grayscale image to determine whether there is an out-of-bounds point, the region of interest being a region in the grayscale image that intersects with the first mask image;
[0058] The region of interest (ROI) is a key area of analysis. In the disclosed embodiment, the region of interest to be analyzed is the area where cervical cells are distributed. Cervical cells are distributed in the area obtained by intersecting the first mask image and the grayscale image. Therefore, in step S204, the region of interest is the area in the grayscale image that intersects with the first mask image.
[0059] Those skilled in the art can understand that the first mask image is obtained by fitting the mask image. The area with a site of 1 in the first mask image may not necessarily cover all cervical cells in the grayscale image. Some cervical cells may be relatively scattered and located outside the first circumscribed circle. These cervical cells distributed outside the first circumscribed circle are out-of-bounds points.
[0060] In order to improve the accuracy of subsequent analysis of cervical pathology images, all cervical cells should be extracted. Therefore, it is necessary to detect whether the area to be extracted includes all cervical cells. By detecting the area outside the first circumscribed circle to determine whether there is an out-of-bounds point, it can be determined whether the area with a point 1 in the first mask image can cover all cervical cells in the cervical pathology image.
[0061] S205, if there are out-of-bounds points in the area outside the area of interest, solving the first circumscribed circle again until a second mask image with a second circumscribed circle is determined, and the second mask image ensures that there are no out-of-bounds points in the area outside the area of interest;
[0062] The second circumscribed circle is a circle obtained by further solving the first circumscribed circle. There are out-of-bounds points distributed around the first circumscribed circle, so the second circumscribed circle is equivalent to a circle obtained by increasing the radius on the basis of the first circumscribed circle. The detected out-of-bounds points can be located within the second circumscribed circle. The second mask image is a mask image containing the second circumscribed circle.
[0063] Those skilled in the art can understand that the process of resolving the first circumscribed circle is the process of determining the radius of the second circumscribed circle. For example, the radius of the first circumscribed circle is r1, and it is found through detection that there is an out-of-bounds point outside the first circumscribed circle, and the distance between the out-of-bounds point and the center of the first circumscribed circle is r2, then the radius of the first circumscribed circle is increased to r2, and the second circumscribed circle is obtained. The second circumscribed circle is concentric with the first circumscribed circle, and the radius of the second circumscribed circle is r2. This process is repeated until no out-of-bounds point is detected outside the second circumscribed circle.
[0064] S206: Use the second mask image to perform mask cutting on the cervical pathology image to obtain a target segmented image of the cervical pathology image.
[0065] The area with the position 1 in the second mask image can cover all the cervical cells in the cervical pathology image.
[0066] In a possible implementation, the second mask image is a binary image composed of 0 and 1, and a mask matrix can be set, wherein the mask matrix sets a value of 1 in the area where cervical cells are distributed in the cervical pathology image, and sets 0 in the irrelevant white background area. By multiplying the mask matrix with the pixel value of each pixel in the grayscale image, the irrelevant white background area in the cervical pathology image can be removed to obtain the target segmented image.
[0067] The processing method of cervical pathology image provided by this embodiment first obtains the mask image of the cervical pathology image, and then iteratively solves the edge of the area with the site 1 in the mask image, so that after the intersection of the mask image and the cervical pathology image is taken, all cervical cells can be covered. Through the above-mentioned process of iteratively solving the circumscribed circle, all cervical cells can be included in the target segmented image, which significantly improves the accuracy of the cervical pathology image processing method. At the same time, the cervical cell distribution area in the cervical pathology image is approximately fitted into a circle, which is easy to operate and improves the acquisition efficiency of the target segmented image.
[0068] Figure 4 The process of the cervical pathology image processing method provided in the embodiment of the present disclosure is as follows: Figure 2 .like Figure 4 As shown, the method includes:
[0069] S401, obtaining a cervical pathological image, and converting the cervical pathological image into a grayscale image;
[0070] It should be understood that the specific implementation of S401 is different from Figure 2 The S201 in FIG. 1 is similar to that in FIG. 1 and will not be described in detail here.
[0071] S402, first performing at least one dilation process on the grayscale image, and then performing at least one erosion process on the grayscale image;
[0072] Dilation processing is the process of merging the background points that are in contact with all cervical cells in the grayscale image into the cervical cells, so that the boundaries of the cervical cells expand outward. The mathematical definition of dilation processing is: Where D is the grayscale image after dilation, X is the grayscale image, and B is the pixel window. The dilated grayscale image D generated by dilating X with B is a set of points (x, y) that satisfy the following conditions: if the origin of B is translated to point (x, y), then its intersection with X is non-empty.
[0073] Erosion is the operation of removing noise points in a grayscale image that are distributed in an irrelevant white background area. The mathematical definition of the erosion operation is: Where E is the grayscale image after erosion, X is the grayscale image, and B is the pixel window. The grayscale image E after erosion produced by B eroding X is a set of points (x, y) that satisfy the following condition: if the origin of B is translated to point (x, y), then B will be completely contained in X.
[0074] The specific processes of expansion treatment and corrosion treatment are introduced in detail below.
[0075] Figure 5 A schematic diagram of the expansion process provided by the embodiment of the present disclosure, combined with Figure 5 , the expansion process is described in detail. The expansion process includes:
[0076] Convert the grayscale image to a black and white binary image;
[0077] Move the pixel window within the black-and-white binary image, and locate the origin of the pixel window at the white pixel area of the black-and-white binary image;
[0078] When there are black pixels in the coverage area during the movement of the pixel window, the origin of the pixel window is replaced by the black pixels.
[0079] A black and white binary image is an image that contains only black pixels and white pixels. The color value of a black pixel is 255, and the color value of a white pixel is 0. The pixel window is a software value acquisition window, which is used to obtain an image with a set threshold area in a grayscale image, and an origin is set in the pixel window, such as Figure 4 As shown, the origin of the pixel window is the point indicated by the circle. And the origin in the pixel window is set to be located only in the white pixel area. The pixel window is continuously moved in the black and white binary image. In the process of the pixel window continuously moving, the area of the pixel window other than the origin may cover the black pixel area, or may cover the white pixel area.
[0080] When the area other than the origin of the pixel window is covered with black pixels, the color value at the origin of the pixel window is converted from 0 to 255.
[0081] Figure 6 The process diagram of the corrosion treatment provided by the embodiment of the present disclosure is as follows. Figure 6 Describe the corrosion treatment process. Corrosion treatment includes:
[0082] Convert the grayscale image to a black and white binary image;
[0083] Move the pixel window within the black-and-white binary image, and locate the origin of the pixel window at the black pixel area of the black-and-white binary image;
[0084] When there are white pixels in the coverage area during the movement of the pixel window, the origin of the pixel window is replaced by the white pixels.
[0085] The erosion operation is the inverse operation of the dilation operation. Figure 6 As shown, the origin of the pixel window is located at the black pixel area. During the movement of the pixel window, if there are white pixels in the coverage area of the pixel window, the color value of the origin of the pixel window is replaced from 255 to 0.
[0086] The distribution of cervical cells in the grayscale image is not completely uniform, and there will be blank areas. There are also noise points such as stains in the irrelevant background area. These blank areas and the above-mentioned noise points will affect the subsequent extraction of the target segmentation image. Therefore, it is necessary to remove the above-mentioned blank areas and noise points through corrosion and expansion operations, so that the cervical cell distribution area in the grayscale image is continuous, and the small and meaningless points in the irrelevant background area are reduced. The expansion operation is required to reduce the blank areas in the grayscale image. The corrosion operation is required to reduce the noise points in the irrelevant background area. If the corrosion operation is performed first, some cell points may be removed in the more dispersed positions of the cells in the cervical cell distribution area, thereby increasing the blank area in the grayscale image. Therefore, in order to avoid this situation, the expansion operation is performed first, and then the corrosion operation is performed. Among them, the number of expansion operations and corrosion operations can be adjusted according to the specific effect.
[0087] In another possible implementation, after obtaining the cervical pathology image and converting the cervical pathology image into a grayscale image, the method further includes:
[0088] Get the pixel value of each point in the grayscale image;
[0089] Transform the pixel value of each point into the sum of the pixel value multiplied by the corresponding weight;
[0090] The weights conform to the normal distribution equation in two-dimensional space.
[0091] The normal distribution equation in two-dimensional space is defined as: σ is the standard deviation of the normal distribution and r is the blur radius.
[0092] The pixel value is the value assigned by the computer when the original image is digitized. It represents the average brightness information of a small square in the original. The pixel values of each point in the grayscale image are different, and the details are prominent. By averaging the pixel values of each point with the pixel values of the surrounding points, the details in the grayscale image can be lost, making the grayscale image blurry. Since the image is continuous and the relationship between closer points is closer, the weights of the surrounding points are assigned through the two-dimensional space normal distribution equation. Among them, the weights can be calculated by the two-dimensional space normal distribution equation.
[0093] Through the above operation, the grayscale image can be blurred and the blank area in the cell distribution area can be reduced.
[0094] S403, using the maximum inter-class variance method to perform threshold segmentation on the grayscale image to obtain a mask image of the grayscale image;
[0095] The maximum inter-class variance method is an efficient algorithm for binarizing images. Threshold segmentation refers to setting a certain threshold, denoted as T, to maximize the inter-class variance. Then, the pixel points in the grayscale image whose saturation is greater than the threshold T are assigned a value of 1, otherwise they are assigned a value of 0, so that the image of the area assigned a value of 1 is the mask image. The inter-class variance is defined as: 2 =p f (μ f -μ) 2 +p b (μ b -μ) 2 , where μ f , μ b , μ are the average values of foreground, background and full image pixels respectively, p f 、p b The ratio of foreground and background pixels to all pixels. The foreground is the area where cervical cells are distributed, the background is the irrelevant white background area, and the full image refers to the entire grayscale image.
[0096] S404, performing at least one erosion process and then at least one dilation process on the mask image.
[0097] The specific implementation process of the corrosion process and the expansion process is similar to that of step S402 and will not be described again here.
[0098] It can be understood by those skilled in the art that the edge of the mask image obtained by the grayscale image is not smooth and has many "burrs", that is, areas protruding outward. In order to make the edge of the mask image smoother, an erosion process is first performed to shrink the edge of the mask image inward. During the erosion process, the edge of the mask image tends to be smoother. However, the shrinkage of the edge of the mask image inward reduces the area of the mask image, and it is necessary to perform an expansion operation to expand the edge of the mask outward.
[0099] S405, solving the image edge of the mask image to determine a first mask image having a first circumscribed circle;
[0100] It should be understood that the specific implementation of S405 is different from Figure 2 The S203 in FIG. 1 is similar to that in FIG. 1 and will not be described in detail here.
[0101] S406, detecting an area outside the region of interest of the grayscale image to determine whether there is an out-of-bounds point, the region of interest being a region in the grayscale image that intersects with the first mask image;
[0102] It should be understood that the specific implementation of S406 is different from Figure 2 The S204 in FIG. 1 is similar to that in FIG. 1 and will not be described in detail here.
[0103] If there is an out-of-bounds point in the area outside the area of interest, execute S407;
[0104] If there is no out-of-bounds point in the area outside the area of interest, execute S409;
[0105] S407, solving the first circumscribed circle again until a second mask image having a second circumscribed circle is determined, wherein the second mask image ensures that there are no out-of-bounds points in the area outside the region of interest;
[0106] It should be understood that the specific implementation of S407 is different from Figure 2 The S205 in FIG. 1 is similar to that in FIG. 1 and will not be described in detail here.
[0107] S408, using the second mask image to perform mask cutting on the cervical pathology image to obtain a target segmented image of the cervical pathology image;
[0108] It should be understood that the specific implementation of S408 is different from Figure 2 The S206 in FIG. 1 is similar to the S206 in FIG. 1 and will not be described in detail here.
[0109] S409: Use the first mask image to perform mask cutting on the cervical pathology image to obtain a target segmented image of the cervical pathology image.
[0110] It should be understood that the specific implementation of S409 is different from Figure 2 The S206 in FIG. 1 is similar to the S206 in FIG. 1 and will not be described in detail here.
[0111] In one possible implementation, before converting the cervical pathology image into a grayscale image, the cervical pathology image is first converted into a thumbnail, and then the thumbnail is converted into a grayscale image. At the same time, before using the second mask image or the first mask image to perform mask cutting on the cervical pathology image, the second mask image or the first mask image is first proportionally enlarged to the same size as the cervical pathology image, and then the enlarged second mask image or the first mask image is used to perform mask cutting on the cervical pathology image.
[0112] The thumbnail refers to the compressed image of the cervical pathology image. Compared with the cervical pathology image, the thumbnail has a smaller size and a lower resolution.
[0113] It can be understood by those skilled in the art that the resolution of cervical pathology images is high and they occupy a large amount of memory. If the cervical pathology images are directly used for subsequent operations, the load on the terminal device is large. Therefore, before processing the cervical pathology images, the cervical pathology images can be converted into thumbnails. However, the size of the mask image obtained by the thumbnail is reduced in the same proportion. Therefore, before cutting the cervical pathology image through the mask image, the mask image needs to be restored first, that is, it is proportionally enlarged to the same size as the cervical pathology image.
[0114] The embodiment of the present invention can reduce the noise points in the mask image through corrosion processing and expansion processing; by iteratively solving the mask image, the mask image can cover the cervical cells in the cervical pathology image to the greatest extent while reducing the irrelevant blank background area, thereby improving the accuracy of cervical pathology image processing.
[0115] Based on any of the above embodiments, Figure 7 , through specific examples, the technical solution shown in the embodiments of the present application is described in detail.
[0116] First, a cervical pathology image 101 is obtained. The cervical pathology image 101 is converted into a grayscale image, and then the grayscale image is dilated and eroded to obtain a pre-processed grayscale image 701. In the process of dilation and erosion of the grayscale image, the blank area in the cervical cell distribution area is significantly reduced. Then, a mask image 702 is obtained by mask calculation. Since the cervical cells at the edge of the cervical pathology image 101 are relatively scattered, the cervical cell distribution area in the obtained mask image 702 contains more "burrs", that is, the edge is not smooth and contains many small protruding areas. By first performing an erosion operation on the mask image 702 and then performing an expansion operation, the "burrs" in the mask image 702 can be significantly reduced to obtain a processed mask image 703. Since at this time, there may be out-of-bounds points distributed in the area outside the region of interest of the grayscale image 701, the edge of the mask image 703 is iteratively solved to obtain a second mask image 704 with a second circumscribed circle. The second mask image 704 is then used to perform mask cutting 705 on the cervical pathology image to obtain a target segmented image 102 of the cervical pathology image.
[0117] Figure 8 A schematic diagram of the structure of a device for processing cervical pathology images provided in an embodiment of the present disclosure is shown in FIG. Figure 8 As shown, the device includes: a conversion module 801, an acquisition module 802, a first solution module 803, a detection module 804, a second solution module 805, and a cutting module 806.
[0118] A conversion module, used for acquiring a cervical pathology image and converting the cervical pathology image into a grayscale image;
[0119] An acquisition module, used for acquiring a mask image of a grayscale image;
[0120] A first solving module, used for solving the image edge of the mask image to determine a first mask image having a first circumscribed circle;
[0121] A detection module, used to detect an area outside a region of interest of the grayscale image to determine whether there is an out-of-bounds point, the region of interest being a region in the grayscale image that intersects with the first mask image;
[0122] A second solving module is used for solving the first circumscribed circle again if there is an out-of-bounds point in the area outside the area of interest, until a second mask image with a second circumscribed circle is determined, and the second mask image makes it possible for the area outside the area of interest to have no out-of-bounds point;
[0123] The first cutting module is used to perform mask cutting on the cervical pathology image using the second mask image to obtain a target segmented image of the cervical pathology image.
[0124] Optionally, the device further includes: a second cutting module, configured to use the first mask image to perform mask cutting on the grayscale image if there is no out-of-bounds point in the area outside the area of interest, so as to obtain a target segmented image of the cervical pathology image.
[0125] Optionally, the device further comprises: a first preprocessing module, configured to perform corrosion processing and / or dilation processing on the grayscale image;
[0126] Wherein, the corrosion treatment comprises:
[0127] Switching the grayscale image to a black and white binary image;
[0128] Move a pixel window within the black-and-white binary image, and locate the origin of the pixel window at a black pixel region of the black-and-white binary image;
[0129] When there are white pixels in the coverage area during the movement of the pixel window, replacing the origin of the pixel window with the white pixels;
[0130] The expansion process comprises:
[0131] Switching the grayscale image to a black and white binary image;
[0132] Move a pixel window within the black-and-white binary image, and locate the origin of the pixel window at a white pixel region of the black-and-white binary image;
[0133] When there are black pixels in the coverage area during the movement of the pixel window, the origin of the pixel window is replaced by the black pixel.
[0134] Optionally, the first preprocessing module is specifically used to: first perform at least one dilation process on the grayscale image, and then perform at least one erosion process on the grayscale image.
[0135] Optionally, the device further includes: a second preprocessing module, configured to perform at least one corrosion process and then at least one dilation process on the mask image.
[0136] Optionally, the acquisition module is specifically used to: adopt a maximum inter-class variance method to perform threshold segmentation on the grayscale image to obtain a mask image.
[0137] Optionally, the device also includes: a fuzzy processing module, used to obtain the pixel value of each point in the grayscale image, and transform the pixel value of each point into the sum of the pixel value multiplied by the corresponding weight, and the weight conforms to the two-dimensional space normal distribution equation.
[0138] The cervical pathology image processing device provided in this embodiment can be used to execute the above-mentioned method embodiment. Its implementation method and technical effect are similar, and this embodiment will not be repeated here.
[0139] Fig. 9 The hardware structure diagram of the cervical pathology image processing device provided in the embodiment of the present application. Fig. 9 As shown, the cervical pathology image processing device 90 includes:
[0140] At least one processor 901 and a memory 902;
[0141] The memory 902 stores computer-executable instructions;
[0142] The at least one processor 901 executes the computer-executable instructions stored in the memory 902, so that the at least one processor 901 executes the cervical pathology image processing method as described above.
[0143] The specific implementation process of the processor 901 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0144] The processor 901 and the memory 902 are connected via a bus 903 .
[0145] An embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the cervical pathology image processing method as described above.
[0146] In the above-mentioned embodiments, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0147] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0148] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above-mentioned module-composed unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0149] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application.
[0150] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0151] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0152] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0153] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0154] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in a terminal or server.
[0155] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cervical pathology image processing method, characterized in that: include: Acquire a cervical pathological image, and convert the cervical pathological image into a grayscale image; Acquire a mask image of the grayscale image; Solving the image edge of the mask image to determine a first mask image having a first circumscribed circle; Detecting an area outside a region of interest of the grayscale image to determine whether there is an out-of-bounds point, wherein the region of interest is a region in the grayscale image that intersects with the first mask image; If there are out-of-bounds points in the area outside the region of interest, the first circumscribed circle is solved again until a second mask image with a second circumscribed circle is determined, and the second mask image ensures that there are no out-of-bounds points in the area outside the region of interest; Using the second mask image to perform mask cutting on the cervical pathology image to obtain a target segmented image of the cervical pathology image; The method of solving the image edge of the mask image to determine the first mask image having a first circumscribed circle includes: solving the edge of the area with the site 1 in the mask image, fitting the edge of the area with the site 1 in the mask image into a circle, the edge of the fitted circle being the first circumscribed circle, wherein the site with the site 1 is the site corresponding to the cervical cell.
2. The method according to claim 1, characterized in that Also includes: If there is no out-of-bounds point in the area outside the region of interest, the first mask image is used to perform mask cutting on the grayscale image to obtain a target segmented image of the cervical pathology image.
3. The method according to claim 1, characterized in that Before obtaining the mask image of the grayscale image, the method further includes: Performing corrosion processing and / or dilation processing on the grayscale image; Wherein, the corrosion treatment comprises: Switching the grayscale image to a black and white binary image; Move a pixel window within the black-and-white binary image, and locate the origin of the pixel window at a black pixel region of the black-and-white binary image; When there are white pixels in the coverage area during the movement of the pixel window, replacing the origin of the pixel window with the white pixels; The expansion process comprises: Switching the grayscale image to a black and white binary image; Move a pixel window within the black-and-white binary image, and locate the origin of the pixel window at a white pixel region of the black-and-white binary image; When there are black pixels in the coverage area during the movement of the pixel window, the origin of the pixel window is replaced by the black pixel.
4. The method according to claim 3, characterized in that The corroding and / or dilating processing of the grayscale image specifically includes: The grayscale image is firstly dilated at least once, and then eroded at least once.
5. The method according to claim 3 or 4, characterized in that: Before solving the image edge of the mask image, the method further includes: The mask image is firstly subjected to at least one erosion process and then subjected to at least one dilation process.
6. The method according to any one of claims 1 to 4, characterized in that: The obtaining of the mask image of the grayscale image specifically includes: The maximum inter-class variance method is used to perform threshold segmentation on the grayscale image to obtain a mask image.
7. The method according to any one of claims 1 to 4, characterized in that: After acquiring the cervical pathological image and converting the cervical pathological image into a grayscale image, the method further includes: Obtaining the pixel value of each point in the grayscale image; Transform the pixel value of each point into the sum of the pixel value multiplied by the corresponding weight; The weights conform to the normal distribution equation in two-dimensional space.
8. A cervical pathology image processing device, characterized in that: include: A conversion module, used for acquiring a cervical pathology image and converting the cervical pathology image into a grayscale image; An acquisition module, used for acquiring a mask image of the grayscale image; A first solving module, used for solving the image edge of the mask image to determine a first mask image having a first circumscribed circle; A detection module, configured to detect an area outside a region of interest of the grayscale image to determine whether there is an out-of-bounds point, wherein the region of interest is a region in the grayscale image that intersects with the first mask image; A second solving module is used for solving the first circumscribed circle again if there is an out-of-bounds point in the area outside the area of interest, until a second mask image with a second circumscribed circle is determined, wherein the second mask image makes it possible for the area outside the area of interest to have no out-of-bounds point; a cutting module, configured to perform mask cutting on the cervical pathology image using the second mask image to obtain a target segmented image of the cervical pathology image; The first solving module is specifically used to solve the edge of the area with the site 1 in the mask image, fit the edge of the area with the site 1 in the mask image into a circle, and the edge of the fitted circle is the first circumscribed circle, wherein the site with the site 1 is the site corresponding to the cervical cell.
9. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the cervical pathology image processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the cervical pathology image processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Video segmentation method and apparatus
CN108596940A
Image segmentation method and device for cervical exfoliated cell image
CN109064475A