CN115965603A - Image processing method, device, terminal and readable storage medium for endoscope image - Google Patents

Image processing method, device, terminal and readable storage medium for endoscope image Download PDF

Info

Publication number
CN115965603A
CN115965603A CN202211727735.5A CN202211727735A CN115965603A CN 115965603 A CN115965603 A CN 115965603A CN 202211727735 A CN202211727735 A CN 202211727735A CN 115965603 A CN115965603 A CN 115965603A
Authority
CN
China
Prior art keywords
image
gray
new
channel
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
Application number
CN202211727735.5A
Other languages
Chinese (zh)
Inventor
徐强
李凌
辜嘉
李中梅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Zhongkehuaying Health Technology Co ltd
Original Assignee
Suzhou Zhongkehuaying Health Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Zhongkehuaying Health Technology Co ltd filed Critical Suzhou Zhongkehuaying Health Technology Co ltd
Priority to CN202211727735.5A priority Critical patent/CN115965603A/en
Publication of CN115965603A publication Critical patent/CN115965603A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses an image processing method, an image processing device, a terminal and a readable storage medium of an endoscope image, wherein the image processing method comprises the following steps: acquiring a target light reflecting area of the endoscope image, and repairing the target light reflecting area to obtain an image inpaint _ image; and performing detail enhancement processing on the image inpaint _ image. The image processing method can perform the reflection removing and enhancement processing on the endoscope image.

Description

Image processing method, device, terminal and readable storage medium for endoscope image
Technical Field
The invention relates to the technical field of medical instruments, in particular to an image processing method and device of an endoscope image, a terminal and a readable storage medium.
Background
An endoscope is a medical instrument with a miniature camera, and endoscopic surgery is surgery performed by using the endoscope and related instruments: the cold light source is used for providing illumination, the endoscope lens (with the diameter of 3-10 mm) is inserted into the abdominal cavity, the digital camera shooting technology is used for leading the image shot by the endoscope lens to be transmitted to a post-stage signal processing system through an optical fiber, and the image is displayed on a special monitor in real time. Then, the doctor analyzes and judges the state of the patient through the images of different angles of the patient organ displayed on the monitor screen, and performs the operation by using a special endoscope instrument. The endoscope operation has small trauma, few complications and rapid patient recovery, is widely applied in clinic at present, and becomes the development trend of future operations, but the imaging shot by the current endoscope, such as imaging at a place with light blood vessel color, is not clear, so that doctors cannot accurately judge the disease condition and perform operation treatment, and therefore, an endoscope image processing method is provided.
Disclosure of Invention
In view of the above, the main object of the present invention is to provide an image processing method, device, terminal and readable storage medium for endoscopic images.
In order to achieve the purpose, the technical scheme of the invention is realized as follows: an image processing method of an endoscopic image, comprising the steps of: acquiring a target light reflecting area of the endoscope image, and repairing the target light reflecting area to obtain an image inpaint _ image; and performing detail enhancement processing on the image inpaint _ image.
As an improvement of the embodiment of the present invention, the "acquiring a target light reflection area of the endoscopic image" specifically includes: the method comprises the steps of obtaining a red channel image R _ image, a green channel image G _ image, a blue channel image B _ image and a Gray level image Gray _ image of an endoscope image, generating a reflective area special _ mask1 based on the R _ image, the G _ image, the B _ image and a preset threshold T1, generating a reflective area special _ mask2 based on the G _ image, the B _ image, the Gray _ image and a preset threshold T2, carrying out OR operation on the special _ mask1 and the special _ mask2 to obtain a reflective area special _ mask3, carrying out adaptive threshold segmentation processing on the Gray _ image to obtain a reflective area special _ mask4, and carrying out AND operation on the special _ mask3 and the special _ mask4 to obtain a target reflective area.
As an improvement of the embodiment of the present invention, the "generating a reflective area specific _ mask1 based on R _ image, G _ image, B _ image and a preset threshold T1" specifically includes: denoising the endoscope image to obtain an image media _ image, and acquiring a red channel image R _ media _ image, a green channel image G _ media _ image and a blue channel image B _ media _ image of the image media _ image;
Figure BDA0004030843470000021
Figure BDA0004030843470000022
wherein mean () is the mean value, std () is the standard deviation; generating a first temporary picture>
Figure BDA0004030843470000023
Wherein merge () is image merging; generating a second temporary picture new _ image _ max, wherein the width of the new _ image _ max is equal to the width of the new _ image, the length of the new _ image _ max is equal to the length of the new _ image, and any pixel new _ image _ max _ dot in the new _ image has a pixel new _ image _ dot with the same coordinate in the new _ image, and
Figure BDA0004030843470000024
t1 is a preset threshold value, and the output of max () is the maximum value of the R value, the G value and the B value of the input pixel; setting the format of the second temporary picture new _ image _ max as a unit8 format, and obtaining a reflective area special _ mask1 from the second temporary picture new _ image _ max.
As an improvement of the embodiment of the present invention, the specific packet "generate the reflective area specific _ mask2 based on G _ image, B _ image, gray _ image and the preset threshold T2Comprises the following steps:
Figure BDA0004030843470000025
Figure BDA0004030843470000026
Figure BDA0004030843470000027
wherein, P _ G _ image is a preset percentile of G _ image, P _ B _ image is a preset percentile of B _ image, and P _ Gray _ image is a preset percentile of Gray _ image; generating a channel image new _ Gray, a channel image new _ G, and a channel image new _ B, new _ G = threshold (G _ image, rate _ G _ Gray × T2), new _ B =
threshold (B _ image, rate _ B _ Gray × T2), new _ Gray = threshold (Gray _ image > T2), the length of the image output by the function threshold (src, maxVal) is equal to the length of the image src, the width of the output image is equal to the width of the image src, when the pixel value of any pixel in src > maxVal, the pixel value of the corresponding pixel in the output image is 1, otherwise, 0; and converting the new _ Gray, the new _ G and the new _ B into a prescription 8 format, and carrying out OR operation to obtain a reflective area specific _ mask2.
As an improvement of the embodiment of the present invention, the "repairing the target light reflection area to obtain the image inpaint _ image" specifically includes: performing morphological expansion processing on the target light reflecting area to obtain a picture dilate _ specific _ mask; traversing all the outlines in the picture partition _ specific _ mask, and calculating a circumscribed matrix corresponding to each outline; performing the following processing on each external matrix to obtain a primary repair picture inpaint _ image1 corresponding to the traversal picture dilate _ specific _ mask, wherein the processing comprises: acquiring an average value of an R value, a G value and a B value of a non-light-reflecting area in the external matrix as a filling color, and filling the light-reflecting area in the external matrix; performing Gaussian blur processing on the primary repaired picture inpaint _ image1 to obtain a picture gaussian _ image; performing linear filtering processing on the ergodic picture scale _ specific _ mask to obtain a picture filter2d _ image; filter2d _ image _ verse =1- (filter 2d _ image + dilate _ specific _ mask); the picture after the target light reflecting region is repaired is
Inpaint _ image [: k ] = filter2d _ image × gaussian _ image [: k ] + filter2d _ image _ verse × image [: k ], k ] is the three channel values (0, 1, 2) corresponding to the image.
As an improvement of the embodiment of the present invention, the "performing detail enhancement processing on the image inpaint _ image" specifically includes: performing Gamma enhancement processing on the image inpaint _ image to obtain an image Gamma _ image; carrying out self-adaptive histogram equalization processing with limited row contrast on the image gamma _ image to obtain an image clahe _ gamma _ image; separating the image clahe _ gamma _ image into channels, and adjusting the channel values of R and G according to the proportion (1.2 ) to obtain an image aug _ image1; converting the RGB channel of the image aug _ image1 into an HSV channel to obtain an image HSV _ aug _ image1, and adjusting the channel values of S and V according to the proportion (1.2, 0.8) to obtain an image aug _ image2; and converting the image aug _ image2 back to an RGB three channel to obtain an image with enhanced details.
As an improvement of the embodiment of the present invention, the "acquiring a red channel image R _ image, a green channel image G _ image, a blue channel image B _ image, and a grayscale image Gray _ image of the endoscopic image" specifically includes: and performing channel separation processing on the endoscope image to obtain a red channel image R _ image, a green channel image G _ image and a blue channel image B _ image, and performing Gray processing on the endoscope image to obtain a Gray image Gray _ image.
The embodiment of the invention also provides an image processing device of the endoscope image, which comprises the following modules: the light reflection area enhancing module is used for acquiring a target light reflection area of the endoscope image and repairing the target light reflection area to obtain an image inpaint _ image; and the detail enhancement module is used for carrying out detail enhancement processing on the image inpaint _ image.
An embodiment of the present invention further provides a terminal, including: a memory for storing a computer program; a processor for implementing the steps of the image processing method as described above when executing the computer program.
An embodiment of the present invention further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the image processing method as described above.
The image processing method, the image processing device, the terminal and the readable storage medium for the endoscope image provided by the embodiment of the invention have the following advantages: the embodiment of the invention discloses an image processing method, an image processing device, a terminal and a readable storage medium of an endoscope image, wherein the image processing method comprises the following steps: acquiring a target light reflecting area of the endoscope image, and repairing the target light reflecting area to obtain an image inpaint _ image; and performing detail enhancement processing on the image inpaint _ image. The image processing method can perform image enhancement processing on an endoscope image.
Drawings
FIG. 1 is a flowchart illustrating an image processing method according to an embodiment;
fig. 2, 3, 4, 5, 6, and 7 are schematic diagrams of an image processing method in an embodiment.
Detailed Description
The present invention will be described in detail below with reference to embodiments shown in the drawings. The present invention is not limited to the embodiment, and structural, methodological, or functional changes made by one of ordinary skill in the art according to the embodiment are included in the scope of the present invention.
The following description and the drawings sufficiently illustrate specific embodiments herein to enable those skilled in the art to practice them. Portions and features of some embodiments may be included in or substituted for those of others. The scope of the embodiments herein includes the full breadth of the claims, as well as all available equivalents of the claims. The terms "first," "second," and the like, herein are used solely to distinguish one element from another element without requiring or implying any actual such relationship or order between such elements. In practice, a first element can also be referred to as a second element, and vice versa. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a structure, apparatus, or device that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such structure, apparatus, or device. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a structure, device, or apparatus that comprises the element. The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like herein, as used herein, are defined as orientations or positional relationships based on the orientation or positional relationship shown in the drawings, and are used for convenience in describing and simplifying the description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be construed as limiting the present invention. In the description herein, unless otherwise specified and limited, the terms "mounted," "connected," and "connected" are to be construed broadly, and may include, for example, mechanical or electrical connections, communications between two elements, direct connections, and indirect connections via intermediary media, where the specific meaning of the terms is understood by those skilled in the art as appropriate.
An embodiment of the present invention provides an image processing method for an endoscopic image, as shown in fig. 1, including the following steps:
step 101: acquiring a target light reflecting area of the endoscope image, and repairing the target light reflecting area to obtain an image inpaint _ image;
step 102: and performing detail enhancement processing on the image inpaint _ image.
Here, in the endoscope image, the reflection region blocks the mucous membrane, which interferes with the observation and review of the image by the doctor, and the image processing method in the embodiment first processes the reflection region and then performs the detail enhancement processing, so that a good image enhancement effect can be obtained.
In an embodiment of the present invention, the "acquiring a target light reflection area of the endoscopic image" specifically includes:
acquiring a red channel image R _ image, a green channel image G _ image, a blue channel image B _ image and a Gray image Gray _ image of the endoscope image; here, in the computer, the endoscopic image is actually a multidimensional matrix of M × N × C, where M is the width (in pixels) of the endoscopic image, N is the height (in pixels) of the endoscopic image, and C represents the number of channels. C is generally 3, i.e., 3 channels (red, green, and blue), and thus, when C =1, C =2, and C =3, a red channel image R _ image, a green channel image G _ image, and a blue channel image B _ image are obtained.
Here, in the RGB model, if R = G = B, the color represents a gray-scale color, where a value of R = G = B is called a gray-scale value, that is, if R = G = B of a certain image, the image is a gray-scale image. Alternatively, the endoscopic image may be processed by a maximum value method, an average value method, a weighted average method, or the like, so as to obtain a Gray scale image Gray _ image.
As shown in fig. 2, a light reflecting region special _ mask1 is generated based on R _ image, G _ image, B _ image and a preset threshold T1, a light reflecting region special _ mask2 is generated based on G _ image, B _ image, gray _ image and a preset threshold T2, the light reflecting region special _ mask3 is obtained by performing or operation on special _ mask1 and special _ mask2, the light reflecting region special _ mask4 is obtained by performing adaptive threshold segmentation processing on Gray _ image, and the target light reflecting region is obtained by performing and operation on special _ mask3 and special _ mask 4. Here, the and operation of the image means that each pixel value of two images (both gray level images and color images) is subjected to binary and operation to realize image clipping; correspondingly, the image or operation means that each pixel value of two images (both gray scale images and color images) is subjected to binary or operation to realize image cutting.
In this embodiment, as shown in fig. 3, the "generating a reflective area specific _ mask1 based on R _ image, G _ image, B _ image and a preset threshold T1" specifically includes:
denoising the endoscope image to obtain an image media _ image, and acquiring a red channel image R _ media _ image, a green channel image G _ media _ image and a blue channel image B _ media _ image of the image media _ image;
Figure BDA0004030843470000051
Figure BDA0004030843470000052
wherein mean () is the mean value, std () is the standard deviation; here, the function mean () averages the pixel values of each pixel of the input image, and std () calculates the standard deviation of the pixel values of each pixel of the input image.
Here, the endoscope image may be denoised by median filtering to obtain an image media _ image, so that noise in an image line can be filtered.
Generating a first temporary picture
Figure BDA0004030843470000061
Wherein merge () is image merging; here, the function merge () inputs three images: and fusing the red channel image, the green channel image and the blue channel image to obtain an output image. Here, the contrast ratio of each channel is calculated in order to extract a region with high contrast (possibly a light-reflecting region).
Generating a second temporary picture new _ image _ max, wherein the width of the new _ image _ max is equal to the width of the new _ image, the length of the new _ image _ max is equal to the length of the new _ image, and any pixel new _ image _ max _ dot in the new _ image has a pixel new _ image _ dot with the same coordinate in the new _ image, and
Figure BDA0004030843470000062
t1 is a preset threshold value, and the output of max () is the maximum value of the R value, the G value and the B value of the input pixel; here, by T1, outliers can be filtered.
Setting the format of the second temporary picture new _ image _ max as a unit8 format, and obtaining a reflective area special _ mask1 from the second temporary picture new _ image _ max.
In this embodiment, as shown in fig. 5, the "generating a reflective region specific _ mask2 based on G _ image, B _ image, gray _ image and a preset threshold T2" specifically includes:
Figure BDA0004030843470000063
wherein, P _ G _ image is a preset percentile of G _ image, P _ B _ image is a preset percentile of B _ image, and P _ Gray _ image is a preset percentile of Gray _ image; here, the highlight region can be distinguished by the preset percentile (especially when the preset percentile is large).
Generating a channel image new _ Gray, a channel image new _ G, and a channel image new _ B, new _ G = threshold (G _ image, rate _ G _ Gray × T2), new _ B = threshold (B _ image, rate _ B _ Gray × T2), new _ Gray = threshold (Gray _ image > T2), a length of an image output by a function threshold (src, maxvi) is equal to a length of an image src, a width of the output image is equal to a width of the image src, when a pixel value of any one pixel in the src > maxvi, a pixel value of a corresponding pixel in the output image is 1, otherwise, 0;
and converting the new _ Gray, the new _ G and the new _ B into a prescription 8 format, and carrying out OR operation to obtain a reflective area specific _ mask2.
Optionally, the P _ G _ image, the P _ B _ image, and the P _ Gray _ image are all 95 percentiles, that is, all values are 95%.
In this embodiment, as shown in fig. 4, the "repairing the target light reflection area to obtain the image inpaint _ image" specifically includes:
as shown in steps 401 and 402, performing morphological expansion processing on the target light-reflecting region to obtain a picture scale _ specific _ mask; here, in the image, the boundary points of the binarized object are expanded, all background points in contact with the object are merged into the object, and the boundary is expanded to the outside. If the two objects are closely spaced, the two objects are connected together, and therefore morphological dilation processing on the image is achieved. Here, the dilation is to subsequently blur the boundary of the highlight region so that the repaired region looks more natural.
As shown in step 403, traversing all the contours in the picture scale _ specific _ mask, and calculating a circumscribed matrix corresponding to each contour;
as shown in steps 404 and 405, the following processing is performed on each external matrix, so as to obtain a preliminary repair picture inpaint _ image1 corresponding to the traverse picture partition _ mask, where the processing includes: acquiring an average value of an R value, a G value and a B value of a non-light-reflecting area in the external matrix as a filling color, and filling the light-reflecting area in the external matrix; each retroreflective region is assigned a color value that is an average of the color values of the surrounding (circumscribed rectangular) non-retroreflective regions in order to make the assigned color closer to the actual scene.
As shown in step 406, performing gaussian blur processing on the preliminary repair picture inpaint _ image1 to obtain a gaussian _ image; gaussian blur is essentially a low pass filter, and each pixel point of the output image is the weighted sum of the corresponding pixel point on the original image and surrounding pixel points. The gaussian blur blurs the image.
As shown in step 406, performing linear filtering processing on the traversed picture scale _ specific _ mask to obtain a picture filter2d _ image; here, the linear filtering may include: block filtering, mean filtering, gaussian filtering, and equal linear operators, etc. Linear filtering can convolution blur the image.
filter2d_image_verse=1-(filter2d_image+dilate_specular_mask);
The picture after the target light reflection area is repaired is inpaint _ image [,: k ] = filter2d _ image × gaussian _ image [,: k ] + filter2d _ image _ reverse × image [,: k, k ], and k are three channel values (0, 1, 2) corresponding to the image. The image is fused, and the area subjected to the reflective repair can be sharpened.
In this embodiment, as shown in fig. 6, the "performing detail enhancement processing on the image inpaint _ image" specifically includes:
as shown in steps 601 and 602, performing Gamma enhancement processing on the image inpaint _ image to obtain an image Gamma _ image; here, the Gamma enhancement processing is performed to enhance details of low gray or high gray, and the Gamma value is divided by 1, and the smaller the Gamma value is, the stronger the extension action is on the low gray portion of the image, and the larger the Gamma value is, the stronger the extension action is on the high gray portion of the image.
As shown in steps 603 and 604, performing adaptive histogram equalization with limited line contrast on the image gamma _ image to obtain an image clahe _ gamma _ image; here, the histogram equalization method converts the image into an image with uniform gray-scale values through different gray-scale distribution schemes, extracts a gray-scale mapping curve by using the histogram, and converts the gray-scale mapping curve, thereby improving the brightness. However, this method has the drawback that the contrast cannot be enhanced, and in the process, the noise signal is also amplified. Taking AHE (Adaptive Histogtam Equalization) as an example, the method cuts an image into a large number of small lattice sub-regions by using grid lines, and performs Equalization processing on each lattice. However, this method causes image distortion, and its microphonics are amplified accordingly. Therefore, a Contrast-limited Adaptive histogram (CLAHE) is proposed, i.e., a Contrast-limited process is performed on each partition unit, which is also different from the conventional AHE. CLAHE limits noise amplification and local contrast enhancement by limiting the height of the local histogram. The method divides an image into a plurality of sub-regions; the histogram for each sub-region is then classified. And finally, carrying out interpolation operation on each pixel to obtain a transformed gray value, thereby realizing contrast limited self-adaptive histogram equalization image enhancement. The CLAHE algorithm is mainly directed to texture and edge information of the image.
As shown in 701, 702, 703, 704, and 705 of fig. 7, the image clahe _ gamma _ image is subjected to channel separation processing, and the channel values of R and G are adjusted in proportion (1.2 ) to obtain an image aug _ image1; converting an RGB channel of the image aug _ image1 into an HSV (Hue, saturation, value, hue, saturation and brightness) channel to obtain an image HSV _ aug _ image1, and adjusting channel values of S and V according to a proportion (1.2, 0.8) to obtain an image aug _ image2; and (5) converting the image aug _ image2 back to the RGB three channels to obtain an image with enhanced details. Here, adjusting the channels of RGB and HSV can further improve the contrast of the blood vessels in the image.
Here, a formula may be used
aug_image2=merge(hsv_aug_image1 H ,1.2×hsv_aug_image1 S ,0.8×hsv_aug_image1 V ) The image aug _ image2 is generated.
Optionally, the "denoising the endoscopic image to obtain an image media _ image" specifically includes: and carrying out median filtering processing on the endoscope image to obtain an image media _ image. Here, the median filtering method is a non-linear smoothing technique, and sets the gray value of each pixel point as the median of the gray values of all pixel points in a certain neighborhood window of the point. The median filtering is a nonlinear signal processing technology which is based on a sequencing statistic theory and can effectively inhibit noise, and the basic principle of the median filtering is to replace the value of one point in a digital image or a digital sequence by the median of all point values in a neighborhood of the point, so that the surrounding pixel values are close to the true value, and isolated noise points are eliminated. The method is to sort the pixels in the plate according to the size of the pixel value by using a two-dimensional sliding template with a certain structure, and generate a monotonously ascending (or descending) two-dimensional data sequence.
In this embodiment, the "acquiring the red channel image R _ image, the green channel image G _ image, the blue channel image B _ image, and the Gray level image Gray _ image of the endoscopic image" specifically includes:
and performing channel separation processing on the endoscope image to obtain a red channel image R _ image, a green channel image G _ image and a blue channel image B _ image, and performing Gray processing on the endoscope image to obtain a Gray image Gray _ image.
The second embodiment of the invention provides an image processing device of an endoscope image, which comprises the following modules: the light reflection area enhancing module is used for acquiring a target light reflection area of the endoscope image and repairing the target light reflection area to obtain an image inpaint _ image; and the detail enhancement module is used for carrying out detail enhancement processing on the image inpaint _ image.
An embodiment of the present invention provides a terminal, including: a memory for storing a computer program; a processor for implementing the steps of the image processing method as in the first embodiment when executing the computer program.
A fourth embodiment of the present invention provides a readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the image processing method in the first embodiment are implemented.
It should be noted that, although the steps are described in a specific order, the steps are not necessarily executed in the specific order, and in fact, some of the steps may be executed concurrently or even in a changed order as long as the required functions are achieved.
The present invention may be a system, method and/or computer program product. The computer program product may include a readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The readable storage medium may be a tangible device that retains and stores instructions for use by an instruction execution device. The readable storage medium may include, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. An image processing method for an endoscopic image, comprising the steps of:
acquiring a target light reflection area of the endoscope image, and repairing the target light reflection area to obtain an image inpaint _ image;
and performing detail enhancement processing on the image inpaint _ image.
2. The image processing method according to claim 1, wherein the "acquiring the target light reflection area of the endoscopic image" specifically includes:
acquiring a red channel image R _ image, a green channel image G _ image, a blue channel image B _ image and a Gray image Gray _ image of the endoscope image, generating a reflective area special _ mask1 based on the R _ image, the G _ image, the B _ image and a preset threshold T1, generating a reflective area special _ mask2 based on the G _ image, the B _ image, the Gray _ image and a preset threshold T2, carrying out OR operation on the special _ mask1 and the special _ mask2 to obtain a reflective area special _ mask3, carrying out adaptive threshold segmentation processing on the Gray _ image to obtain a reflective area special _ mask4, and carrying out AND operation on the special _ mask3 and the special _ mask4 to obtain a target reflective area.
3. The image processing method according to claim 2, wherein the "generating a retroreflective area specula _ mask1 based on R _ image, G _ image, B _ image, and a preset threshold T1" specifically includes:
denoising the endoscope image to obtain an image media _ image, and acquiring a red channel image R _ media _ image, a green channel image G _ media _ image and a blue channel image B _ media _ image of the image media _ image;
Figure FDA0004030843460000011
Figure FDA0004030843460000012
wherein mean () is the mean value, std () is the standard deviation;
generating a first temporary picture
Figure FDA0004030843460000013
Wherein merge () is image merging;
generating a second temporary picture new _ image _ max, wherein the width of the new _ image _ max is equal to the width of the new _ image, the length of the new _ image _ max is equal to the length of the new _ image, and any pixel new _ image _ max _ dot in the new _ image has a pixel new _ image _ dot with the same coordinate in the new _ image, and
Figure FDA0004030843460000014
t1 is a preset threshold value, and the output of max () is the maximum value of the R value, the G value and the B value of the input pixel;
setting the format of the second temporary picture new _ image _ max as a unit8 format, and obtaining a reflective area special _ mask1 from the second temporary picture new _ image _ max.
4. The image processing method according to claim 3, wherein the "generating a retroreflective region specula _ mask2 based on G _ image, B _ image, gray _ image, and a preset threshold T2" specifically includes:
Figure FDA0004030843460000021
the method comprises the following steps that P _ G _ image is a preset percentile of G _ image, P _ B _ image is a preset percentile of B _ image, and P _ Gray _ image is a preset percentile of Gray _ image;
generating a channel image new _ Gray, a channel image new _ G, and a channel image new _ B, new _ G = threshold (G _ image, rate _ G _ Gray × T2), new _ B = threshold (B _ image, rate _ B _ Gray × T2), new _ Gray = threshold (Gray _ image > T2), a length of an image output by a function threshold (src, maxvi) is equal to a length of an image src, a width of the output image is equal to a width of the image src, when a pixel value of any one pixel in the src > maxvi, a pixel value of a corresponding pixel in the output image is 1, otherwise, 0;
and converting the new _ Gray, the new _ G and the new _ B into a fluid 8 format, and performing OR operation to obtain a reflective area specula _ mask2.
5. The image processing method according to claim 1, wherein the "repairing the target light reflection area to obtain the image inpaint _ image" specifically includes:
performing morphological expansion processing on the target light reflecting area to obtain a picture scale _ specific _ mask;
traversing all the outlines in the picture partition _ specific _ mask, and calculating a circumscribed matrix corresponding to each outline
Performing the following processing on each external matrix to obtain a primary repair picture inpaint _ image1 corresponding to the traversal picture dilate _ specific _ mask, wherein the processing comprises: acquiring an average value of an R value, a G value and a B value of a non-light-reflecting area in the external matrix as a filling color, and filling the light-reflecting area in the external matrix;
performing Gaussian blur processing on the primary repaired picture inpaint _ image1 to obtain a picture gaussian _ image;
performing linear filtering processing on the ergodic picture scale _ specific _ mask to obtain a picture filter2d _ image;
filter2d_image_verse=1-(filter2d_image+dilate_specular_mask);
the picture after the target light reflection area is repaired is inpaint _ image [,: k ] = filter2d _ image [,: k ] =
The gaussian _ image [: k ] + filter2d _ image _ verse × image [: k ], k is the value of the three channels corresponding to the image (0, 1, 2).
6. The image processing method according to claim 1, wherein said "performing detail enhancement processing on the image inpaint _ image" specifically includes:
performing Gamma enhancement processing on the image inpaint _ image to obtain an image Gamma _ image;
carrying out self-adaptive histogram equalization processing with limited row contrast on the image gamma _ image to obtain an image clahe _ gamma _ image;
separating the image clahe _ gamma _ image into channels, and adjusting the channel values of R and G according to the proportion (1.2 ) to obtain an image aug _ image1;
converting an RGB channel of the image aug _ image1 into an HSV channel to obtain an image HSV _ aug _ image1, and adjusting channel values of S and V according to a ratio (1.2, 0.8) to obtain an image aug _ image2;
and converting the image aug _ image2 back to an RGB three channel to obtain an image with enhanced details.
7. The image processing method according to claim 2, wherein the acquiring a red channel image R _ image, a green channel image G _ image, a blue channel image B _ image, and a grayscale image Gray _ image of the endoscopic image specifically includes:
and performing channel separation processing on the endoscope image to obtain a red channel image R _ image, a green channel image G _ image and a blue channel image B _ image, and performing Gray processing on the endoscope image to obtain a Gray image Gray _ image.
8. An image processing apparatus for endoscopic images, comprising:
the light reflection region enhancing module is used for acquiring a target light reflection region of the endoscope image and restoring the target light reflection region to obtain an image inpaint _ image;
and the detail enhancement module is used for carrying out detail enhancement processing on the image inpaint _ image.
9. A terminal, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the image processing method according to any one of claims 1 to 7 when executing the computer program.
10. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the image processing method according to any one of claims 1 to 7.
CN202211727735.5A 2022-12-30 2022-12-30 Image processing method, device, terminal and readable storage medium for endoscope image Pending CN115965603A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211727735.5A CN115965603A (en) 2022-12-30 2022-12-30 Image processing method, device, terminal and readable storage medium for endoscope image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211727735.5A CN115965603A (en) 2022-12-30 2022-12-30 Image processing method, device, terminal and readable storage medium for endoscope image

Publications (1)

Publication Number Publication Date
CN115965603A true CN115965603A (en) 2023-04-14

Family

ID=87357539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211727735.5A Pending CN115965603A (en) 2022-12-30 2022-12-30 Image processing method, device, terminal and readable storage medium for endoscope image

Country Status (1)

Country Link
CN (1) CN115965603A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116934697A (en) * 2023-07-13 2023-10-24 衡阳市大井医疗器械科技有限公司 Blood vessel image acquisition method and device based on endoscope
CN116977214A (en) * 2023-07-21 2023-10-31 萱闱(北京)生物科技有限公司 Image optimization method, device, medium and computing equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116934697A (en) * 2023-07-13 2023-10-24 衡阳市大井医疗器械科技有限公司 Blood vessel image acquisition method and device based on endoscope
CN116977214A (en) * 2023-07-21 2023-10-31 萱闱(北京)生物科技有限公司 Image optimization method, device, medium and computing equipment

Similar Documents

Publication Publication Date Title
CN115965603A (en) Image processing method, device, terminal and readable storage medium for endoscope image
JP5039310B2 (en) Cerebral hemorrhage segmentation device
JP3810776B2 (en) A method for detecting and correcting red eyes in digital images.
CN111325739A (en) Method and device for detecting lung focus and training method of image detection model
US20080247619A1 (en) Method, device and computer-readable recording medium containing program for extracting object region of interest
US20060050944A1 (en) Nipple detection apparatus and program
CN111062947B (en) X-ray chest radiography focus positioning method and system based on deep learning
JPH1115947A (en) Image processor
JP6385318B2 (en) Transform 3D objects to segment objects in 3D medical images
CN110008992B (en) Deep learning method for prostate cancer auxiliary diagnosis
JP6578058B2 (en) Image processing apparatus, method for operating image processing apparatus, and operation program for image processing apparatus
US11406340B2 (en) Method for converting tone of chest X-ray image, storage medium, image tone conversion apparatus, server apparatus, and conversion method
CN104077747B (en) Medical image-processing apparatus and medical image processing method
CN117764994B (en) Biliary pancreas imaging system and method based on artificial intelligence
CN116152500A (en) Full-automatic tooth CBCT image segmentation method based on deep learning
CN111223090A (en) Identification system of tumor image in human lung CT image
KR102182357B1 (en) Surgical assist device and method for 3D analysis based on liver cancer area in CT image
CN104268845A (en) Self-adaptive double local reinforcement method of extreme-value temperature difference short wave infrared image
CN113139929A (en) Gastrointestinal tract endoscope image preprocessing method comprising information screening and fusion repairing
JP4124406B2 (en) Abnormal shadow detection device
JP2019121053A (en) Image processing device and image processing method
CN111062909A (en) Method and equipment for judging benign and malignant breast tumor
CN114037665A (en) Mandibular neural tube segmentation method, mandibular neural tube segmentation device, electronic apparatus, and storage medium
CN116883249B (en) Super-resolution endoscope imaging device and method
JPH11332858A (en) Apparatus for blackening processing outside of irradiation field

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