Image processing method and device of endoscope image, terminal and readable storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU ZHONGKE HUAYING HEALTH TECH CO LTD
- Filing Date
- 2022-12-30
- Publication Date
- 2026-06-02
Smart Images

Figure CN115965603B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical device technology, and in particular to an image processing method, apparatus, terminal, and readable storage medium for endoscopic images. Background Technology
[0002] An endoscope is a medical instrument equipped with a miniature camera. Endoscopic surgery utilizes an endoscope and related instruments: a cold light source provides illumination, the endoscope lens (3-10mm in diameter) is inserted into the abdominal cavity, and digital imaging technology transmits the images captured by the endoscope lens through optical fibers to a subsequent signal processing system, displaying them in real time on a dedicated monitor. The surgeon then analyzes and assesses the patient's condition by viewing images of the patient's organs from different angles on the monitor screen and performs the surgery using specialized endoscopic instruments. Endoscopic surgery is minimally invasive, has few complications, and allows for rapid patient recovery, and is now widely used in clinical practice, representing a future trend in surgery. However, current endoscopic images are often unclear, such as in areas where blood vessels are faintly colored, making it difficult for surgeons to accurately diagnose the condition and perform surgical treatment. Therefore, we propose an endoscopic image processing method. Summary of the Invention
[0003] In view of this, the main objective of the present invention is to provide an image processing method, apparatus, terminal and readable storage medium for endoscopic images.
[0004] To achieve the above objectives, the technical solution of the present invention is implemented as follows: an image processing method for an endoscope image, comprising the following steps: obtaining the target reflective area of the endoscope image image and repairing the target reflective area to obtain an image inpaint_image; and performing detail enhancement processing on the image inpaint_image.
[0005] As an improvement of this embodiment of the invention, the step of obtaining the target reflective region of the endoscope image specifically includes: obtaining the red channel image R_image, green channel image G_image, blue channel image B_image, and grayscale image Gray_image of the endoscope image; generating a reflective region specular_mask1 based on R_image, G_image, B_image, and a preset threshold T1; generating a reflective region specular_mask2 based on G_image, B_image, Gray_image, and a preset threshold T2; performing an OR operation on specular_mask1 and specular_mask2 to obtain a reflective region specular_mask3; performing adaptive threshold segmentation processing on Gray_image to obtain a reflective region specular_mask4; and performing an AND operation on specular_mask3 and specular_mask4 to obtain the target reflective region.
[0006] As an improvement to an embodiment of the present invention, the step of generating the reflective region specular_mask1 based on R_image, G_image, B_image and a preset threshold T1 specifically includes: performing noise reduction processing on the endoscope image image to obtain an image media_image, and acquiring the red channel image R_media_image, green channel image G_media_image and blue channel image B_media_image of the image media_image; , , Here, mean() calculates the mean, and std() calculates the standard deviation; generate the first temporary image. Here, `merge()` performs image merging; it generates a second temporary image `new_image_max`, whose width and length are equal to the width and length of `new_image_max`. Any pixel `new_image_max_dot` in `new_image_max` has a corresponding pixel `new_image_dot` at the same coordinates in `new_image_max`. T1 is a preset threshold, and max() outputs the maximum value of the R, G and B values of the input pixel; the format of the second temporary image new_image_max is set to unit8 format, and the reflective area specular_mask1 is obtained from the second temporary image new_image_max.
[0007] As an improvement to this embodiment of the invention, the generation of the reflective region specular_mask2 based on G_image, B_image, Gray_image and a preset threshold T2 specifically includes: , Where P_G_image is the preset percentile of G_image, P_B_image is the preset percentile of B_image, and P_Gray_image is the preset percentile of Gray_image; generate channel image new_Gray, channel image new_G, and channel image new_B. , , ,function The length of the output image (src, maxVal) is equal to the length of the image src, and the width of the output image is equal to the width of the image src. When the pixel value of any pixel in src is greater than maxVal, the pixel value of the corresponding pixel in the output image is 1, otherwise it is 0. Convert new_Gray, new_G, and new_B to uint8 format and perform an OR operation to obtain the reflective area specular_mask2.
[0008] As an improvement to this embodiment of the invention, the step of repairing the reflective area of the target to obtain the image inpaint_image specifically includes: performing morphological dilation processing on the reflective area of the target to obtain the image dilate_specular_mask; traversing all contours in the image dilate_specular_mask and calculating the outer matrix corresponding to each contour; performing the following processing on each outer matrix to obtain the preliminary repaired image inpaint_image1 corresponding to the traversed image dilate_specular_mask, the processing including: obtaining the average value of R, G, and B values of the non-reflective area in the outer matrix as the fill color, and filling the reflective area in the outer matrix; performing Gaussian blur processing on the preliminary repaired image inpaint_image1 to obtain the image gaussian_image; and performing linear filtering processing on the traversed image dilate_specular_mask to obtain the image filter2d_image. The image after repairing the reflective areas of the target is as follows: k represents the values of the three channels of the image (0, 1, 2).
[0009] As an improvement to this embodiment of the invention, the detail enhancement processing of the image inpaint_image specifically includes: performing Gamma enhancement processing on the image inpaint_image to obtain the image gamma_image; performing row contrast-limited adaptive histogram equalization processing on the image gamma_image to obtain the image clahe_gamma_image; performing channel separation processing on the image clahe_gamma_image, adjusting the R and G channel values by a ratio of (1.2, 1.2) to obtain the image aug_image1; converting the RGB channels of the image aug_image1 to HSV channels to obtain the image hsv_aug_image1, adjusting the S and V channel values by a ratio of (1.2, 0.8) to obtain the image aug_image2; and converting the image aug_image2 back to RGB three channels to obtain the image with enhanced details.
[0010] As an improvement to an embodiment of the present invention, the step of obtaining the red channel image R_image, green channel image G_image, blue channel image B_image, and grayscale image Gray_image of the endoscope image specifically includes: performing channel separation processing on the endoscope image to obtain the red channel image R_image, green channel image G_image, and blue channel image B_image, and performing grayscale processing on the endoscope image to obtain the grayscale image Gray_image.
[0011] This invention also provides an image processing device for endoscopic images, comprising the following modules: a reflective area enhancement module, used to acquire the target reflective area of the endoscopic image image and repair the target reflective area to obtain an image inpaint_image; and a detail enhancement module, used to perform detail enhancement processing on the image inpaint_image.
[0012] This invention also provides a terminal, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the image processing method described above.
[0013] This invention also provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the image processing method described above.
[0014] The image processing method, apparatus, terminal, and readable storage medium for endoscopic images provided in this invention have the following advantages: This invention discloses an image processing method, apparatus, terminal, and readable storage medium for endoscopic images. The image processing method includes: acquiring the target reflective area of the endoscopic image (image), and repairing the target reflective area to obtain an image (inpaint_image); and performing detail enhancement processing on the image (inpaint_image). This image processing method can perform image enhancement processing on endoscopic images. Attached Figure Description
[0015] Figure 1 This is a flowchart illustrating the image processing method in the embodiment;
[0016] Figure 2 , Figure 3 , Figure 4 , Figure 5 , Figure 6 and Figure 7 This is a schematic diagram of the image processing method in the embodiment. Detailed Implementation
[0017] The present invention will now be described in detail with reference to the embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the scope of protection of the present invention.
[0018] The following description and accompanying drawings fully illustrate specific embodiments described herein to enable those skilled in the art to practice them. Some embodiments may include or substitute parts and features of other embodiments. The scope of the embodiments herein encompasses the entire scope of the claims and all available equivalents thereof. Throughout this document, the terms “first,” “second,” etc., are used only to distinguish one element from another without requiring or implying any actual relationship or order between the elements. Indeed, a first element can also be referred to as a second element, and vice versa. Furthermore, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a structure, apparatus, or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a structure, apparatus, or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the structure, apparatus, or device that includes said element. The various embodiments described herein are presented in a progressive manner, with each embodiment focusing on its differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.
[0019] The terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer" used in this document to indicate orientation or positional relationships are based on the orientation or positional relationships shown in the accompanying drawings and are used only for the convenience of describing this document and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the invention. In the description herein, unless otherwise specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two elements, or direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0020] Embodiment 1 of the present invention provides an image processing method for endoscopic images, such as... Figure 1 As shown, it includes the following steps:
[0021] Step 101: Obtain the target reflective area of the endoscope image and repair the target reflective area to obtain the image inpaint_image;
[0022] Step 102: Perform detail enhancement processing on the image inpaint_image.
[0023] Here, in endoscopic images, reflective areas obscure the mucosa, interfering with the doctor's observation and review of the images. The image processing method in this embodiment first processes the reflective areas, and then performs detail enhancement processing, thereby achieving a good image enhancement effect.
[0024] In this embodiment of the invention, the target reflective area for acquiring the endoscopic image specifically includes:
[0025] The red channel image R_image, green channel image G_image, blue channel image B_image, and grayscale image Gray_image of the endoscope image are obtained; here, in the computer, the endoscope image is actually an M N The multidimensional matrix C represents the width of the endoscopic image (in pixels), the height of the endoscopic image (in pixels), and the number of channels. C is typically 3, meaning 3 channels (red, green, and blue). Therefore, when C=1, C=2, and C=3, we can obtain the red channel image R_image, the green channel image G_image, and the blue channel image B_image.
[0026] Here, in the RGB model, if R=G=B, then color represents a grayscale color, where the value of R=G=B is called the grayscale value. That is, if R=G=B of a certain image, then the image is a grayscale image. Optionally, the endoscopic image can be processed using the maximum value method, the average value method, or the weighted average method to obtain the grayscale image Gray_image.
[0027] like Figure 2 As shown, a reflective region specular_mask1 is generated based on R_image, G_image, B_image, and a preset threshold T1. A reflective region specular_mask2 is generated based on G_image, B_image, Gray_image, and a preset threshold T2. An OR operation is performed on specular_mask1 and specular_mask2 to obtain a reflective region specular_mask3. Adaptive threshold segmentation is performed on Gray_image to obtain a reflective region specular_mask4. An AND operation is performed on specular_mask3 and specular_mask4 to obtain the target reflective region. Here, the image AND operation refers to performing a binary AND operation on each pixel value of two images (grayscale or color images) to achieve image cropping; similarly, the image OR operation refers to performing a binary OR operation on each pixel value of two images (grayscale or color images) to achieve image cropping.
[0028] In this embodiment, as Figure 3 As shown, the generation of the reflective region specular_mask1 based on R_image, G_image, B_image and a preset threshold T1 specifically includes:
[0029] The endoscopic image image is denoised to obtain the image media_image, and the red channel image R_media_image, green channel image G_media_image, and blue channel image B_media_image of the image media_image are obtained.
[0030] , , In this context, mean() calculates the mean and std() calculates the standard deviation. Here, mean() calculates the average value of each pixel in the input image, and std() calculates the standard deviation of each pixel in the input image.
[0031] Here, median filtering can be used to denoise the endoscopic image to obtain the media_image, thereby filtering out noise in the image rows.
[0032] Generate the first temporary image The function `merge()` is used for image merging. It takes three images as input: a red channel image, a green channel image, and a blue channel image. Merging these three images yields the output image. The contrast coefficient of each channel is calculated to extract areas with high contrast (potentially reflective areas).
[0033] A second temporary image, `new_image_max`, is generated. The width of `new_image_max` is equal to the width of `new_image`, and the length of `new_image_max` is equal to the length of `new_image`. For any pixel `new_image_max_dot` in `new_image_max`, there exists a corresponding pixel `new_image_dot` in `new_image` at the same coordinates. T1 is a preset threshold, and max() outputs the maximum value of the R, G and B values of the input pixel; here, T1 can be used to filter out outliers.
[0034] Set the format of the second temporary image new_image_max to unit8, and obtain the reflective area specular_mask1 from the second temporary image new_image_max.
[0035] In this embodiment, as Figure 5 As shown, the generation of the reflective region specular_mask2 based on G_image, B_image, Gray_image and a preset threshold T2 specifically includes:
[0036] , Where P_G_image is the preset percentile of G_image, P_B_image is the preset percentile of B_image, and P_Gray_image is the preset percentile of Gray_image; here, the preset percentile can be used to distinguish the highlighted areas (especially when the preset percentile is relatively large).
[0037] Generate channel image new_Gray, channel image new_G, and channel image new_B. , , ,function The length of the output image (src, maxVal) is equal to the length of the image src, and the width of the output image is equal to the width of the image src. When the pixel value of any pixel in src is greater than maxVal, the pixel value of the corresponding pixel in the output image is 1, otherwise it is 0.
[0038] Convert new_Gray, new_G, and new_B to uint8 format and perform an OR operation to obtain the reflective area specular_mask2.
[0039] Optionally, P_G_image, P_B_image, and P_Gray_image are all 95th percentiles, meaning their values are all 95%.
[0040] In this embodiment, as Figure 4 As shown, the process of repairing the reflective area of the target to obtain the image inpaint_image specifically includes:
[0041] As shown in steps 401 and 402, morphological dilation is performed on the target reflective area to obtain the image `dilate_specular_mask`. Here, in the image, the boundary points of the binarized object are expanded, and all background points in contact with the object are merged into the object, causing the boundary to expand outward. If two objects are close together, they will be connected, thus achieving morphological dilation of the image. Here, dilation is used to blur the boundaries of the highlighted areas, making the repaired area look more natural.
[0042] As shown in step 403, traverse all contours in the image dilate_specular_mask and calculate the outer matrix corresponding to each contour.
[0043] As shown in steps 404 and 405, the following processing is performed on each outer matrix to obtain the preliminary repaired image inpaint_image1 corresponding to the traversed image dilate_specular_mask. The processing includes: obtaining the average value of R, G and B values of the non-reflective areas in the outer matrix as the fill color to fill the reflective areas in the outer matrix; assigning color values to each reflective area, with the assigned value being the average color value of the surrounding (outer rectangle) non-reflective areas. This is done to make the assigned color closer to the actual scene.
[0044] As shown in step 406, the initially repaired image inpaint_image1 is subjected to Gaussian blur processing to obtain the image gaussian_image. Gaussian blur is essentially a low-pass filter, and each pixel in the output image is the weighted sum of the corresponding pixel in the original image and its surrounding pixels. Gaussian blur blurs the image.
[0045] As shown in step 406, the traversed image `dilate_specular_mask` is linearly filtered to obtain the image `filter2d_image`. This linear filtering can include: box filtering, mean filtering, Gaussian filtering, and isolinear operators, etc. Linear filtering can perform convolutional blurring on the image.
[0046] ;
[0047] The image after repairing the reflective areas of the target is as follows: k represents the values of the three channels of the image (0, 1, 2). This step fuses the images and sharpens the areas that need to be repaired for reflections.
[0048] In this embodiment, as Figure 6 As shown, the detail enhancement processing of the image inpaint_image specifically includes:
[0049] As shown in steps 601 and 602, the image inpaint_image is subjected to Gamma enhancement processing to obtain the image gamma_image. Here, the correction effect of Gamma enhancement processing on the image is achieved by enhancing the details of low grayscale or high grayscale. The Gamma value is divided into two parts, with 1 as the dividing line. The smaller the value, the stronger the expansion effect on the low grayscale part of the image. The larger the value, the stronger the expansion effect on the high grayscale part of the image.
[0050] As shown in steps 603 and 604, the image gamma_image undergoes row contrast-limited adaptive histogram equalization to obtain the image clahe_gamma_image. Here, the histogram equalization method transforms the image into one with a uniform gray-level distribution through different gray-level distribution schemes. It extracts the gray-level mapping curve from the histogram and then transforms it to improve brightness. However, this method still has flaws, namely, it cannot enhance contrast, and in the process, it also amplifies noise signals. Taking AHE (Adaptive Histogram Equalization) as an example, this method divides the image into numerous small grid regions using grid lines and performs equalization on each grid. However, this method leads to image distortion, and its subtle noise is also amplified. Therefore, Contrast-Limited Adaptive Histogram Equalization (CLAHE) is proposed here, which limits the contrast of each partition unit, which is the difference between this method and the traditional AHE. CLAHE limits noise amplification and local contrast enhancement by limiting the height of the local histogram. This method divides the image into multiple sub-regions; then, it classifies the histogram of each sub-region. Next, it performs histogram equalization on each sub-region separately, and finally obtains the transformed grayscale value by interpolating each pixel, thereby achieving contrast-limited adaptive histogram equalization image enhancement. The CLAHE algorithm primarily targets the texture and edge information of the image.
[0051] like Figure 7 As shown in images 701, 702, 703, 704, and 705, the image clahe_gamma_image is processed by separating its channels. The R and G channel values are adjusted proportionally (1.2, 1.2) to obtain image aug_image1. The RGB channels of image aug_image1 are converted to HSV (Hue, Saturation, Value) channels to obtain image hsv_aug_image1. The S and V channel values are then adjusted proportionally (1.2, 0.8) to obtain image aug_image2. Image aug_image2 is then converted back to RGB three channels to obtain the image with enhanced details. Here, adjusting the RGB and HSV channels can further improve the contrast of blood vessels in the image.
[0052] Here, formulas can be used. To generate the image aug_image2.
[0053] Optionally, the denoising process of the endoscopic image to obtain the media_image specifically includes: performing median filtering on the endoscopic image to obtain the media_image. Here, median filtering is a non-linear smoothing technique that sets the gray value of each pixel to the median of the gray values of all pixels within a neighborhood window of that pixel. Median filtering is a non-linear signal processing technique based on sorting statistics theory that can effectively suppress noise. The basic principle of median filtering is to replace the value of a point in a digital image or digital sequence with the median of the values of all points in its neighborhood, making the surrounding pixel values closer to the true values, thereby eliminating isolated noise points. The method uses a two-dimensional sliding template of a certain structure to sort the pixels within the template according to their pixel values, generating a monotonically increasing (or decreasing) two-dimensional data sequence.
[0054] In this embodiment, acquiring the red channel image R_image, green channel image G_image, blue channel image B_image, and grayscale image Gray_image of the endoscope image specifically includes:
[0055] The endoscopic image is processed by channel separation to obtain a red channel image R_image, a green channel image G_image, and a blue channel image B_image. The endoscopic image is then processed by grayscale to obtain a grayscale image Gray_image.
[0056] Embodiment 2 of the present invention provides an image processing device for an endoscope image, comprising the following modules: a reflective area enhancement module, used to acquire the target reflective area of the endoscope image image and repair the target reflective area to obtain an image inpaint_image; and a detail enhancement module, used to perform detail enhancement processing on the image inpaint_image.
[0057] Embodiment 3 of the present invention provides a terminal, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the image processing method as described in Embodiment 1.
[0058] Embodiment 4 of the present invention provides a readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the image processing method as described in Embodiment 1.
[0059] It should be noted that although the steps are described in a specific order above, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently, or even in a different order, as long as the required function can be achieved.
[0060] This invention can be a system, method, and / or computer program product. A computer program product may include a readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.
[0061] A readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. Readable storage media can include, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof.
[0062] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. An image processing method for endoscopic images, characterized in that, Includes the following steps: The red channel image R_image, green channel image G_image, blue channel image B_image, and grayscale image Gray_image of the endoscope image are acquired. A reflective region specular_mask1 is generated based on R_image, G_image, B_image, and a preset threshold T1. A reflective region specular_mask2 is generated based on G_image, B_image, Gray_image, and a preset threshold T2. A bitwise OR operation is performed on specular_mask1 and specular_mask2 to obtain a reflective region specular_mask3. An adaptive threshold segmentation process is performed on Gray_image to obtain a reflective region specular_mask4. A bitwise AND operation is performed on specular_mask3 and specular_mask4 to obtain the target reflective region. The target reflective region is then repaired to obtain the image inpaint_image. Perform detail enhancement processing on the image inpaint_image.
2. The image processing method according to claim 1, characterized in that, The generation of the reflective region specular_mask1 based on R_image, G_image, B_image, and a preset threshold T1 specifically includes: The endoscopic image image is denoised to obtain the image media_image, and the red channel image R_media_image, green channel image G_media_image, and blue channel image B_media_image of the image media_image are obtained. , , Here, mean() calculates the mean, and std() calculates the standard deviation; Generate the first temporary image Here, merge() is used for image merging; A second temporary image, `new_image_max`, is generated. The width of `new_image_max` is equal to the width of `new_image`, and the length of `new_image_max` is equal to the length of `new_image`. For any pixel `new_image_max_dot` in `new_image_max`, there exists a corresponding pixel `new_image_dot` in `new_image` at the same coordinates. T1 is a preset threshold, and max() outputs the maximum value of the R, G and B values of the input pixel. Set the format of the second temporary image new_image_max to unit8, and obtain the reflective area specular_mask1 from the second temporary image new_image_max.
3. The image processing method according to claim 2, characterized in that, The generation of the reflective region specular_mask2 based on G_image, B_image, Gray_image, and a preset threshold T2 specifically includes: , Where P_G_image is the preset percentile of G_image, P_B_image is the preset percentile of B_image, and P_Gray_image is the preset percentile of Gray_image; Generate channel image new_Gray, channel image new_G, and channel image new_B. , , ,function The length of the output image (src, maxVal) is equal to the length of the image src, and the width of the output image is equal to the width of the image src. When the pixel value of any pixel in src is greater than maxVal, the pixel value of the corresponding pixel in the output image is 1; otherwise, it is 0. Convert new_Gray, new_G, and new_B to uint8 format and perform an OR operation to obtain the reflective area specular_mask2.
4. The image processing method according to claim 1, characterized in that, The process of repairing the reflective area of the target to obtain the image inpaint_image specifically includes: The image dilate_specular_mask is obtained by performing morphological dilation on the reflective area of the target. Iterate through all contours in the image's dilate_specular_mask and calculate the bounding matrix for each contour. The following processing is performed on each outer matrix to obtain the preliminary repaired image inpaint_image1 corresponding to the traversed image dilate_specular_mask. The processing includes: obtaining the average value of R, G and B values of the non-reflective area in the outer matrix as the fill color, and filling the reflective area in the outer matrix. Gaussian blur is applied to the initially repaired image inpaint_image1 to obtain the image gaussian_image; The image filter2d_image is obtained by performing linear filtering on the traversed image dilate_specular_mask. ; The image after repairing the reflective areas of the target is as follows: k represents the values of the three channels of the image (0, 1, 2).
5. The image processing method according to claim 1, characterized in that, The detailed enhancement processing of the image inpaint_image specifically includes: Gamma enhancement is applied to the image inpaint_image to obtain the image gamma_image; The image gamma_image is subjected to row contrast-limited adaptive histogram equalization to obtain the image clahe_gamma_image; The image clahe_gamma_image is processed by separating the channels, and the channel values of R and G are adjusted proportionally (1.2, 1.2) to obtain the image aug_image1; Convert the RGB channels of image aug_image1 to HSV channels to obtain image hsv_aug_image1. Adjust the S and V channel values by a ratio of (1.2, 0.8) to obtain image aug_image2. Convert the image aug_image2 back to RGB three channels to obtain an image with enhanced details.
6. The image processing method according to claim 1, characterized in that, The acquisition of the red channel image R_image, green channel image G_image, blue channel image B_image, and grayscale image Gray_image of the endoscope image specifically includes: The endoscopic image is processed by channel separation to obtain a red channel image R_image, a green channel image G_image, and a blue channel image B_image. The endoscopic image is then processed by grayscale to obtain a grayscale image Gray_image.
7. An image processing device for endoscopic images, characterized in that, Includes the following modules: The reflective region enhancement module is used to acquire the red channel image R_image, green channel image G_image, blue channel image B_image, and grayscale image Gray_image of the endoscope image. Based on R_image, G_image, B_image, and a preset threshold T1, it generates a reflective region specular_mask1. Based on G_image, B_image, Gray_image, and a preset threshold T2, it generates a reflective region specular_mask2. It performs an OR operation on specular_mask1 and specular_mask2 to obtain a reflective region specular_mask3. It performs adaptive threshold segmentation processing on Gray_image to obtain a reflective region specular_mask4. It performs an AND operation on specular_mask3 and specular_mask4 to obtain a target reflective region. Finally, it repairs the target reflective region to obtain the image inpaint_image. The detail enhancement module is used to enhance the details of the image inpaint_image.
8. A terminal, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the image processing method as described in any one of claims 1 to 6 when executing the computer program.
9. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the image processing method as described in any one of claims 1 to 6.