Intelligent recognition method of colonoscopy images based on machine vision

Through the intelligent recognition method of colonoscopy images based on machine vision, combined with halo points, fold density gradient and lesion density, the problem of difficult polyp segmentation and noise sensitivity in traditional methods is solved, and efficient and accurate identification and lesion identification of colonoscopy images are achieved. Degree assessment.

CN118644508BActive Publication Date: 2024-10-15SHUNTONG INFORMATION TECH (DALIAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411117601.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-10-15
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

The traditional colonoscopy image segmentation method based on region growing and edge detection has the problem of difficulty in selecting seed points and being sensitive to noise when segmenting colon polyp regions, which may cause the edge of the lesion to break and affect the diagnostic accuracy.

Method used

An intelligent recognition method for enteroscopy images based on machine vision is used to obtain the closed contour area through preprocessing, determine the deep colon area and suspected polyp area, calculate the halo point and halo end point, and calculate polyps by combining the fold density gradient and halo gradient. Growth coefficient and lesion density, using threshold segmentation to identify polyp regions.

Benefits of technology

It improves the accuracy and efficiency of colonoscopy image recognition, avoids the influence of benign polyps, and achieves precise classification and rapid segmentation of the degree of polyp lesions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118644508B_ABST
    Figure CN118644508B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing technology, and provides a method for intelligent recognition of colonoscopic images based on machine vision, comprising: using an endoscopic camera to collect colonoscopic images of the colon, and preprocessing the acquired colonoscopic images, converting the preprocessed colonoscopic images into grayscale images and HSV-based color images, constructing a polyp growth coefficient based on colon polyp characteristics, and accurately dividing polyp areas in the colonoscopic images based on the polyp growth coefficient, while determining a colon normal index according to the polyp lesion characteristics, and then determining the degree of polyp lesions in the polyp area through the colon normal index, accurately and quickly segmenting the polyp area with lesions, accelerating the calculation speed, avoiding the influence of introducing benign polyps to reduce the accuracy and calculation speed of the algorithm, and realizing the method for intelligent recognition of colonoscopic images based on machine vision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for intelligently recognizing colonoscopy images based on machine vision. Background Art

[0002] Colonoscopic images are real-time images of the inside of the colon and rectum obtained through colonoscopy. These images play an important role and significance in the diagnosis and treatment of intestinal diseases. As colonoscopic images that can provide direct visual information, doctors can diagnose diseases by observing and analyzing the color, morphology, and inflammation information of the intestinal mucosa, thereby providing an earlier treatment opportunity. Colonoscopic images can also serve as important reference materials for pathologists. By observing and analyzing the images, pathologists can evaluate the nature and extent of lesions.

[0003] The colon can develop lesions due to inflammation, dietary factors, and intestinal infection. Certain types of polyps may have the potential risk of cancer. Severe ulcerative colitis may lead to intestinal wall perforation. When performing lesion segmentation on colonoscopic images, the seed point selection is difficult in the traditional colonoscopic image segmentation method based on region growing. The colonoscopic image segmentation based on edge detection is most sensitive to noise, and the lesion edge may be broken. Summary of the invention

[0004] In view of the above problems, the present application provides a method for intelligent recognition of colonoscopic images based on machine vision, which constructs features for the colon polyp area, determines the polyp area, further analyzes the polyp lesion condition, sets a threshold to segment the colonoscopic image, avoids the introduction of the impact of benign polyps that reduces the accuracy of the algorithm and the calculation speed, and realizes intelligent recognition of colonoscopic images based on machine vision, greatly improving the accuracy and efficiency of recognition.

[0005] In a first aspect, an embodiment of the present application provides a method for intelligent recognition of colonoscopy images based on machine vision, comprising:

[0006] Obtain the first colonoscopic image of the colon;

[0007] Preprocessing the first colonoscopy image to obtain each closed contour region in the edge image corresponding to the first colonoscopy image;

[0008] Based on the grayscale mean inside each closed contour area, the deep colon area and the suspected polyp area are determined, wherein the closed contour area with the smallest grayscale mean is the deep colon area, and the remaining closed contour areas are suspected polyp areas;

[0009] Based on the deep colon area and the suspected polyp area, determine the blooming point and blooming end point corresponding to each suspected polyp area;

[0010] According to the line between the smudging point and the smudging end point, the smudging gradient and the wrinkle density gradient corresponding to each suspected polyp area are determined;

[0011] Based on the fold density gradient and the bloom gradient, the polyp area is determined;

[0012] According to the corner points, area and number of normal intestinal wall cell pixels of each polyp area, the lesion density and polyp color difference corresponding to each polyp area are determined;

[0013] According to the lesion density and polyp color difference corresponding to each polyp area, the colon normal index of each polyp area was obtained;

[0014] The polyp lesion area in the colonoscopic image was determined based on the colon normal index of each polyp area.

[0015] In a possible implementation, preprocessing the first colonoscopy image to obtain each closed contour region in the edge image corresponding to the first colonoscopy image includes:

[0016] Preprocessing the first colonoscopy image using a wavelet transform image contrast enhancement algorithm to obtain a second colonoscopy image;

[0017] Performing grayscale processing and HSV transformation processing on the second colonoscopy image, respectively, to obtain a grayscale image and an HSV color image corresponding to the second colonoscopy image;

[0018] The edge detection algorithm is used to perform edge detection processing on the grayscale image to obtain an edge image;

[0019] The edge image is subjected to regional contour tracking processing by a contour tracking algorithm to determine each closed contour region in the edge image.

[0020] In a possible implementation, based on the deep colon region and the suspected polyp region, determining the shading point and shading end point corresponding to each suspected polyp region includes:

[0021] The deep region of the colon is processed by the minimum circumscribed circle algorithm to obtain the center point of the circular region, wherein the center point of the circular region is used as the center point of the deep region of the colon;

[0022] The Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the regional center point of the deep colon area is calculated to obtain the Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the regional center point of the deep colon area, wherein the shortest Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the regional center point of the deep colon area is the smudge point corresponding to each suspected polyp area;

[0023] A sliding window is constructed based on the smudged points of each suspected polyp area, and the sliding window is slid on the line connecting the smudged points and the center point of the deep colon area, where the window size is 3*3 and the sliding step is 1;

[0024] Calculate the grayscale gradients of all central pixel points of the sliding window on the sliding route in the X and Y directions to obtain the grayscale gradients of all central pixel points of the sliding window in the X and Y directions;

[0025] According to the grayscale gradients of all the central pixels of the sliding window in the X and Y directions, the grayscale gradient of the central pixel corresponding to the sliding window is obtained, wherein the end point of the blending is the point with the largest gradient of the central pixels corresponding to other sliding windows except the blending point.

[0026] In a possible implementation, the shading gradient and the wrinkle density gradient corresponding to each suspected polyp region are determined according to the line between the shading point and the shading end point, including:

[0027] According to the grayscale gradient on the line path from the smudging point to the smudging end point, the smudging gradient corresponding to each suspected polyp area is determined, where the calculation formula of the smudging gradient is:

[0028] ;

[0029] in, It is a gradient. For the The gradient size of the central pixel corresponding to the sliding window; is the number of central pixels on the sliding path of the sliding window; , , Respectively represent the grayscale gradients of all central pixels on the sliding path of the sliding window in the X and Y directions;

[0030] According to the distribution of intestinal wall folds in the colonoscopy image, the fold density gradient is determined, where the calculation formula of the fold density gradient is:

[0031] ;

[0032] in, is the number of edge contours that converge on the same pixel in the i-th window. When it is 0, it is recorded as 1. The window is a 5*5 pixel window constructed with each pixel as the center pixel on the path connecting the shading point to the shading end point. is the Euclidean distance between the pixels closest to the shading point on the wrinkle edge contour within each pixel window, It is the number of all pixels on the path from the blending point to the blending end point.

[0033] In a possible implementation, determining the polyp region based on the wrinkle density gradient and the blooming gradient includes:

[0034] Based on the fold density gradient and the blooming gradient, the blooming degree corresponding to each suspected polyp area is determined;

[0035] According to the blurring degree corresponding to each suspected polyp area, the polyp growth coefficient corresponding to each suspected polyp area is determined;

[0036] The polyp area is determined based on the polyp growth coefficient corresponding to each suspected polyp area.

[0037] In a possible implementation, the calculation formula of the blurring degree is further as follows:

[0038] ;

[0039] in, It is a gradient. is the fold density gradient; the calculation formula of the polyp growth coefficient is:

[0040] ;

[0041] in, is the polyp growth coefficient; is the blending distance, which means the Euclidean distance from the blending point to the corresponding blending end point; For the degree of blurring.

[0042] In a possible implementation, determining the polyp region based on the polyp growth coefficient corresponding to each suspected polyp region includes:

[0043] The polyp growth coefficient is normalized to obtain a normalized polyp growth coefficient of the polyp growth coefficient;

[0044] The normalized polyp growth coefficient of the polyp growth coefficient is compared with a first preset threshold to determine the polyp area.

[0045] In a possible implementation, the lesion density and polyp color difference corresponding to each polyp region are determined according to the corner points, area, and number of normal intestinal wall cell pixels of each polyp region, including:

[0046] A corner detection algorithm is used to detect corners in each polyp region to obtain corners in each polyp region;

[0047] According to the distance between the two corner points in each polyp area, the lesion density of each polyp area is obtained; the calculation formula of the lesion density of the polyp area is:

[0048] ;

[0049] in, is the lesion density; is the number of corner points; is the number of lines connecting the corner points; is the Euclidean distance between two corner points, i.e., the lesion points;

[0050] According to the area of ​​each polyp region and the number of normal intestinal wall cell pixels in the corresponding polyp region, the polyp color difference of each polyp region is determined; the calculation formula of the polyp color difference of the polyp region is:

[0051] ;

[0052] in, is the number of pixels in the polyp area, recorded as the polyp area, It is the number of pixels in the polyp area with a hue range below 30° in the HSV color space.

[0053] In a possible implementation, according to the lesion density and polyp color difference corresponding to each polyp area, a colon normal index of each polyp area is obtained, including: the calculation formula of the colon normal index of the polyp area is:

[0054] ;

[0055] in, is the lesion density; Color difference for polyps.

[0056] In a possible implementation, determining the polyp lesion area in the colonoscopic image according to the colon normal index of each polyp area includes:

[0057] The colon normal index is normalized to obtain a normalized colon normal index of the colon normal index;

[0058] The normalized colon normal index of the colon normal index is compared with the second preset threshold value. When the normalized colon normal index of the colon normal index is greater than the second preset threshold value, the polyp area is judged to be a diseased polyp area; when the normalized colon normal index of the colon normal index is less than the second preset threshold value, the polyp area is judged to be a benign polyp area.

[0059] In a second aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, various possible embodiments of the first aspect are implemented.

[0060] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute various possible implementation embodiments of the first aspect.

[0061] The beneficial effects of the present application are as follows: the embodiments of the present application construct a polyp growth coefficient and a normal colon index based on the characteristics of colon polyps, set a threshold to accurately divide the polyps in the colon image, use a simple and fast image segmentation algorithm to segment the colon image, speed up the calculation speed, and at the same time determine the degree of polyp lesions according to the characteristics of polyp lesions, and segment the polyp areas with lesions, thereby avoiding the impact of introducing benign polyps that reduce the accuracy of the algorithm and the calculation speed, and realizing an intelligent recognition method for colonoscopy images based on machine vision. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 This is a flowchart of a method for intelligent recognition of colonoscopy images based on machine vision provided in an embodiment of the present application;

[0063] Figure 2 This is a colonoscopic image of a colon polyp at different lesion degrees provided in an embodiment of the present application;

[0064] Figure 3 It is a colon image area and polyp schematic diagram provided in an embodiment of the present application;

[0065] Figure 4 It is a schematic diagram of a sliding window connecting a blurred point and a center point of a deep colon region provided in an embodiment of the present application;

[0066] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0067] Figure 6 It is a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of this application.

[0069] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0070] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0071] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0072] See also Figure 1 As shown, the embodiment of the present application discloses a method for intelligent recognition of colonoscopy images based on machine vision, comprising:

[0073] Step S11, obtaining a first colonoscopic image of the colon;

[0074] Step S12, preprocessing the first colonoscopy image to obtain each closed contour area in the edge image corresponding to the first colonoscopy image;

[0075] Step S13, based on the grayscale mean inside each closed contour area, determine the deep colon area and the suspected polyp area, wherein the closed contour area with the smallest grayscale mean is the deep colon area, and the remaining closed contour areas are suspected polyp areas;

[0076] Step S14, based on the deep colon area and the suspected polyp area, determining the blooming point and blooming end point corresponding to each suspected polyp area;

[0077] Step S15, determining the blooming gradient and wrinkle density gradient corresponding to each suspected polyp region according to the line between the blooming point and the blooming end point;

[0078] Step S16, determining the polyp area based on the wrinkle density gradient and the blooming gradient;

[0079] Step S17, determining the lesion density and polyp color difference corresponding to each polyp region according to the corner points, area and number of normal intestinal wall cell pixels of each polyp region;

[0080] Step S18, obtaining a colon normal index for each polyp region according to the lesion density and polyp color difference corresponding to each polyp region;

[0081] Step S19, determining the polyp lesion area in the colonoscopy image according to the colon normal index of each polyp area.

[0082] Further, in an optional embodiment of the present application, the first colonoscopy image is preprocessed to obtain each closed contour area in the edge image corresponding to the first colonoscopy image, including:

[0083] Preprocessing the first colonoscopy image using a wavelet transform image contrast enhancement algorithm to obtain a second colonoscopy image;

[0084] Performing grayscale processing and HSV transformation processing on the second colonoscopy image, respectively, to obtain a grayscale image and an HSV color image corresponding to the second colonoscopy image;

[0085] The edge detection algorithm is used to perform edge detection processing on the grayscale image to obtain an edge image;

[0086] The edge image is subjected to regional contour tracking processing by a contour tracking algorithm to determine each closed contour region in the edge image.

[0087] It should be noted that colon polyps are a common colon disease with a potential risk of cancer. As the severity of the lesion continues to increase, the diameter of the polyp continues to increase, its originally smooth surface becomes uneven and the edge between the polyp and the normal mucosa gradually becomes blurred. Due to vascular dilation or rupture, darker red or purple spots will also appear on the surface of the polyp. The polyp stalk between the intestinal wall and the polyp becomes gradually clearer as the intestinal epithelial cells on the surface of the colon mucosa grow outward in the colon. Its morphological characteristics are usually manifested as a slender and narrow tubular structure.

[0088] See also Figure 2 As shown, when the epithelial cells of the colon wall become diseased and polyps occur, there will be obvious characteristics in the colonoscopy image. There will be obvious polyp edges on the colon wall, the color of the polyp surface changes from light to dark, and the surface unevenness becomes more serious, and even ulcers and erosions may occur. The edge of the polyp is significantly different from the surrounding colon folds, showing a jagged texture change, and shadow blurring will occur at the backlit edge of the polyp.

[0089] Specifically, the colonoscopic image of the colon is acquired by an image acquisition device. For example, the above-mentioned image acquisition device can use an endoscopic camera to acquire the colon wall image, which is not specifically limited here. Since the acquisition and transmission processes will produce noise when acquiring the colon image, in order to improve the contrast of the lesion area in the colonoscopic image, the acquired colon wall image is preprocessed. In the embodiment of the present application, the image contrast is improved by wavelet transform. The image contrast enhancement technology under wavelet transform is essentially to decompose the image signal into different sub-bands through wavelet transform, and apply different algorithms to different sub-bands to enhance the image components in different frequency ranges, highlight the approximation and details at different scales, so as to achieve the purpose of enhancing the image layering. It is not specifically limited here, and the implementer may also use other methods.

[0090] In the embodiment of the present application, the preprocessed colonoscopy image is also converted into a grayscale image and a color image based on HSV. It should be noted that the HSV color space, also called the hexagonal cone color space, has three parameters, where H represents hue, S represents saturation, and V represents lightness. The RGB color space can be converted into the HSV color space through the HSV transformation, which will not be described in detail here.

[0091] In the above-mentioned embodiment steps, an endoscopic camera is used to collect colonoscopic images, and the acquired colonoscopic images are preprocessed, the preprocessed colonoscopic images are converted into grayscale images and HSV-based color images, a polyp growth coefficient is constructed based on the characteristics of colon polyps, and the polyp areas in the colonoscopic images are accurately divided based on the polyp growth coefficient. A simple and fast image segmentation algorithm is used to segment the colon image to speed up the calculation speed. At the same time, the colon normal index is determined according to the characteristics of the polyp lesions, and then the degree of polyp lesions in the polyp area is determined by the colon normal index. The polyp areas with lesions are accurately and quickly segmented, avoiding the impact of introducing benign polyps that reduce the accuracy and calculation speed of the algorithm, and realizing an intelligent recognition method for colonoscopic images based on machine vision.

[0092] It should be further explained that after the colonoscopy image after image enhancement is grayed to obtain a colon grayscale image, the grayscale image is subjected to edge detection processing using an edge detection algorithm to obtain an edge image containing the edge contour of the colon image, wherein the edge detection algorithm can use one of the edge detection algorithms of the Sobel operator and the Canny operator, which is not specifically limited here.

[0093] Furthermore, since the colon folds on the colon surface are usually in an intermittent half-moon shape to enhance the surface area of ​​the inner wall of the colon for better absorption of nutrients, the formation of polyps will cause the surface of the colon to bulge and block the original colon folds. Based on this feature, the polyp range can be found.

[0094] It should be further explained that in the above-mentioned embodiment steps, the edge contour of the colon image has been obtained, and the closed contour area in the image is determined based on the connectivity between the edge pixels through the contour tracking algorithm. The contour tracking algorithm is a commonly used technology in the field of image processing and computer vision. It can extract the edge contour of the body in the image, and analyze and process it to achieve the purpose. The basic principle of the contour tracking algorithm is based on the color, shape, texture and other features in the image. By analyzing the edge of the object, the contour of the object is obtained. The key step in this process is to find the pixels on the edge of the image and form the curve of the edge. Common contour tracking algorithms mainly include edge tracking algorithms and chain code algorithms, which will not be described in detail here. Specifically, in the embodiment of the present application, three types of closed contour areas will be generated in the colon image: one is the closed area formed by the intestinal wall because light cannot reach the deep part of the intestine. The edges are usually smooth and the interior of the area is a black hole; the second is due to the angle of the endoscope, the overlapping of colon folds to produce a closed area, and the interior of the area may be the color of the normal intestinal wall, and the edge shading is not obvious; the third is the closed area surrounded by the edges of the polyps. The backlit edges of the area have obvious shadow shading toward the deep part of the intestine, and the interior of the area shows different degrees of concavity and convexity due to the different degrees of lesions.

[0095] In an optional embodiment of the present application, based on the distance between the center point of the deep colon region and each pixel point on the closed contour of each suspected polyp region, the shading point corresponding to each suspected polyp region is determined, including:

[0096] The deep region of the colon is processed by the minimum circumscribed circle algorithm to obtain the center point of the circular region, wherein the center point of the circular region is used as the center point of the deep region of the colon;

[0097] The Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the regional center point of the deep colon area is calculated to obtain the Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the regional center point of the deep colon area, wherein the shortest Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the regional center point of the deep colon area is the smudge point corresponding to each suspected polyp area.

[0098] It should be noted that the grayscale mean inside the closed connected area is calculated separately, and the area with the smallest grayscale mean is the deep colon area, and the rest is the suspected polyp area. When the endoscope is used to collect colon images, the edge of the polyp far away from the endoscope will produce a shadow blooming phenomenon due to illumination. The greater the degree of colon lesions, the larger the growth diameter of the polyp, the more light sources are blocked, the greater the blooming degree at the backlit edge of the polyp, and it gradually increases towards the deep intestine. It can also be expressed as, the closer to the deep intestinal area, the more obvious the blooming degree, and the polyp growth coefficient can be constructed based on the blooming degree of the backlit edge of the polyp.

[0099] The minimum circumscribed circle algorithm is used to calculate the closed area deep in the intestine, and the center point of the circular area is obtained as the center pixel point of the deep intestinal area, recorded as Calculate the Euclidean distance from each pixel point on the closed contour of other suspected polyp areas to the center point of the deep intestinal area, and take the contour pixel point with the shortest distance. For the convenience of subsequent description, this contour point is called a shading point, see Figure 3 shown.

[0100] In an optional embodiment of the present application, determining the smudging end point corresponding to each suspected polyp region according to the grayscale gradient on the line connecting the smudging point corresponding to each suspected polyp region and the center point of the region in the deep colon region includes:

[0101] A sliding window is constructed based on the smudged points of each suspected polyp area, and the sliding window is slid on the line connecting the smudged points and the center point of the deep colon area, where the window size is 3*3 and the sliding step is 1;

[0102] Calculate the grayscale gradients of all central pixel points of the sliding window on the sliding route in the X and Y directions to obtain the grayscale gradients of all central pixel points of the sliding window in the X and Y directions;

[0103] According to the grayscale gradients of all the central pixels of the sliding window in the X and Y directions, the grayscale gradient of the central pixel corresponding to the sliding window is obtained, wherein the end point of the blending is the point with the largest gradient of the central pixels corresponding to other sliding windows except the blending point.

[0104] For details, see Figure 4 As shown, a sliding window is constructed with the smudge point as the center point, the window size is 3*3, the sliding step is 1, and the sliding window slides on the line connecting the smudge point and the center point of the deep intestinal area. The starting point is the smudge point, and the end point is the center point of the deep intestinal area.

[0105] It should be noted that since one side of the smudge point is the intestinal wall or polyp area, the grayscale value in the grayscale image is large, and the other side is the shadow occlusion area, the grayscale value in the grayscale image is small, therefore, the grayscale gradient value at the smudge point is large. After the window slides once, the pixel point enters the shadow area and the grayscale gradient becomes smaller; when the pixel window slides in the shadow area, the grayscale values ​​on both sides of the pixel point are not much different, and the grayscale gradient does not change much, but when the pixel window slides to the edge of the shadow, that is, the end point of the smudge point, the center point of the pixel window is the shadow area on one side and the intestinal wall area on the other side, the grayscale value difference is large, and the grayscale gradient is large. The pixel point where the grayscale gradient has a significant change for the first time after the smudge point is set as the smudge end point, which is essentially the point with the largest grayscale gradient of the remaining center points except the smudge point.

[0106] In an optional embodiment of the present application, the shading gradient corresponding to each suspected polyp area is determined according to the grayscale gradient on the path connecting the shading point to the shading end point, including: the calculation formula of the shading gradient is:

[0107] ;

[0108] in, It is a gradient. For the The gradient size of the central pixel corresponding to the sliding window; is the number of central pixels on the sliding path of the sliding window; , , Respectively represent the grayscale gradients of all central pixels on the sliding path of the sliding window in the X and Y directions.

[0109] Specifically, in the embodiment of the present application, the grayscale gradient of all central pixels on the sliding path in the X and Y directions is calculated by the Sobel operator. , , calculate the gradient size of the pixel point according to the grayscale gradient in the X and Y directions .

[0110] It should be noted that the end point of the shading is the point with the largest grayscale gradient of the remaining center points except the shading point. The longer the shading distance and range, the greater the degree of polyp shadowing and the larger the polyp growth diameter. The sum of the gradients of all center points on the path from the shading point to the end point of the shading is calculated and recorded as the shading gradient SG. In the shading gradient formula, The larger it is, the greater the degree of shadow blending at the edge of the suspected area, the deeper the degree of occlusion of the light source by the edge of the suspected area, and the larger the SG; conversely, the smaller the degree of shadow blending, the shallower the degree of occlusion of the light source by the edge of the suspected area, and the smaller the SG.

[0111] In an optional embodiment of the present application, the wrinkle density gradient is determined according to the distribution of intestinal wall wrinkles in the colonoscopy image, including: the calculation formula of the wrinkle density gradient is:

[0112] ;

[0113] in, is the number of edge contours that converge on the same pixel in the i-th window. When it is 0, it is recorded as 1. The window is a 5*5 pixel window constructed with each pixel as the center pixel on the path connecting the shading point to the shading end point. is the Euclidean distance between the pixels closest to the shading point on the wrinkle edge contour within each pixel window, It is the number of all pixels on the path from the blending point to the blending end point.

[0114] It should be noted that since a single grayscale gradient cannot accurately represent the degree of blurring of the backlit edge of the polyp area, due to factors such as the light source and the shooting position in the colonoscopy image, the intestinal wall folds in the colonoscopy image will appear similar to a phenomenon where they are larger when closer and smaller when farther away. The closer the intestinal wall folds are to the endoscope, the smaller the distribution density of the intestinal wall folds; conversely, the farther the intestinal wall folds are from the endoscope, the denser the distribution density of the intestinal wall folds. In the embodiment of the present application, a wrinkle density gradient can be constructed through the distribution of intestinal wall wrinkles.

[0115] Specifically, a 5*5 pixel window is constructed for each pixel point on the path from the blurring point to the blurring end point, and the number of edge contours in the pixel window that converge most at the same pixel point is counted. The degree of convergence of edge contours in the pixel window reflects the distribution density of intestinal wall folds. The number of edge contours that converge most at the same pixel point in the i-th window on the window sliding path starting from the blurring point is recorded as , When it is 0, it is recorded as 1. The larger it is, the more edge contours converge at the same pixel point in the window, the greater the distribution density of intestinal wall folds, the farther away from the endoscope, and the larger the fold convergence factor; conversely, the fewer edge contours converge at the same pixel point in the window, the smaller the distribution density of intestinal wall folds, the closer to the endoscope, and the smaller the fold convergence factor.

[0116] Furthermore, the pixel point closest to the shading point on the edge of the wrinkle in each pixel window is found, and the Euclidean distance between the shading point and the pixel point is calculated and recorded as Based on the above data, the wrinkle density gradient FDG can be calculated by the wrinkle density gradient calculation formula. From the wrinkle density gradient FDG calculation formula, it can be seen that the larger the sum of the products of the number of edge contours converging on the same pixel point in each pixel window on the smudging path and the pixel point closest to the smudging point on the wrinkle edge in each pixel window, the denser the wrinkle distribution in the pixel window, the farther the pixel window position is from the endoscope, and the larger the FDG wrinkle density gradient; conversely, the more discrete the wrinkle distribution in the pixel window, the closer the pixel window position is to the endoscope, and the smaller the FDG fold density gradient.

[0117] In an optional embodiment of the present application, based on the wrinkle density gradient and the blooming gradient, the blooming degree corresponding to each suspected polyp area is determined; according to the blooming degree corresponding to each suspected polyp area, the polyp growth coefficient corresponding to each suspected polyp area is determined, including: the calculation formula of the blooming degree is:

[0118] ;

[0119] in, It is a gradient. is the fold density gradient; the calculation formula of the polyp growth coefficient is:

[0120] ;

[0121] in, is the polyp growth coefficient; is the blending distance, which means the Euclidean distance from the blending point to the corresponding blending end point; For the degree of blurring.

[0122] It should be noted that the greater the sum of the blurring degree and the wrinkle density gradient, the greater the degree of shadow occlusion in the suspected area, the denser the distribution of intestinal wall wrinkles, and the larger the SI; conversely, the smaller the degree of shadow occlusion in the suspected area, the sparser the distribution of intestinal wall wrinkles, and the smaller the SI.

[0123] It should be further explained that, when the SD is larger, it means that the blurring distance of the edge of the suspected area is longer, the edge blocks the light source more, the edge of the area is more likely to be a polyp edge, the larger the polyp growth diameter, the larger the PGF. On the contrary, the edge of the area is more likely to be an intestinal fold, and the smaller the PGF; when the SI is larger, it means that the suspected area edge blocks the light source more deeply, the edge of the area is more likely to be a polyp edge, the larger the polyp growth diameter, the larger the PGF; on the contrary, the shallower the area edge blocks the light source, the more likely the area edge is an intestinal fold, and the smaller the PGF.

[0124] In an optional embodiment of the present application, determining the polyp region based on the polyp growth coefficient corresponding to each suspected polyp region includes:

[0125] The polyp growth coefficient is normalized to obtain a normalized polyp growth coefficient of the polyp growth coefficient;

[0126] The normalized polyp growth coefficient of the polyp growth coefficient is compared with a first preset threshold to determine the polyp area.

[0127] Specifically, the PGF polyp growth coefficient is normalized so that its value range is in the range of [0,1], and a threshold T is set. When it is higher than the threshold, the area surrounded by the edge contour of the blurred point is set as the polyp area, and the area surrounded by the edge of the blurred point below the threshold T is set as the wrinkle overlap area. In this application, the threshold T is 0.5. The normalization process can adopt maximum and minimum value normalization, exponential normalization, etc., which are not specifically limited here.

[0128] In an optional embodiment of the present application, the lesion density of each polyp region is obtained according to the distance between two corner points in each polyp region; the polyp color difference of each polyp region is determined according to the area of ​​each polyp region and the number of normal intestinal wall cell pixels in the corresponding polyp region, including: the calculation formula of the lesion density of the polyp region is:

[0129] ;

[0130] in, is the lesion density; is the number of corner points; is the number of lines connecting the corner points; is the Euclidean distance between two corner points, i.e., the lesion points; the calculation formula for the polyp color difference in the polyp area is:

[0131] ;

[0132] in, is the number of pixels in the polyp area, recorded as the polyp area, It is the number of pixels in the polyp area with a hue range below 30° in the HSV color space.

[0133] It should be noted that since most polyps are benign and usually do not cause symptoms or health problems, some types of polyps have the potential risk of malignant transformation and may cause cancer. The symptoms are that the surface of the polyp is uneven due to the lesions and may cause ulcers, erosions, etc. In the image, the pixels at the lesion are quite different from the surrounding pixels, and the color will deepen as the degree of lesions increases. The greater the degree of lesions in the polyp area, the denser the distribution of lesions, and the darker the color of the lesion area.

[0134] Specifically, in the embodiment of the present application, the corner points in the polyp region are obtained by the Harris corner point detection algorithm and recorded as , connect the obtained corner points two by two, and calculate the Euclidean distance between the two corner points (i=1,2,…,m), and the lesion density (MD) of the polyp area is obtained by the Euclidean distance between the corner points. For details, please refer to the above lesion density calculation formula. The larger the MD, the denser the distribution of lesion points in the polyp area, and the greater the degree of lesion; on the contrary, the smaller the MD, the more discrete the distribution of lesion points in the polyp area, and the smaller the degree of lesion.

[0135] At the same time, it is necessary to further explain that when the surface cells of the polyp are diseased, the color will change from light to dark, and the original color of the intestinal wall is mostly light red and white. The area of ​​the polyp region S is calculated by the connected domain area summation method, and the number of pixels in the closed area of ​​the polyp is calculated and recorded as the polyp area S. Because the original color of the intestinal wall is usually light red or red, the hue range of red in the HSV color space is between 0° and 30°. Then, the number of pixels with a hue below 30° in the polyp region is counted and recorded as P. The polyp color difference (PCD) is obtained according to the polyp region area and the number of normal intestinal wall cell pixels. From the polyp color difference calculation formula, it can be seen that the greater the difference between probability 1 and the ratio of normal intestinal wall cell pixels to polyp region area, the more pixels with darker colors in the polyp region, the greater the degree of lesions in the polyp region, and the larger the polyp color difference PCD; conversely, the more pixels with normal colors in the polyp region, the smaller the degree of lesions in the polyp region, and the smaller the polyp color difference PCD.

[0136] In an optional embodiment of the present application, the colon normal index of each polyp area is obtained according to the lesion density of each polyp area and the polyp color difference of the corresponding polyp area, including: the calculation formula of the colon normal index of the polyp area is:

[0137] ;

[0138] in, is the lesion density; Color difference for polyps.

[0139] It should be noted that the larger the product of MD and PCD, the denser the distribution of lesion points in the polyp area, the more lesion pixels, the greater the degree of lesion, the more likely the polyp area is to be a polyp lesion area, and the smaller the CAI; conversely, the smaller the product of MD and PCD, the more discrete the distribution of lesion points in the polyp area, the fewer lesion pixels, the smaller the degree of lesion, the more likely the polyp is to be a benign polyp, and the larger the CAI.

[0140] In an optional embodiment of the present application, determining the polyp lesion area in the colonoscopic image according to the colon normal index of each polyp area includes:

[0141] The colon normality index is normalized to obtain a normalized colon normality index of the colon normality index;

[0142] The normalized colon normal index of the colon normal index is compared with the second preset threshold value. When the normalized colon normal index of the colon normal index is greater than the second preset threshold value, the polyp area is judged to be a diseased polyp area; when the normalized colon normal index of the colon normal index is less than the second preset threshold value, the polyp area is judged to be a benign polyp area.

[0143] Specifically, the colon normal index CAI is normalized so that its value range is within the range of [0,1], and a threshold K is set to judge the normal condition of the polyp area. When it is higher than the threshold K, the polyp area is more likely to be a polyp lesion area, and when it is lower than the threshold K, the area is more likely to be a benign polyp area. The threshold used in this application is 0.7, and the normalization process can adopt maximum and minimum value normalization, index normalization, etc., which are not specifically limited here. The colonoscopy image is segmented by the above threshold to obtain the polyp lesion area in the image.

[0144] See also Figure 5 As shown, an embodiment of the present application discloses an electronic device 20, including a processor 21 and a memory 22; wherein the memory 22 is used to store a computer program; the processor 21 is used to implement the machine vision-based colonoscopy image intelligent recognition method provided by the aforementioned method embodiment by executing the computer program.

[0145] For the specific process of the above-mentioned colonoscopy image intelligent recognition method based on machine vision, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0146] Furthermore, the memory 22, as a carrier for storing resources, may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.

[0147] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26; wherein the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0148] Furthermore, the present application also discloses a computer-readable storage medium. Figure 6 As shown, it is used to store a computer program 31, wherein when the computer program is executed by the processor, the machine vision-based intelligent recognition method for colonoscopy images provided by the aforementioned method embodiment is implemented.

[0149] For the specific process of the above-mentioned colonoscopy image intelligent recognition method based on machine vision, reference can be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.

[0150] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0151] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0152] The above is a detailed introduction to the machine vision-based colonoscopy image intelligent recognition method, device and storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for intelligent recognition of colonoscopy images based on machine vision, characterized in that: include: Obtain the first colonoscopic image of the colon; Preprocessing the first colonoscopic image to obtain each closed contour region in the edge image corresponding to the first colonoscopic image; Based on the grayscale mean inside each closed contour area, the deep colon area and the suspected polyp area are determined, wherein the closed contour area with the smallest grayscale mean is the deep colon area, and the remaining closed contour areas are suspected polyp areas; Based on the deep colon area and the suspected polyp area, determining a smudge point and a smudge end point corresponding to each suspected polyp area; Determine the blooming gradient and the wrinkle density gradient corresponding to each suspected polyp region according to the connection line between the blooming point and the blooming end point; Determining a polyp region based on the wrinkle density gradient and the blooming gradient; Determine the lesion density and polyp color difference corresponding to each polyp region according to the corner points, area and number of normal intestinal wall cell pixels of each polyp region; Obtaining a colon normal index for each polyp region according to the lesion density and polyp color difference corresponding to each polyp region; Determining the polyp lesion area in the colonoscopic image according to the colon normal index of each polyp area; Based on the deep colon area and the suspected polyp area, determining a smudge point and a smudge end point corresponding to each suspected polyp area includes: The deep region of the colon is processed by a minimum circumscribed circle algorithm to obtain a center point of a circular region, wherein the center point of the circular region is used as a center point of the deep region of the colon; The Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the center point of the area in the deep colon is calculated to obtain the Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the center point of the area in the deep colon, wherein the shortest Euclidean distance from each pixel point on the closed contour of each suspected polyp area to the center point of the area in the deep colon is the smudge point corresponding to each suspected polyp area; Constructing a sliding window according to the smudged points of each suspected polyp area, so that the sliding window slides on the line connecting the smudged points and the center point of the deep colon area, wherein the window size is 3*3 and the sliding step is 1; Calculating the grayscale gradients of all central pixel points of the sliding window on the sliding route in the X and Y directions to obtain the grayscale gradients of all central pixel points of the sliding window in the X and Y directions; According to the grayscale gradients of all the central pixels of the sliding window in the X and Y directions, the grayscale gradient of the central pixel corresponding to the sliding window is obtained, wherein the end point of the shading is the point where the gradient of the central pixels corresponding to other sliding windows except the shading point is the largest; Determining a polyp region based on the wrinkle density gradient and the blooming gradient includes: Determining the blooming degree corresponding to each of the suspected polyp regions based on the wrinkle density gradient and the blooming gradient; Determining a polyp growth coefficient corresponding to each suspected polyp area according to the blurring degree corresponding to each suspected polyp area; Determining a polyp region based on a polyp growth coefficient corresponding to each of the suspected polyp regions; The calculation formula of the blurring degree is: in, It is a gradient. is the wrinkle density gradient; the calculation formula of the polyp growth coefficient is: in, is the polyp growth coefficient; is the blending distance, which means the Euclidean distance from the blending point to the corresponding blending end point; is the degree of blurring; Determining the polyp region based on the polyp growth coefficient corresponding to each of the suspected polyp regions includes: Normalizing the polyp growth coefficient to obtain a normalized polyp growth coefficient of the polyp growth coefficient; The normalized polyp growth coefficient of the polyp growth coefficient is compared with a first preset threshold to determine a polyp area.

2. The method for intelligent recognition of colonoscopy images based on machine vision according to claim 1, characterized in that: Preprocessing the first colonoscopic image to obtain each closed contour region in the edge image corresponding to the first colonoscopic image includes: Preprocessing the first colonoscopy image using a wavelet transform image contrast enhancement algorithm to obtain a second colonoscopy image; Performing grayscale processing and HSV transformation processing on the second colonoscopy image to obtain a grayscale image and an HSV color image corresponding to the second colonoscopy image; Performing edge detection processing on the grayscale image using an edge detection algorithm to obtain an edge image; The edge image is subjected to a regional contour tracking process by using a contour tracking algorithm to determine each closed contour region in the edge image.

3. The method for intelligent recognition of colonoscopy images based on machine vision according to claim 1, characterized in that: Determining the smudging gradient and the wrinkle density gradient corresponding to each suspected polyp region according to the connecting line between the smudging point and the smudging end point includes: According to the grayscale gradient on the line path from the smudging point to the smudging end point, the smudging gradient corresponding to each suspected polyp area is determined, wherein the calculation formula of the smudging gradient is: in, It is a gradient. For the The gradient size of the central pixel corresponding to the sliding window; is the number of central pixels on the sliding path of the sliding window; , , Respectively represent the grayscale gradients of all central pixels on the sliding path of the sliding window in the X and Y directions; According to the distribution of intestinal wall wrinkles in the colonoscopy image, the wrinkle density gradient is determined, wherein the calculation formula of the wrinkle density gradient is: in, is the number of edge contours that converge on the same pixel in the i-th window. When it is 0, it is recorded as 1. The window is a 5*5 pixel window constructed with each pixel as the center pixel on the path connecting the shading point to the shading end point. is the Euclidean distance between the pixels closest to the shading point on the wrinkle edge contour within each pixel window, It is the number of all pixels on the path from the blending point to the blending end point.

4. The method for intelligent recognition of colonoscopy images based on machine vision according to claim 1, characterized in that: Determining the lesion density and polyp color difference corresponding to each polyp region according to the corner points, area and number of normal intestinal wall cell pixels of each polyp region includes: Performing corner point detection on each polyp region using a corner point detection algorithm to obtain corner points in each polyp region; According to the distance between the two corner points in each polyp area, the lesion density of each polyp area is obtained; wherein the calculation formula of the lesion density of the polyp area is: in, is the lesion density; is the number of corner points; is the number of lines connecting the corner points; is the Euclidean distance between two corner points, i.e., the lesion points; According to the area of ​​each polyp region and the number of normal intestinal wall cell pixels in the corresponding polyp region, the polyp color difference of each polyp region is determined; wherein the calculation formula of the polyp color difference of the polyp region is: in, is the number of pixels in the polyp area, recorded as the polyp area, It is the number of pixels in the polyp area with a hue range below 30° in the HSV color space.

5. The method for intelligent recognition of colonoscopy images based on machine vision according to any one of claims 1 or 4, characterized in that: According to the lesion density and polyp color difference corresponding to each polyp area, a colon normal index of each polyp area is obtained, including: the calculation formula of the colon normal index of the polyp area is: in, is the lesion density; Color difference for polyps.

6. The method for intelligent recognition of colonoscopy images based on machine vision according to claim 1, characterized in that: Determining the polyp lesion area in the colonoscopic image according to the colon normal index of each polyp area includes: Normalizing the normal colon index to obtain a normalized normal colon index of the normal colon index; The normalized colon normal index of the colon normal index is compared with a second preset threshold value. When the normalized colon normal index of the colon normal index is greater than the second preset threshold value, the polyp area is judged to be a diseased polyp area; when the normalized colon normal index of the colon normal index is less than the second preset threshold value, the polyp area is judged to be a benign polyp area.