A method, system and device for intestinal polyp contour segmentation based on adaptive threshold

Through adaptive threshold algorithm and image processing technology, the problem of inaccurate identification of colorectal polyps in traditional methods is solved, the accuracy of identification and segmentation of intestinal polyp contours is improved, and misjudgments and missed diagnoses are reduced.

CN118429371BActive Publication Date: 2024-09-20THE SECOND XIANGYA HOSPITAL OF CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410896017.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-09-20
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

Under traditional methods, the identification of colorectal polyps depends on the doctor's experience and status, especially when the shape of the polyps is not clearly identifiable and the blur caused by noise during the imaging process leads to inaccurate segmentation of intestinal polyps and many misjudgments and missed diagnoses. .

Method used

The intestinal polyp outline segmentation method based on adaptive threshold is adopted to increase the image contrast by removing highlights and additional information, use the adaptive threshold algorithm to segment, remove noise stains, and perform curve fitting on the intestinal polyp outline to obtain a complete intestinal polyp outline. .

Benefits of technology

It improves the recognition and segmentation accuracy of intestinal polyp contours, improves the segmentation quality of intestinal polyp contours, reduces misjudgments and missed judgments, and achieves more accurate judgment of intestinal polyp contours.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429371B
    Figure CN118429371B
Patent Text Reader

Abstract

The present invention discloses a method, system and device for segmenting the outline of intestinal polyps based on an adaptive threshold. The method obtains an intestinal polyp image to be segmented, removes highlights and additional information from the intestinal polyp image to be segmented, and obtains a first intestinal polyp image; increases the image contrast of the first intestinal polyp image to obtain a second intestinal polyp image; uses an adaptive threshold algorithm to segment the second intestinal polyp image to obtain a main outline image of the intestinal polyps; removes noise stains from the main outline image of the intestinal polyps to obtain a first image; performs local detail processing on the first image to obtain a processed first image; extracts the outline of the intestinal polyps in the processed first image, and performs curve fitting on the outline of the intestinal polyps to obtain a complete outline of the intestinal polyps; and performs intestinal polyp outline segmentation according to the complete outline of the intestinal polyps. The present invention can improve the accuracy of intestinal polyp outline segmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of contour segmentation, and in particular to a method, system and device for intestinal polyp contour segmentation based on adaptive threshold. Background Art

[0002] Colorectal polyps refer to local raised lesions that are higher than the intestinal mucosa. About 90% of CRCs evolve from polyps. Based on the pathological characteristics of polyps, intestinal polyps can be roughly divided into non-adenomatous polyps, adenomatous polyps and other types of polyps. Non-adenomatous polyps include hyperplastic polyps and inflammatory polyps: hyperplastic polyps are the most common, mostly distributed in the distal part of the large intestine, appearing as drop-shaped protrusions on the mucosal surface, with a diameter of less than one centimeter, and will not undergo malignant changes; inflammatory polyps are mostly small and multiple, appearing as wide, long irregular bridges. Adenomatous polyps are divided into tubular adenomas, villous adenomas and mixed adenomas based on their morphological structure. Adenomatous polyps may become cancerous, especially villous adenomas, which have a higher canceration rate, and the canceration rate of mixed adenomas is between tubular adenomas and villous adenomas.

[0003] In order to improve the role of colonoscopy in detecting the early risk of colorectal cancer, the polyp detection rate (ADR) is a very important indicator related to it. According to practical tests, for every 1% increase in ADR, the incidence of colorectal cancer can be reduced by about 3%-6%. Under traditional methods, the identification of colorectal polyps in endoscopic images depends on the doctor's experience and status, especially when the polyp morphology is not clearly recognizable and the noise in the imaging process causes blurring. Under subjective circumstances, it is inevitable that some misjudgments and missed judgments will occur, resulting in inaccurate intestinal polyp segmentation. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a method, system and device for segmenting the contour of intestinal polyps based on an adaptive threshold, which can improve the accuracy of intestinal polyp contour segmentation.

[0005] In a first aspect, an embodiment of the present invention provides a method for segmenting an intestinal polyp contour based on an adaptive threshold, and the method for segmenting an intestinal polyp contour based on an adaptive threshold includes:

[0006] Acquire an intestinal polyp image to be segmented, and remove highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image, wherein the additional information is information irrelevant to the intestinal polyp image to be segmented;

[0007] increasing the image contrast of the first intestinal polyp image to obtain a second intestinal polyp image;

[0008] Using an adaptive threshold algorithm to segment the second intestinal polyp image to obtain a main contour image of the intestinal polyp;

[0009] Removing noise stains from the main contour image of the intestinal polyp to obtain a first image;

[0010] Performing local detail processing on the first image to obtain a processed first image;

[0011] Extracting the intestinal polyp contour in the processed first image, and performing curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour;

[0012] Intestinal polyp contour segmentation is performed according to the complete intestinal polyp contour.

[0013] Compared with the prior art, the first aspect of the present invention has the following beneficial effects:

[0014] This method can improve the recognition of the intestinal polyp contour in the image by removing highlights, removing additional information and increasing image contrast of the intestinal polyp image to be segmented; by adopting an adaptive threshold algorithm to segment the second intestinal polyp image, the accuracy of intestinal polyp contour segmentation can be improved; by removing noise stains from the main contour image, performing local detail processing on the first image, extracting the intestinal polyp contour in the processed first image, and performing curve fitting on the intestinal polyp contour, a complete intestinal polyp contour is obtained, thereby improving the segmentation quality of the intestinal polyp contour and making a more accurate judgment on the intestinal polyp contour area.

[0015] According to some embodiments of the present invention, removing highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image includes:

[0016] Using a specular reflection removal method to remove highlights from the intestinal polyp image to be segmented, to obtain an intestinal polyp image after the highlights are removed;

[0017] Separating the intestinal polyp image after removing highlights into three channels of R, G, and B, and binarizing the R channel to obtain a binary image;

[0018] After finding the boundary of the binary image, the largest area is filled to remove additional information, thereby obtaining a first intestinal polyp image.

[0019] According to some embodiments of the present invention, increasing the image contrast of the first intestinal polyp image to obtain the second intestinal polyp image includes:

[0020] Local adaptive histogram equalization is used to increase the contrast of the first intestinal polyp image to obtain a second intestinal polyp image.

[0021] According to some embodiments of the present invention, removing noise stains from the main contour image of the intestinal polyp to obtain the first image includes:

[0022] Corroding the main contour image of the intestinal polyp to obtain a first main contour image;

[0023] dilating the first main contour image multiple times to obtain a second main contour image;

[0024] The second main contour image is subjected to noise and stain removal by adopting an edge detection method to obtain a first image.

[0025] According to some embodiments of the present invention, performing local detail processing on the first image to obtain the second image includes:

[0026] Marking a connected area of ​​pixels with zero grayscale value in the first image;

[0027] If the number of pixels in the connected area is less than a first preset value, the grayscale values ​​of the pixels less than the first preset value are set to a preset fixed value to obtain a first image;

[0028] The contour lines in the first image are smoothed to obtain a processed first image.

[0029] According to some embodiments of the present invention, extracting the contour of the intestinal polyp in the processed first image includes:

[0030] Calculating the area of ​​the connected region in the processed first image, and removing the region whose area is smaller than a second preset value, to obtain the first image;

[0031] The grayscale values ​​of the connected areas of pixels in the first image that are smaller than a third preset value are set to zero to obtain the outline of the intestinal polyp.

[0032] According to some embodiments of the present invention, performing curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour includes:

[0033] The pixel points corresponding to the intestinal polyp contour are defined as a floating-point matrix, and the intestinal polyp contour is symmetrically folded according to the floating-point matrix to obtain a complete intestinal polyp contour by fitting a curve.

[0034] In a second aspect, an embodiment of the present invention further provides an intestinal polyp contour segmentation system based on an adaptive threshold, and the intestinal polyp contour segmentation system based on an adaptive threshold includes:

[0035] An image acquisition unit, used for acquiring an intestinal polyp image to be segmented, and removing highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image, wherein the additional information is information irrelevant to the intestinal polyp image to be segmented;

[0036] An image enhancement unit, configured to increase the image contrast of the first intestinal polyp image to obtain a second intestinal polyp image;

[0037] An image segmentation unit, configured to segment the second intestinal polyp image using an adaptive threshold algorithm to obtain a main contour image of the intestinal polyp;

[0038] A noise removal unit, used to remove noise stains from the main contour image of the intestinal polyp to obtain a first image;

[0039] a detail processing unit, configured to perform local detail processing on the first image to obtain a processed first image;

[0040] A contour acquisition unit, used for extracting the intestinal polyp contour in the processed first image, and performing curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour;

[0041] A contour segmentation unit is used to perform intestinal polyp contour segmentation according to the complete intestinal polyp contour.

[0042] In the third aspect, an embodiment of the present invention also provides an intestinal polyp contour segmentation device based on an adaptive threshold, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute an intestinal polyp contour segmentation method based on an adaptive threshold as described above.

[0043] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the intestinal polyp contour segmentation method based on an adaptive threshold as described above.

[0044] It can be understood that the beneficial effects of the second to fourth aspects compared with the related art are the same as the beneficial effects of the first aspect compared with the related art. Please refer to the relevant description in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0046] Figure 1 It is a flow chart of a method for segmenting intestinal polyp contours based on an adaptive threshold according to an embodiment of the present invention;

[0047] Figure 2 is a flow chart of a method for segmenting intestinal polyp contours according to another embodiment of the present invention;

[0048] Figure 3 is a schematic diagram of adaptive threshold processing according to an embodiment of the present invention, wherein: Figure 3 (a) is a schematic diagram without highlights. Figure 3 (b) is a schematic diagram after adaptive threshold processing;

[0049] Figure 4 is a schematic diagram of removing noise stains according to an embodiment of the present invention, wherein: Figure 4 (a) is a schematic diagram of corrosion. Figure 4 (b) is a schematic diagram of expansion. Figure 4 (c) is a schematic diagram of Canny edge detection;

[0050] Figure 5 is a schematic diagram of a process of obtaining a complete intestinal polyp outline according to an embodiment of the present invention, wherein: Figure 5 (a) is a schematic diagram of the effect after smoothing. Figure 5 (b) is a schematic diagram of the effect of the obvious contour area. Figure 5 (c) is a schematic diagram of the effect after curve fitting;

[0051] Figure 6 It is a structural diagram of an intestinal polyp contour segmentation system based on adaptive threshold according to an embodiment of the present invention;

[0052] Figure 7 It is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0053] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0054] In the description of the present invention, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0055] In the description of the present invention, it should be understood that descriptions involving orientation, such as orientation or positional relationship indicated as up, down, etc., are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0056] In the description of the present invention, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention in combination with the specific content of the technical solution.

[0057] Under traditional methods, the identification of colorectal polyps in endoscopic images depends on the doctor's experience and condition. In particular, when the polyp morphology is not clearly recognizable and the noise in the imaging process causes blurring, some misjudgments and missed judgments are inevitable under subjective circumstances, resulting in inaccurate intestinal polyp segmentation.

[0058] To solve the above problems, the present invention can improve the recognition of intestinal polyp contours in images by removing highlights, removing additional information and increasing image contrast of the intestinal polyp image to be segmented; the accuracy of intestinal polyp contour segmentation can be improved by adopting an adaptive threshold algorithm to segment the second intestinal polyp image; the intestinal polyp contour is extracted from the processed first image by removing noise stains from the main contour image, performing local detail processing on the first image, and curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour, thereby improving the segmentation quality of the intestinal polyp contour and making a more accurate judgment on the intestinal polyp contour area.

[0059] Reference Figure 1 The embodiment of the present invention provides a method for segmenting the contour of intestinal polyps based on an adaptive threshold. The method for segmenting the contour of intestinal polyps based on an adaptive threshold includes but is not limited to steps S100 to S700, wherein:

[0060] Step S100, obtaining an intestinal polyp image to be segmented, and removing highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image;

[0061] Step S200, increasing the image contrast of the first intestinal polyp image to obtain a second intestinal polyp image;

[0062] Step S300, segmenting the second intestinal polyp image using an adaptive threshold algorithm to obtain a main contour image of the intestinal polyp;

[0063] Step S400, removing noise stains from the main contour image of the intestinal polyp to obtain a first image;

[0064] Step S500, performing local detail processing on the first image to obtain a processed first image;

[0065] Step S600, extracting the intestinal polyp contour in the processed first image, and performing curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour;

[0066] Step S700: segment the intestinal polyp contour according to the complete intestinal polyp contour.

[0067] In this embodiment, in order to improve the recognition of the intestinal polyp contour in the image, this embodiment obtains the intestinal polyp image to be segmented, removes highlights and additional information from the intestinal polyp image to be segmented, obtains the first intestinal polyp image, and increases the image contrast of the first intestinal polyp image to obtain the second intestinal polyp image; in order to improve the segmentation quality of the intestinal polyp contour and the accuracy of segmenting the intestinal polyps, this embodiment segments the second intestinal polyp image by adopting an adaptive threshold algorithm to obtain the main contour image of the intestinal polyps, then removes noise stains from the main contour image of the intestinal polyps to obtain the first image, performs local detail processing on the first image to obtain the processed first image, finally extracts the intestinal polyp contour in the processed first image, performs curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour, and performs intestinal polyp contour segmentation according to the complete intestinal polyp contour.

[0068] In some embodiments, removing highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image includes:

[0069] The specular reflection removal method is used to remove the highlights of the segmented intestinal polyp image, and the intestinal polyp image after the highlights are removed is obtained;

[0070] The intestinal polyp image after highlight removal is separated into three channels: R, G, and B, and the R channel is binarized to obtain a binary image;

[0071] After finding the boundary of the binary image, the largest area is filled to remove additional information, and the first intestinal polyp image is obtained.

[0072] In this embodiment, since the surface of abdominal organs and the inner wall of the intestinal cavity is usually smooth and watery with a sparse texture, it is easy to produce large-area mirror reflection under endoscopic / laparoscopic lighting conditions. The mirror reflection of the intestinal cavity surface greatly interferes with the observation and judgment of clinicians, and it may cause target drift and inaccurate identification. Therefore, this embodiment uses a mirror reflection removal method to remove highlights from the segmented intestinal polyp image to improve the recognition of the intestinal polyp contour; in order to prevent additional information from interfering with the recognition of the intestinal polyp contour, therefore, removing the additional information can further improve the recognition of the intestinal polyp contour.

[0073] In some embodiments, increasing the image contrast of the first intestinal polyp image to obtain the second intestinal polyp image includes:

[0074] Local adaptive histogram equalization is used to increase the contrast of the first intestinal polyp image to obtain a second intestinal polyp image.

[0075] In this embodiment, local adaptive histogram equalization is used to increase image contrast, so that the recognition of intestinal polyp contours is further improved.

[0076] In some embodiments, removing noise stains from the main contour image of the intestinal polyp to obtain the first image includes:

[0077] Corroding the main contour image of the intestinal polyp to obtain a first main contour image;

[0078] Perform multiple expansions on the first main contour image to obtain a second main contour image;

[0079] The second main contour image is subjected to noise and stain removal using an edge detection method to obtain a first image.

[0080] In this embodiment, Canny edge detection is used to remove noise stains, which can effectively reduce random noise generated during the processing, thereby improving the accuracy of identifying the contour of intestinal polyps in the main contour image.

[0081] In some embodiments, performing local detail processing on the first image to obtain the second image includes:

[0082] Marking the connected areas of pixels with zero gray value in the first image;

[0083] If the number of pixels in the connected area is less than a first preset value, the grayscale values ​​of the pixels less than the first preset value are set to a preset fixed value to obtain a first image;

[0084] The contour lines in the first image are smoothed to obtain a processed first image.

[0085] In this embodiment, the grayscale value of pixels less than the first preset value is set to a preset fixed value of 255 (white) to remove small areas in the background and improve segmentation efficiency; the contour lines are smoothed to avoid the phenomenon of intermediate color blocks being broken.

[0086] In some embodiments, extracting the intestinal polyp contour in the processed first image includes:

[0087] Calculating the area of ​​the connected region in the processed first image, and removing the region whose area is smaller than the second preset value, to obtain the first image;

[0088] The grayscale values ​​of the connected areas of pixels in the first image that are smaller than the third preset value are set to zero to obtain the outline of the intestinal polyp.

[0089] In this embodiment, the grayscale value of the connected area of ​​pixels less than the third preset value is set to zero, thereby separating the background such as the inner wall of the intestine, which is similar in color to the outline of the intestinal polyp and has a larger area. The processed image generally only leaves the obvious outline area of ​​the intestinal polyp, which can further improve the recognition of the outline of the intestinal polyp.

[0090] In some embodiments, curve fitting is performed on the intestinal polyp contour to obtain a complete intestinal polyp contour, including:

[0091] The pixel points corresponding to the intestinal polyp contour are defined as a floating-point matrix, and the intestinal polyp contour is symmetrically folded according to the floating-point matrix to obtain a complete intestinal polyp contour by fitting the curve.

[0092] In this embodiment, the intestinal polyp contour segmentation can be performed based on the complete intestinal polyp contour. Since the intestinal polyp contour recognition is relatively accurate, the intestinal polyp contour segmentation quality and accuracy can be improved.

[0093] To facilitate understanding by those skilled in the art, a set of best embodiments is provided below:

[0094] Reference Figure 2 In this embodiment, the intestinal polyp image to be segmented after preprocessing is segmented using an adaptive threshold algorithm to perform polyp main contour segmentation; the image with noise and stains after segmentation is corroded, expanded (corrosion and expansion are methods in morphological filtering) and edge detected in succession to remove small areas in the background; the contour lines are then smoothed, and the segmented areas are marked, and the main contour image is extracted using custom rules (i.e., areas with an area less than 1 / 3 of the maximum area are removed as noise, and the gray level of connected areas with less than 1500 pixels is set to 0 to further separate the background area), and finally the curve is fitted into a closed area, and the closed area is filled for comparison with the gold standard (including evaluation and judgment). The method of this embodiment mainly includes the following steps:

[0095] 1. Preprocessing.

[0096] (1) Removal of mirror reflection spots.

[0097] Specular reflection removal is an important research topic. The surface of abdominal organs and intestinal lining is usually smooth and watery, with sparse texture, which is easy to produce large-area specular reflection under endoscopic / laparoscopic lighting conditions. The specular reflection on the surface of the intestinal cavity is extremely interfering with the observation and judgment of clinicians. It may cause target drift and inaccurate identification. Therefore, eliminating the influence of highlights has become a basic task of preprocessing in intestinal polyp image segmentation. The open source model of specular reflection removal of endoscopic image sequences based on adaptive RPCA decomposition was used to pre-process the dataset to obtain images with most of the highlights (i.e., specular reflection points) removed.

[0098] It should be noted that the open source model for removing specular reflections from endoscopic image sequences based on adaptive RPCA decomposition in this embodiment is a prior art and will not be described in detail in this embodiment.

[0099] (2) Removal of additional information.

[0100] Since the image may contain information irrelevant to the outline of the intestinal polyp, such as text and other background information, an endoscopic image is first separated into three channels, RGB, and then the red channel is binarized to obtain a mask image. After finding the boundary of the binary image, the largest area is found for filling. The purpose of this process is to remove the text area in the image so as to better perform subsequent image processing.

[0101] Finally, an image is obtained after removing the specular reflection points and additional information (ie, the first intestinal polyp image).

[0102] (3) Increase image contrast.

[0103] The contrast of the image can be increased by contrast stretching operation, but its image enhancement effect is not as strong as histogram equalization. It uses point transformation of nonlinear mapping to redistribute the pixel intensity values ​​in the input image so that the processed image (i.e., the second intestinal polyp image) has a uniform intensity distribution, thereby increasing the contrast of the image.

[0104] The operation here is to first process the cumulative distribution function (cdf) of the image, and perform histogram equalization by redistributing pixel values ​​with the cdf values ​​corresponding to the pixels. The scikit-image library function that performs global and local adaptive histogram equalization is also called to perform histogram equalization.

[0105] The focus of the image is mainly the outline of the edge of the polyp. A careful analysis shows that the image processed by local adaptive histogram equalization is more in line with the requirements of the method of this embodiment. Of course, the performance of performing histogram equalization by redistributing pixel values ​​and corresponding cdf values ​​of pixels is also quite good, but the image color is slightly distorted.

[0106] 2. Extraction of main contours.

[0107] (1) Main contour segmentation.

[0108] Reference Figure 3 , Figure 3 (a) is a schematic diagram without highlights. Figure 3 (b) is a schematic diagram after adaptive threshold processing. The adaptive threshold algorithm is used on the image after removing highlights to obtain the main contour image of the image (i.e. the main contour image of the intestinal polyp). The specific adaptive threshold processing is:

[0109] The basic approach based on variable thresholding is to compute a threshold at each point (x,y) in the image based on one or more specified properties of a neighborhood of (x,y). Although this process may seem laborious, modern algorithms and hardware allow neighborhood processing to be performed quickly, especially for common functions such as logical and arithmetic operations.

[0110] The method of this embodiment is described below using the standard deviation and mean of the pixels in a neighborhood of each point in the image preprocessed by this embodiment. The standard deviation and mean are very useful for finding the local threshold because they are descriptors of contrast and average grayscale. and Represents the neighborhood centered at coordinate (x,y) in the image The standard deviation and mean of the set of pixels included. The following is a general formula for a variable threshold based on local image properties:

[0111] (1)

[0112] where a and b are non-negative constants, and

[0113] (2)

[0114] in, is the global image mean. The segmented image is calculated as:

[0115] (3)

[0116] In the formula, is the input image. This formula is calculated for all pixel locations in the image and uses the neighborhood at each location (x, y) Different thresholds are calculated for the pixels in .

[0117] Using predicate logic with parameters computed from the neighborhood of a point (x,y), you can assign greater weight to variable thresholding:

[0118] (4)

[0119] Among them, Q is a predicate logic, which is a neighborhood For example, consider the following predicate logic Q( , ):

[0120] (5)

[0121] Note that formula (3) is a special case of formula (4), which is obtained by setting Q to be true when f(x, y)>T and setting Q to be false in other cases.

[0122] (2) Remove noise stains.

[0123] Use a structure element of size 3×3 with all values ​​1 to perform 1 erosion on the main contour image, then perform 2 dilation morphological filtering, and then use Canny edge detection on it. When the gradient value of a pixel is greater than 200, the pixel is considered an edge pixel; when the gradient value of a pixel is less than 100, the pixel is excluded; when the gradient value of a pixel is between 100 and 200, only pixels connected to pixels higher than 200 are considered edge pixels. In this way, the remaining random noise is eliminated and the first image is obtained. The process diagram is shown in the figure below. Figure 4 As shown, Figure 4 (a) is a schematic diagram of corrosion. Figure 4 (b) is a schematic diagram of expansion. Figure 4 (c) is a schematic diagram of Canny edge detection.

[0124] (3) Local detail processing.

[0125] Consider the pixel with gray value 0 (black), mark its connected area, if the number of pixels in the connected area of ​​the current pixel is less than 30, set its gray value to 255 (white) to remove the small area in the background, improve the segmentation efficiency of this embodiment. Then smooth the contour lines to obtain the processed first image, which can avoid the phenomenon of the middle color block breaking, the effect is shown in Figure 5 Middle (a).

[0126] (4) True contour extraction based on custom rules.

[0127] After the 4-neighborhood connected regions of the image are partitioned and marked, the area of ​​each connected region is calculated, and the area less than 1 / 3 of the maximum area is removed as noise. This successfully removes most of the mis-segmented background. Then the gray level of the connected region less than 1500 pixels is set to 0. This separates the intestinal wall and other backgrounds with similar colors and larger areas to the polyp outline. After processing, the image generally only leaves the obvious outline area of ​​the polyp. The effect is shown in Figure 2. Figure 5 Middle (b).

[0128] It should be noted that the four-neighborhood connected regions in this embodiment are prior art and are not described in detail in this embodiment. The area of ​​each connected region can be calculated using the existing method for calculating irregular areas, which is not specifically limited in this embodiment.

[0129] (5) Curve fitting.

[0130] Due to the smooth surface of the inner wall of the intestinal cavity, the outline of the lower half of the polyp is almost invisible under the uneven lighting conditions of the endoscope, and additional processing must be performed. This embodiment defines a symmetric matrix M, where M is a 2x3 floating-point matrix, which is used to symmetrically fold the image. Here, two pixels are taken from the original image at 1 / 4 of the length of the terminal pixel curve, and the image is symmetrically folded with the straight line connecting them as the axis. The effect is shown in FIG. Figure 5 Middle (c).

[0131] 3. Image segmentation.

[0132] The complete intestinal polyp contour is used for intestinal polyp contour segmentation.

[0133] For better explanation, the following experiments were performed in this embodiment:

[0134] According to the obtained gold standard, the supervised evaluation method is used. After computer calculation, the accuracy of the ratio of correctly segmented pixels to all segmented pixels of the method of this embodiment reaches 78.97%, the recall rate of the ratio of correctly segmented pixels to all actual pixels reaches 99.82%, the f1_score is 88.18%, and the ratio of correctly segmented pixels to the union of all segmented pixels and actual pixels is 78.86%. In summary, the method of this embodiment optimizes and improves the traditional segmentation algorithm, and the performance exceeds that of most existing traditional segmentation algorithms.

[0135] 100 images were selected as a test set to test the above method. The data in the following table are the performance results of the method of this embodiment on images without overlapping polyps and images with overlapping polyps. It can be seen that the experimental algorithm performs better when there are no overlapping polyps.

[0136] Table 1 shows the performance results of the method of this embodiment on images without overlapping polyps and images with overlapping polyps.

[0137]

[0138] Reference Figure 6The embodiment of the present invention further provides an intestinal polyp contour segmentation system based on an adaptive threshold. The intestinal polyp contour segmentation system based on an adaptive threshold includes an image acquisition unit 100, an image enhancement unit 200, an image segmentation unit 300, a noise removal unit 400, a detail processing unit 500, a contour acquisition unit 600 and a contour segmentation unit 700, wherein:

[0139] The image acquisition unit 100 is used to acquire the intestinal polyp image to be segmented, and remove highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image, wherein the additional information is information irrelevant to the intestinal polyp image to be segmented;

[0140] An image enhancement unit 200 is used to increase the image contrast of the first intestinal polyp image to obtain a second intestinal polyp image;

[0141] An image segmentation unit 300 is used to segment the second intestinal polyp image using an adaptive threshold algorithm to obtain a main contour image of the intestinal polyp;

[0142] A noise removal unit 400 is used to remove noise stains from the main contour image of the intestinal polyp to obtain a first image;

[0143] A detail processing unit 500, configured to perform local detail processing on the first image to obtain a processed first image;

[0144] The contour acquisition unit 600 is used to extract the intestinal polyp contour in the processed first image, and perform curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour;

[0145] The contour segmentation unit 700 is used to perform intestinal polyp contour segmentation according to the complete intestinal polyp contour.

[0146] It should be noted that, since the intelligent automatic class scheduling system in this embodiment and the above-mentioned intelligent automatic class scheduling method are based on the same inventive concept, the corresponding contents in the method embodiment are also applicable to the system embodiment and will not be described in detail here.

[0147] See also Figure 7 The embodiment of the present application also provides an intelligent automatic class scheduling device, and the intelligent automatic class scheduling device includes:

[0148] at least one memory;

[0149] at least one processor;

[0150] at least one program;

[0151] The program is stored in the memory, and the processor executes at least one program to implement the intelligent automatic class scheduling method described above in the present disclosure.

[0152] The electronic device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a vehicle-mounted computer, etc.

[0153] The electronic device according to the embodiment of the present application is described in detail below.

[0154] The processor 1600 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present disclosure;

[0155] The memory 1700 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1700 can store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1700, and the processor 1600 calls and executes the intelligent automatic class scheduling method of the embodiment of the present disclosure.

[0156] Input / output interface 1800, used to implement information input and output;

[0157] Communication interface 1900, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);

[0158] Bus 2000 , which transmits information between various components of the device (e.g., processor 1600 , memory 1700 , input / output interface 1800 , and communication interface 1900 );

[0159] The processor 1600 , the memory 1700 , the input / output interface 1800 , and the communication interface 1900 are connected to each other in communication within the device via the bus 2000 .

[0160] The embodiment of the present disclosure also provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned intelligent automatic class scheduling method.

[0161] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0162] The embodiments described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.

[0163] Those skilled in the art will appreciate that the technical solutions shown in the figures do not limit the embodiments of the present disclosure and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0164] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, 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.

[0165] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0166] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0167] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0168] In the several embodiments provided in the present application, 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 units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0169] The units described as separate components may or may not be physically separated, and the components shown as units 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0170] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0171] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable an electronic device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store programs. The above is a detailed description of the embodiments of the present application in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Within the scope of knowledge possessed by ordinary technicians in the relevant technical field, various changes can be made without departing from the purpose of the present application.

Claims

1. A method for segmenting intestinal polyp contours based on adaptive threshold, characterized in that: The intestinal polyp contour segmentation method based on adaptive threshold comprises: Acquire an intestinal polyp image to be segmented, and remove highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image, wherein the additional information is information irrelevant to the intestinal polyp image to be segmented; increasing the image contrast of the first intestinal polyp image to obtain a second intestinal polyp image; Using an adaptive threshold algorithm to segment the second intestinal polyp image to obtain a main contour image of the intestinal polyp; Removing noise stains from the main contour image of the intestinal polyp to obtain a first image; Performing local detail processing on the first image to obtain a processed first image; wherein: Marking a connected area of ​​pixels with zero grayscale value in the first image; If the number of pixels in the connected area is less than a first preset value, the grayscale values ​​of the pixels less than the first preset value are set to a preset fixed value to obtain a first image; Smoothing the contour lines in the first image to obtain a processed first image; Extracting the intestinal polyp contour in the processed first image, and performing curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour; wherein: Calculating the area of ​​the connected region in the processed first image, and removing the region whose area is smaller than a second preset value, to obtain the first image; Setting the grayscale values ​​of the connected areas of pixels in the first image that are smaller than a third preset value to zero to obtain an intestinal polyp outline; Intestinal polyp contour segmentation is performed according to the complete intestinal polyp contour.

2. The method for segmenting intestinal polyp contours based on adaptive threshold according to claim 1, characterized in that: The removing highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image includes: Using a specular reflection removal method to remove highlights from the intestinal polyp image to be segmented, to obtain an intestinal polyp image after the highlights are removed; Separating the intestinal polyp image after removing highlights into three channels of R, G, and B, and binarizing the R channel to obtain a binary image; After finding the boundary of the binary image, the largest area is filled to remove additional information, thereby obtaining a first intestinal polyp image.

3. The method for segmenting intestinal polyp contours based on adaptive threshold according to claim 1, characterized in that: The step of increasing the image contrast of the first intestinal polyp image to obtain a second intestinal polyp image includes: Local adaptive histogram equalization is used to increase the contrast of the first intestinal polyp image to obtain a second intestinal polyp image.

4. The method for segmenting intestinal polyp contours based on adaptive threshold according to claim 1, characterized in that: The step of removing noise stains from the main contour image of the intestinal polyp to obtain a first image includes: Corroding the main contour image of the intestinal polyp to obtain a first main contour image; dilating the first main contour image multiple times to obtain a second main contour image; The second main contour image is subjected to noise and stain removal by adopting an edge detection method to obtain a first image.

5. The method for segmenting intestinal polyp contours based on adaptive threshold according to claim 1, characterized in that: The curve fitting of the intestinal polyp contour to obtain a complete intestinal polyp contour includes: The pixel points corresponding to the intestinal polyp contour are defined as a floating-point matrix, and the intestinal polyp contour is symmetrically folded according to the floating-point matrix to obtain a complete intestinal polyp contour by fitting a curve.

6. An intestinal polyp contour segmentation system based on adaptive threshold, characterized in that: The intestinal polyp contour segmentation system based on adaptive threshold comprises: An image acquisition unit, used for acquiring an intestinal polyp image to be segmented, and removing highlights and additional information from the intestinal polyp image to be segmented to obtain a first intestinal polyp image, wherein the additional information is information irrelevant to the intestinal polyp image to be segmented; An image enhancement unit, configured to increase the image contrast of the first intestinal polyp image to obtain a second intestinal polyp image; An image segmentation unit, configured to segment the second intestinal polyp image using an adaptive threshold algorithm to obtain a main contour image of the intestinal polyp; A noise removal unit, used to remove noise stains from the main contour image of the intestinal polyp to obtain a first image; A detail processing unit is used to perform local detail processing on the first image to obtain a processed first image; wherein: Marking a connected area of ​​pixels with zero grayscale value in the first image; If the number of pixels in the connected area is less than a first preset value, the grayscale values ​​of the pixels less than the first preset value are set to a preset fixed value to obtain a first image; Smoothing the contour lines in the first image to obtain a processed first image; A contour acquisition unit is used to extract the intestinal polyp contour in the processed first image, and perform curve fitting on the intestinal polyp contour to obtain a complete intestinal polyp contour; wherein: Calculating the area of ​​the connected region in the processed first image, and removing the region whose area is smaller than a second preset value, to obtain the first image; Setting the grayscale values ​​of the connected areas of pixels in the first image that are smaller than a third preset value to zero to obtain an intestinal polyp outline; A contour segmentation unit is used to perform intestinal polyp contour segmentation according to the complete intestinal polyp contour.

7. An intestinal polyp contour segmentation device based on adaptive threshold, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the adaptive threshold-based intestinal polyp contour segmentation method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the intestinal polyp contour segmentation method based on adaptive threshold as described in any one of claims 1 to 5.