CN115063398A - Method and device for processing electronic digestive tract endoscope image and electronic equipment - Google Patents
Method and device for processing electronic digestive tract endoscope image and electronic equipment Download PDFInfo
- Publication number
- CN115063398A CN115063398A CN202210836269.8A CN202210836269A CN115063398A CN 115063398 A CN115063398 A CN 115063398A CN 202210836269 A CN202210836269 A CN 202210836269A CN 115063398 A CN115063398 A CN 115063398A
- Authority
- CN
- China
- Prior art keywords
- image
- color channel
- histogram
- gray
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012545 processing Methods 0.000 title claims abstract description 109
- 238000000034 method Methods 0.000 title claims abstract description 47
- 210000001035 gastrointestinal tract Anatomy 0.000 title claims abstract description 27
- 238000005192 partition Methods 0.000 claims description 24
- 230000006870 function Effects 0.000 claims description 20
- 238000013507 mapping Methods 0.000 claims description 18
- 230000011218 segmentation Effects 0.000 claims description 17
- 238000005520 cutting process Methods 0.000 claims description 16
- 238000009826 distribution Methods 0.000 claims description 10
- 238000006243 chemical reaction Methods 0.000 claims description 9
- 238000001514 detection method Methods 0.000 claims description 8
- 230000009467 reduction Effects 0.000 claims description 8
- 230000003993 interaction Effects 0.000 claims description 7
- 238000003860 storage Methods 0.000 claims description 6
- 230000002708 enhancing effect Effects 0.000 claims description 5
- 210000004204 blood vessel Anatomy 0.000 abstract description 24
- 230000002496 gastric effect Effects 0.000 description 21
- 230000008569 process Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 9
- 238000003672 processing method Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 238000003384 imaging method Methods 0.000 description 4
- 230000002452 interceptive effect Effects 0.000 description 4
- 230000003044 adaptive effect Effects 0.000 description 3
- 230000003321 amplification Effects 0.000 description 3
- 239000003086 colorant Substances 0.000 description 3
- 238000003199 nucleic acid amplification method Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000003708 edge detection Methods 0.000 description 2
- 230000002349 favourable effect Effects 0.000 description 2
- 210000003462 vein Anatomy 0.000 description 2
- 241000023320 Luma <angiosperm> Species 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 239000008280 blood Substances 0.000 description 1
- 238000000701 chemical imaging Methods 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000005315 distribution function Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- OSWPMRLSEDHDFF-UHFFFAOYSA-N methyl salicylate Chemical compound COC(=O)C1=CC=CC=C1O OSWPMRLSEDHDFF-UHFFFAOYSA-N 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0012—Biomedical image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10068—Endoscopic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30004—Biomedical image processing
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
- Radiology & Medical Imaging (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
Abstract
The invention provides a method and a device for processing an electronic digestive tract endoscope image and electronic equipment, wherein the method comprises the following steps: converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image; splitting the first RGB image to obtain three single-color channel images, wherein the three single-color channel images comprise: an R channel image, a G channel image, and a B channel image; processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images; merging the processed three single-color channel images to obtain a second RGB image; and converting the second RGB image into a second YUV image. The invention has good pertinence to the blood vessel display and meets the use requirement of a user for efficiently identifying the blood vessel according to the endoscope image.
Description
Technical Field
The embodiment of the invention relates to the technical field of electronic gastrointestinal endoscope imaging, in particular to a method and a device for processing an electronic gastrointestinal endoscope image and electronic equipment.
Background
Currently, in order to improve the efficiency of identifying various objects in an electronic gastrointestinal endoscope image, especially the efficiency of identifying blood vessels in the endoscope image, the contrast of the electronic gastrointestinal endoscope image is often required to be enhanced, and the methods mainly adopted are as follows:
1) the contrast enhancement method based on histogram equalization adjusts the gray level histogram of the image to be approximately uniformly distributed, increases the dynamic range of pixel gray level difference, and thus enhances the contrast of blood vessels;
2) selecting a wavelength combination favorable for observing a blood vessel to enhance the contrast between the blood vessel and a tissue based on a FICE (Flexible Spectral Imaging color Enhancement) technology of Spectral estimation; based on the edge detection method, distinguishing the blood vessels by using an edge detection operator and enhancing the strength and tone of the blood vessels;
3) the method based on deep learning uses a large amount of data sets to learn the mapping relation between an original image and a target image so as to obtain an image after blood vessel enhancement.
However, the above method has poor pertinence to blood vessel imaging, and is particularly easy to excessively enhance the contrast of tissues around blood vessels, so that the identification of blood vessel images by a user is difficult; the resolution of the electronic digestive tract endoscope image processed by the method is low, and the use requirement of a user for efficiently identifying blood vessels according to the endoscope image is difficult to meet, particularly identifying micro blood vessels and vein blood vessels.
Disclosure of Invention
The embodiment of the invention provides a method and a device for processing an electronic gastrointestinal endoscope image and electronic equipment, and aims to solve the problems that the existing method for processing the electronic gastrointestinal endoscope image is poor in pertinence to blood vessel display and difficult to meet the use requirement of a user for efficiently identifying blood vessels according to the endoscope image.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for processing an electronic endoscope image of an alimentary tract, including:
converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image;
splitting the first RGB image to obtain three single-color channel images, wherein the three single-color channel images comprise: an R channel image, a G channel image, and a B channel image;
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images;
merging the processed three single-color channel images to obtain a second RGB image;
and converting the second RGB image into a second YUV image.
Or,
converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image, comprising:
performing noise reduction processing on the first YUV image, wherein the noise reduction processing is used for reducing at least one of the following noises: luminance noise, color noise.
Alternatively,
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
calculating to obtain gray distribution data of each single-color channel image according to each single-color channel image, and sending the gray distribution data to an interaction terminal associated with a user;
receiving a gray level histogram limiting value sent by the interactive end, wherein the limiting value corresponds to the single-color channel image;
processing the three single-color channel images respectively by adopting a histogram equalization algorithm according to the gray level histogram limit value to obtain three processed single-color channel images;
or,
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
acquiring a preset gray level histogram limit value;
and processing the three single-color channel images respectively by adopting a histogram equalization algorithm according to the gray level histogram limit value to obtain the processed three single-color channel images.
Optionally, the processing the three single-color channel images by using a histogram equalization algorithm to obtain the processed three single-color channel images includes:
segmenting each single-color channel image according to a preset segmentation rule to obtain a plurality of image blocks corresponding to the single-color channel images;
acquiring a gray level histogram limit value corresponding to the single-color channel image;
calculating to obtain a gray histogram of each image block of the single-color channel image, and cutting the gray histogram of each image block of the single-color channel image according to a gray histogram limit value corresponding to the single-color channel image to obtain a cut gray histogram of each image block;
obtaining a gray mapping function of each sub-image according to the gray histogram of each cut image block;
for each image block, interpolating a gray mapping function of an adjacent image block of the image block by adopting an interpolation algorithm to obtain a target gray value of each image block;
enhancing the contrast of the image blocks corresponding to the target gray value according to the target gray value to obtain the processed image blocks; and combining the processed image blocks according to the preset segmentation rule to obtain the processed three single-color channel images.
Alternatively,
according to the gray histogram limit value corresponding to the single-color channel image, the gray histogram of each image block of the single-color channel image is cut to obtain the cut gray histogram of each image block, and the method comprises the following steps:
a cutting step: detecting each gray level in a gray level histogram of the image block, and cutting the histogram statistic value corresponding to the gray level aiming at the gray level of which the corresponding histogram statistic value exceeds the gray level histogram limit value as a detection result, so that the cut histogram statistic value does not exceed the gray level histogram limit value;
averagely distributing the cut histogram statistic to other gray levels with the detection result that the corresponding histogram statistic does not exceed the gray level histogram limit value; and executing the cutting step until each gray level in the gray level histogram of the image block does not exceed the limit value of the gray level histogram, so as to obtain the cut gray level histogram of the image block.
Optionally, the interpolation algorithm is a bilinear difference algorithm.
In a second aspect, an embodiment of the present invention provides an apparatus for processing an electronic endoscope image of an alimentary tract, including:
the conversion module is used for converting the first YUV image acquired by the electronic digestive tract endoscope into a first RGB image;
a splitting module, configured to split the first RGB image to obtain three single-color channel images, where the three single-color channel images include: an R channel image, a G channel image, and a B channel image;
the processing module is used for respectively processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images;
the merging module is used for merging the processed three single-color channel images to obtain a second RGB image;
the conversion module is further configured to convert the second RGB image into a second YUV image.
Alternatively,
the processing module is further configured to segment each single-color channel image according to a preset segmentation rule to obtain a plurality of image blocks corresponding to the single-color channel image;
the processing module is further configured to obtain a gray level histogram limit value corresponding to the single-color channel image;
the processing module is further configured to calculate a gray histogram of each image partition of the single-color channel image, and cut the gray histogram of each image partition of the single-color channel image according to a gray histogram limit value corresponding to the single-color channel image, so as to obtain a cut gray histogram of each image partition;
the processing module is further used for obtaining a gray mapping function of each sub-image according to the cut gray histogram of each image block;
the processing module is further configured to interpolate, for each image partition, a gray mapping function of an image partition adjacent to the image partition by using an interpolation algorithm to obtain a target gray value of each image partition;
the processing module is further used for enhancing the contrast of the image blocks corresponding to the target gray value according to the target gray value to obtain processed image blocks; and combining the processed image blocks according to the preset segmentation rule to obtain the processed three single-color channel images.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a memory, and a program or instructions stored on the memory and executable on the processor, where the program or instructions, when executed by the processor, implement the steps in the method for processing an electronic gastrointestinal endoscope image according to any one of the first aspect.
In a fourth aspect, the present invention provides a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps in the method for processing an electronic gastrointestinal endoscope image according to any one of the first aspect.
In the embodiment of the invention, a first YUV image collected by an electronic digestive tract endoscope is converted into a first RGB image; the first RGB image is split, and the three single-color channel images are processed by adopting a histogram equalization algorithm, so that the interference of the other color channels in the process of processing one color channel image can be avoided, the problem of excessive contrast enhancement of tissues around blood vessels caused by direct processing of an undisassembled endoscope image is further avoided, and the pertinence of blood vessel imaging is favorably improved; in the embodiment of the invention, after the processed three single-color channel images are obtained, the processed three single-color channel images are combined, so that the image processing effect is further improved, the processed endoscope image has high contrast and high definition, and the use requirements of a user on efficiently identifying blood vessels according to the endoscope image, particularly on identifying micro blood vessels and vein blood vessels, can be met.
Drawings
Various additional advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flowchart illustrating a method for processing an electronic gastrointestinal endoscope image according to an embodiment of the present invention;
FIG. 2 is a second flowchart illustrating a method for processing an electronic gastrointestinal endoscope image according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a principle of a bilinear interpolation algorithm in the method for processing an electronic gastrointestinal endoscope image according to an embodiment of the present invention;
FIG. 4 is a third flowchart illustrating a method for processing an electronic gastrointestinal endoscope image according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the principle of cropping a gray level histogram of each image patch of a single color channel image;
FIG. 6 is a schematic diagram of a device for processing an electronic digestive tract endoscope image according to an embodiment of the present invention;
fig. 7 is a functional block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
An embodiment of the present invention provides a method for processing an electronic gastrointestinal endoscope image, and as shown in fig. 1, fig. 1 is one of flow diagrams of the method for processing the electronic gastrointestinal endoscope image according to the embodiment of the present invention, including:
step 11: converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image;
step 12: splitting the first RGB image to obtain three single-color channel images, wherein the three single-color channel images comprise: an R channel image, a G channel image, and a B channel image;
step 13: processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images;
step 14: merging the processed three single-color channel images to obtain a second RGB image;
step 15: and converting the second RGB image into a second YUV image.
YUV, a color coding method. Often in individual video processing components. YUV allows for reduced bandwidth of chrominance in view of human perception when encoding photos or videos.
YUV is a kind of color space (colorspace) of compiled true-color, and the proper terms of Y' UV, YUV, YCbCr, YPbPr, etc. may be called YUV, overlapping each other. "Y" represents brightness (Luma) or gray scale value, and "U" and "V" represent Chroma (Chroma or Chroma) and are used to describe the color and saturation of the image for specifying the color of the pixel.
The RGB color scheme is a color standard in the industry, and various colors are obtained by changing three color channels of red (R), green (G) and blue (B) and superimposing the three color channels on each other, where RGB represents colors of the three channels of red, green and blue, and the color standard almost includes all colors that can be perceived by human vision, and is one of the most widely used color systems.
In some embodiments of the present invention, optionally, in step 11, a conversion formula for converting the first YUV image into the first RGB image is:
R=Y+1.403×(V-128);
G=Y-0.343×(U-128)-0.714×(V-128);
B=Y+1.77×(U-128)。
in some embodiments of the present invention, optionally, in step 15, the conversion formula for converting the second RGB image into the second YUV image is:
Y=0.299×R+0.587×G+0.114×B;
U=-0.169×R-0.331×G+0.5×B+128;
V=0.5×R-0.419×G-0.081×B+128。
in the embodiment of the invention, a first YUV image collected by an electronic digestive tract endoscope is converted into a first RGB image; the first RGB image is split, and the three single-color channel images are processed by adopting a histogram equalization algorithm, so that the interference of the other color channels in the process of processing one color channel image can be avoided, the problem of excessive contrast enhancement of tissues around blood vessels caused by direct processing of an undisassembled endoscope image is further avoided, and the pertinence of blood vessel imaging is favorably improved; in the embodiment of the invention, after the processed three single-color channel images are obtained, the processed three single-color channel images are combined, which is favorable for further improving the image processing effect, so that the processed endoscope image has high contrast and high definition, and can meet the use requirement of a user for efficiently identifying blood vessels according to the endoscope image, especially identifying micro-blood vessels and venous blood vessels.
In some embodiments of the present invention, optionally, converting the first YUV image acquired by the electronic digestive tract endoscope into the first RGB image previously comprises:
performing noise reduction processing on the first YUV image, wherein the noise reduction processing is used for reducing at least one of the following noises: luminance noise, color noise.
The image sensor may have a problem of brightness noise and/or color noise due to a series of reasons, such as its own properties (e.g., cmos photosensitive elements have a characteristic of high noise), the sensor manufacturing process, and the light entering condition. In the embodiment of the invention, before the first YUV image is converted into the first RGB image, the first YUV image is subjected to noise reduction processing, so that the image quality of the first RGB image after format conversion is favorably improved, and the processing efficiency and the processing effect are favorably improved in the subsequent process of respectively processing the three single-color channel images by adopting a histogram equalization algorithm.
The noise reduction processing methods for brightness noise and/or color noise are various and cannot be exhaustive; moreover, the specific denoising processing method is not the protection point of the present invention, and therefore, is not described herein again. It is understood that the first YUV image with reduced luminance noise and/or color noise should be considered to be included in the scope of the embodiments of the present invention.
In some embodiments of the present invention, optionally, the processing the three single-color channel images by using a histogram equalization algorithm to obtain the processed three single-color channel images includes:
calculating to obtain gray distribution data of each single-color channel image according to each single-color channel image, and sending the gray distribution data to an interaction terminal associated with a user;
receiving a gray level histogram limiting value sent by the interaction terminal, wherein the limiting value corresponds to the single-color channel image;
processing the three single-color channel images respectively by adopting a histogram equalization algorithm according to the gray level histogram limit value to obtain three processed single-color channel images;
or,
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
acquiring a preset gray level histogram limit value;
and processing the three single-color channel images respectively by adopting a histogram equalization algorithm according to the gray level histogram limit value to obtain the processed three single-color channel images.
In the embodiment of the present invention, the gray level distribution data is sent to the interactive end associated with the user, so that the user can set the gray level histogram limit value with reference to the gray level distribution data, and then the user sends the set gray level histogram limit value to the execution main body of the embodiment of the present invention through the interactive end. The execution main body receives the gray histogram limiting value sent by the interaction end, and respectively processes the three single-color channel images by adopting a histogram equalization algorithm according to the gray histogram limiting value to obtain the processed three single-color channel images.
In the embodiment of the invention, the gray histogram limit value is a preset value, the preset gray histogram limit value is obtained when the three single-color channel images are respectively processed by adopting a histogram equalization algorithm, and the three single-color channel images are respectively processed by adopting the histogram equalization algorithm according to the gray histogram limit value to obtain the processed three single-color channel images.
In some embodiments of the present invention, optionally, referring to fig. 2, fig. 2 is a second flowchart of a processing method of an electronic gastrointestinal endoscope image according to an embodiment of the present invention, and the processing method of the electronic gastrointestinal endoscope image respectively processes three single-color channel images by using a histogram equalization algorithm to obtain processed three single-color channel images, including:
step 21: segmenting each single-color channel image according to a preset segmentation rule to obtain a plurality of image blocks corresponding to the single-color channel images;
step 22: acquiring a gray histogram limit value corresponding to a single-color channel image;
step 23: calculating to obtain a gray histogram of each image block of the single-color channel image, and cutting the gray histogram of each image block of the single-color channel image according to a gray histogram limit value corresponding to the single-color channel image to obtain a cut gray histogram of each image block;
step 24: obtaining a gray mapping function of each sub-image according to the gray histogram of each cut image block;
step 25: for each image block, interpolating a gray mapping function of the adjacent image blocks of the image block by adopting an interpolation algorithm to obtain a target gray value of each image block;
step 26: enhancing the contrast of the image blocks corresponding to the target gray value according to the target gray value to obtain the processed image blocks; and combining the processed image blocks according to a preset segmentation rule to obtain the processed three single-color channel images.
Illustratively, each single color channel image is grid sliced (8 × 8 grid density, each cell is an image patch); in addition, the three single-channel images are all segmented according to the same preset segmentation rule, so that the number and the positions of image blocks in the three single-channel images correspond to one another.
In some embodiments of the present invention, optionally, the three single-channel images may be segmented according to the same preset segmentation rule, or the three single-channel images may not be segmented according to the same preset segmentation rule.
In some embodiments of the present invention, the image blocks may be squares, rectangles, circles, and other geometric figures, optionally according to specific preset segmentation rules.
In some embodiments of the present invention, optionally, according to a specific preset segmentation rule, image blocks in the same single-channel image may be regularly and sequentially arranged or may be randomly arranged; each image block may or may not have the same area.
In the embodiment of the present invention, the formula of the gray mapping function is:
wherein: r is the gray level (0-255), h (r) is the histogram of the current gray level r, and N is the total number of pixels in the tile.
In some embodiments of the present invention, optionally, the interpolation algorithm adopted in step 25 may be a bilinear interpolation algorithm, that is: and aiming at each image block, interpolating the gray mapping functions of the adjacent image blocks of the image block by adopting a bilinear interpolation algorithm to obtain the target gray value of each image block.
Bilinear interpolation, also known as bilinear interpolation. Mathematically, bilinear interpolation is linear interpolation extension of an interpolation function with two variables, and the core idea is to perform linear interpolation in two directions respectively. Bilinear interpolation is used as an interpolation algorithm in numerical analysis and is widely applied to the aspects of signal processing, digital image and video processing and the like.
Referring to fig. 3, fig. 3 is a schematic diagram of a principle of a bilinear interpolation algorithm in the processing method of the electronic gastrointestinal endoscope image according to the embodiment of the present invention, where the formula of the bilinear interpolation algorithm is:
UL, UR, BL and BR are gray mapping functions of four small blocks around the pixel point, and the gray mapping function of each small block is defined to be in the center position. d1, d2, d3 and d4 are distances from the pixel point to each gray mapping function. I is the original gray scale value of the pixel point, and I is the new gray scale value of the pixel point. And traversing all the pixel points of the original R, G, B according to the formula to obtain a R, G, B three-channel image with enhanced contrast.
In some embodiments of the present invention, optionally, referring to fig. 4, fig. 4 is a third flowchart of a processing method of an electronic gastrointestinal endoscope image according to an embodiment of the present invention, where the method for cropping a gray histogram of each image partition of a single-color channel image according to a gray histogram limit value corresponding to the single-color channel image to obtain a gray histogram of each image partition after the cropping includes:
step 31: a cutting step: detecting each gray level in a gray level histogram of image blocks, and cutting the histogram statistic value corresponding to the gray level aiming at the gray level of which the corresponding histogram statistic value exceeds the limit value of the gray level histogram as a detection result so as to ensure that the cut histogram statistic value does not exceed the limit value of the gray level histogram;
step 32: averagely distributing the cut histogram statistic values to other gray levels with the detection results that the corresponding histogram statistic values do not exceed the gray level histogram limit values; and executing the cutting step until all the gray levels in the gray level histogram of the image block do not exceed the limit value of the gray level histogram, so as to obtain the gray level histogram of the cut image block.
Illustratively, referring to fig. 5, fig. 5 is a schematic diagram illustrating cropping of a gray level histogram for each image patch of a single color channel image. The R, G, B images are respectively set with gray histogram limit values: clinit _ R, Climit _ G and clinit _ B (the three values may be preferred depending on the image). R, G, B each histogram of 64 small blocks in the image has its corresponding limit value Climit _ R, Climit _ G, Climit _ B as the clipping amount of the histogram. And if a certain gray level in the small block histogram exceeds the limit value Climit, performing histogram clipping on the gray level, and counting the total amount of pixels clipped by all the gray levels in the small block. And uniformly distributing the total amount obtained by cutting to other uncut gray levels of the histogram of the small blocks to obtain a new gray level histogram of each small block. And repeating the clipping step on each obtained new histogram of each small block until the new histogram of each small block does not exceed the corresponding limit value Climit, and obtaining a final new histogram (relative to the gray level histogram of the clipped image blocks in the embodiment of the invention) by each small block.
In some embodiments of the present invention, optionally, the histogram equalization algorithm is a constrained contrast adaptive histogram equalization CLAHE algorithm.
Ordinary adaptive histogram equalization AHE tends to amplify the contrast in near-constant regions of an image because of the high concentration of histograms in such regions. As a result, AHE may cause noise to be amplified in a near-constant region. Contrast limited ahe (clahe) is a variant of adaptive histogram equalization in which the contrast amplification is limited, thereby reducing this noise amplification problem.
In CLAHE, the contrast amplification around a given pixel value is given by the slope of the transform function. This is proportional to the slope of the neighborhood Cumulative Distribution Function (CDF) and hence to the value of the histogram at that pixel value. CLAHE limits the magnification by clipping the histogram to a predetermined value before calculating the CDF. This limits the slope of the CDF and thus the slope of the transfer function. The value at which the histogram is clipped, the so-called clipping limit, depends on the normalization of the histogram and therefore on the size of the neighborhood. A common value limits the resulting magnification to between 3 and 4. Advantageously, the portion of the histogram that exceeds the clipping limit is not discarded, but rather it is distributed evenly across all histogram blocks.
An embodiment of the present invention provides a processing apparatus for an electronic endoscope image of an alimentary tract, and referring to fig. 6, fig. 6 is a schematic diagram illustrating a principle of the processing apparatus for an electronic endoscope image of an alimentary tract according to an embodiment of the present invention, and the processing apparatus 70 for an electronic endoscope image of an alimentary tract includes:
the conversion module 71 is configured to convert the first YUV image acquired by the electronic digestive tract endoscope into a first RGB image;
a splitting module 72, configured to split the first RGB image to obtain three single-color channel images, where the three single-color channel images include: an R channel image, a G channel image, and a B channel image;
the processing module 73 is configured to process the three single-color channel images by using a histogram equalization algorithm, respectively, to obtain processed three single-color channel images;
a merging module 74, configured to merge the processed three single-color channel images to obtain a second RGB image;
the conversion module 71 is further configured to convert the second RGB image into a second YUV image.
In some embodiments of the present invention, optionally, the processing device 70 for electronic digestive tract endoscope images further comprises:
a denoising module 75, configured to perform denoising processing on the first YUV image, where the denoising processing is used to reduce at least one of the following noises: luminance noise, color noise.
In some embodiments of the present invention, the first and second electrodes are, optionally,
the processing module 73 is further configured to calculate, according to each single-color channel image, gray scale distribution data of each single-color channel image, and send the gray scale distribution data to an interaction end associated with a user;
the processing module 73 is further configured to receive a grayscale histogram limit value sent by the interactive end, where the limit value corresponds to the single-color channel image;
the processing module 73 is further configured to process the three single-color channel images by using a histogram equalization algorithm according to the grayscale histogram limit value, so as to obtain processed three single-color channel images;
in some embodiments of the invention, the first and second electrodes may, optionally,
the processing module 73 is further configured to obtain a preset limit value of the grayscale histogram;
the processing module 73 is further configured to process the three single-color channel images by using a histogram equalization algorithm according to the grayscale histogram limit value, so as to obtain processed three single-color channel images.
In some embodiments of the present invention, the first and second electrodes are, optionally,
the processing module 73 is further configured to segment each single-color channel image according to a preset segmentation rule to obtain a plurality of image blocks corresponding to the single-color channel image;
the processing module 73 is further configured to obtain a grayscale histogram limit value corresponding to the single-color channel image;
the processing module 73 is further configured to calculate a gray histogram of each image partition of the single-color channel image, and cut the gray histogram of each image partition of the single-color channel image according to a gray histogram limit value corresponding to the single-color channel image to obtain a cut gray histogram of each image partition;
the processing module 73 is further configured to obtain a gray scale mapping function of each sub-image according to the cut gray scale histogram of each image partition;
the processing module 73 is further configured to interpolate, for each image partition, a gray mapping function of an image partition adjacent to the image partition by using an interpolation algorithm to obtain a target gray value of each image partition;
the processing module 73 is further configured to enhance the contrast of the image partition corresponding to the target gray value according to the target gray value, so as to obtain a processed image partition; and combining the processed image blocks according to the preset segmentation rule to obtain the processed three single-color channel images.
In some embodiments of the present invention, the first and second electrodes are, optionally,
the processing module 73 is also used for the cutting step: detecting each gray level in a gray level histogram of the image block, and cutting the histogram statistic value corresponding to the gray level aiming at the gray level of which the corresponding histogram statistic value exceeds the gray level histogram limit value as a detection result, so that the cut histogram statistic value does not exceed the gray level histogram limit value;
the processing module 73 is further configured to averagely allocate the clipped histogram statistic to other gray levels whose detection results indicate that the corresponding histogram statistic does not exceed the gray histogram limit value; and executing the cutting step until each gray level in the gray level histogram of the image block does not exceed the limit value of the gray level histogram, so as to obtain the cut gray level histogram of the image block.
The processing device for the electronic gastrointestinal endoscope image provided by the embodiment of the application can realize each process realized by the method embodiments of fig. 1 to 5, and achieve the same technical effect, and is not described herein again to avoid repetition.
An electronic device 80 is provided in an embodiment of the present invention, and referring to fig. 7, fig. 7 is a schematic block diagram of the electronic device 80 in an embodiment of the present invention, and includes a processor 81, a memory 82, and a program or instructions stored on the memory 82 and executable on the processor 81, where the program or instructions implement steps in any method for processing an electronic gastrointestinal endoscope image in accordance with the present invention when executed by the processor.
The embodiment of the invention provides a readable storage medium, wherein a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, each process of the embodiment of the method for processing the electronic gastrointestinal endoscope image can be realized, and the same technical effect can be achieved.
The readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
1. A method for processing an electronic digestive tract endoscope image, comprising:
converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image;
splitting the first RGB image to obtain three single-color channel images, wherein the three single-color channel images comprise: an R channel image, a G channel image, and a B channel image;
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images;
merging the processed three single-color channel images to obtain a second RGB image;
and converting the second RGB image into a second YUV image.
2. The method for processing an electronic digestive tract endoscope image according to claim 1, characterized in that:
converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image, comprising:
performing noise reduction processing on the first YUV image, wherein the noise reduction processing is used for reducing at least one of the following noises: luminance noise, color noise.
3. The method for processing an electronic digestive tract endoscope image according to claim 1, characterized in that:
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
calculating to obtain gray distribution data of each single-color channel image according to each single-color channel image, and sending the gray distribution data to an interaction terminal associated with a user;
receiving a gray level histogram limiting value sent by the interaction terminal, wherein the limiting value corresponds to the single-color channel image;
processing the three single-color channel images respectively by adopting a histogram equalization algorithm according to the gray level histogram limit value to obtain three processed single-color channel images;
or,
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
acquiring a preset gray level histogram limit value;
and processing the three single-color channel images respectively by adopting a histogram equalization algorithm according to the gray level histogram limit value to obtain the processed three single-color channel images.
4. The method for processing an electronic digestive tract endoscope image according to claim 1, characterized in that:
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
segmenting each single-color channel image according to a preset segmentation rule to obtain a plurality of image blocks corresponding to the single-color channel images;
acquiring a gray level histogram limit value corresponding to the single-color channel image;
calculating to obtain a gray histogram of each image block of the single-color channel image, and cutting the gray histogram of each image block of the single-color channel image according to a gray histogram limit value corresponding to the single-color channel image to obtain a cut gray histogram of each image block;
obtaining a gray mapping function of each sub-image according to the gray histogram of each cut image block;
for each image block, interpolating a gray mapping function of an adjacent image block of the image block by adopting an interpolation algorithm to obtain a target gray value of each image block;
enhancing the contrast of the image blocks corresponding to the target gray value according to the target gray value to obtain the processed image blocks; and combining the processed image blocks according to the preset segmentation rule to obtain the processed three single-color channel images.
5. The method for processing an electronic digestive tract endoscope image according to claim 4, characterized in that:
according to the gray histogram limit value corresponding to the single-color channel image, the gray histogram of each image block of the single-color channel image is cut to obtain the cut gray histogram of each image block, and the method comprises the following steps:
a cutting step: detecting each gray level in a gray level histogram of the image block, and cutting the histogram statistic value corresponding to the gray level aiming at the gray level of which the corresponding histogram statistic value exceeds the gray level histogram limit value as a detection result, so that the cut histogram statistic value does not exceed the gray level histogram limit value;
averagely distributing the cut histogram statistic values to other gray levels with the detection results that the corresponding histogram statistic values do not exceed the gray level histogram limit value; and executing the cutting step until all gray levels in the gray level histogram of the image block do not exceed the limit value of the gray level histogram, so as to obtain the cut gray level histogram of the image block.
6. The method of processing an electronic digestive tract endoscope image according to any one of claims 4 or 5, characterized in that:
the interpolation algorithm is a bilinear difference algorithm.
7. An apparatus for processing an electronic endoscope image of an alimentary tract, comprising:
the conversion module is used for converting a first YUV image acquired by the electronic digestive tract endoscope into a first RGB image;
a splitting module, configured to split the first RGB image to obtain three single-color channel images, where the three single-color channel images include: an R channel image, a G channel image, and a B channel image;
the processing module is used for respectively processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images;
the merging module is used for merging the processed three single-color channel images to obtain a second RGB image;
the conversion module is further configured to convert the second RGB image into a second YUV image.
8. The apparatus for processing an electronic digestive tract endoscope image according to claim 7, characterized in that:
the processing module is further configured to segment each single-color channel image according to a preset segmentation rule to obtain a plurality of image blocks corresponding to the single-color channel image;
the processing module is further configured to obtain a gray level histogram limit value corresponding to the single-color channel image;
the processing module is further configured to calculate a gray histogram of each image partition of the single-color channel image, and cut the gray histogram of each image partition of the single-color channel image according to a gray histogram limit value corresponding to the single-color channel image to obtain a cut gray histogram of each image partition;
the processing module is further used for obtaining a gray mapping function of each sub-image according to the cut gray histogram of each image block;
the processing module is further used for interpolating the gray mapping functions of the image blocks adjacent to the image blocks by adopting an interpolation algorithm aiming at each image block to obtain a target gray value of each image block;
the processing module is further configured to enhance the contrast of the image partition corresponding to the target gray value according to the target gray value to obtain a processed image partition; and combining the processed image blocks according to the preset segmentation rule to obtain the processed three single-color channel images.
9. An electronic device, characterized in that: comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, which when executed by the processor implement the steps in the method of processing an electronic digestive tract endoscope image according to any one of claims 1 to 6.
10. A readable storage medium, characterized by: the readable storage medium stores thereon a program or instructions which, when executed by a processor, implement the steps in the method of processing an electronic digestive tract endoscope image according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210836269.8A CN115063398A (en) | 2022-07-15 | 2022-07-15 | Method and device for processing electronic digestive tract endoscope image and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210836269.8A CN115063398A (en) | 2022-07-15 | 2022-07-15 | Method and device for processing electronic digestive tract endoscope image and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115063398A true CN115063398A (en) | 2022-09-16 |
Family
ID=83206006
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210836269.8A Pending CN115063398A (en) | 2022-07-15 | 2022-07-15 | Method and device for processing electronic digestive tract endoscope image and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115063398A (en) |
-
2022
- 2022-07-15 CN CN202210836269.8A patent/CN115063398A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11816811B2 (en) | Efficient image demosaicing and local contrast enhancement | |
CN106780368B (en) | Underwater image enhancement method based on foreground model | |
CN110689587B (en) | Underwater image enhancement method based on color correction and detail enhancement | |
US8199227B2 (en) | Image-signal processing apparatus for performing space-variant image-signal processing | |
JP3759761B2 (en) | Method and apparatus for changing sharpness | |
US9842382B2 (en) | Method and device for removing haze in single image | |
KR101437195B1 (en) | Detecting block artifacts in coded image and video | |
KR101012270B1 (en) | Methods and systems for converting images from low dynamic range to high dynamic range | |
CN110246087B (en) | System and method for removing image chroma noise by referring to multi-resolution of multiple channels | |
CN111163268B (en) | Image processing method and device and computer storage medium | |
JP2007310886A (en) | Automatic mapping method of image data, and image processing device | |
US7889280B2 (en) | Image processing apparatus and method thereof | |
JP4097587B2 (en) | Image processing apparatus and image processing method | |
CN109583330B (en) | Pore detection method for face photo | |
CN112200747B (en) | Image processing method and device and computer readable storage medium | |
CN111612705B (en) | Background image eliminating method for enhancing OCR performance | |
CN115063398A (en) | Method and device for processing electronic digestive tract endoscope image and electronic equipment | |
JP2011076302A (en) | Device, contour extraction method program, and contour extraction | |
JPH06309433A (en) | Picture identification system | |
KR101874538B1 (en) | Method and Apparatus for Processing Image to Simultaneously Enhance Contrast and Saturation of Image | |
WO2022246663A1 (en) | Image processing method, device and system, and storage medium | |
CN112907653B (en) | Image processing method, image pickup device and storage medium | |
CN114648461A (en) | Endoscopic image processing method, device, equipment and medium | |
JP2023060530A (en) | Image correction processing apparatus and program | |
CN117830160A (en) | Skin color uniformity method, terminal equipment, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |