A method of processing electronic images of a digestive tract endoscope and related apparatus

By splitting endoscopic images into R, G, and B channels, determining the grayscale distribution data of the R channel and calculating the gain coefficient, and adjusting the brightness of each channel, the problem of uneven brightness in endoscopic images was solved, thereby improving image quality and the accuracy of lesion screening.

CN115797217BActive Publication Date: 2026-04-07INNERMEDICAL CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, the brightness of endoscopic images is uneven, which leads to the deterioration of details in dark areas and affects image quality.

Method used

The endoscopic image is split into R-channel, G-channel, and B-channel images. The gray-level distribution data of the R-channel is determined, several target gray levels are selected, the gain coefficient is calculated, and gain processing is performed on the images of each channel.

Benefits of technology

It improves the image quality of endoscopic images, especially the identification of details in dark areas, and enhances the sensitivity and accuracy of identifying intracavitary details and screening for lesions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115797217B_ABST
    Figure CN115797217B_ABST
Patent Text Reader

Abstract

This application discloses a method and related apparatus for processing electronic gastrointestinal endoscope images. The method includes determining the grayscale distribution data corresponding to the R-channel image; selecting several target grayscale levels based on the grayscale distribution data; calculating the gain coefficient corresponding to the endoscope image based on the several target grayscale levels; and performing gain merging on the R-channel image, G-channel image, and B-channel image based on the gain coefficient to obtain the processed endoscope image. This application determines the gain coefficient through the R-channel image and adjusts the images of each channel based on the gain coefficient. Due to the absorption and scattering characteristics of blood vessels and mucosal tissues in the human digestive tract to cold light illumination, the absorption capacity of mucosa and blood vessels for red light is relatively weaker than that for green and blue light. Therefore, the R-channel image in the endoscope image has a higher intensity than the G-channel and B-channel images. Thus, determining the gain coefficient based on the R-channel image to adjust the endoscope image can improve the image quality of the adjusted endoscope image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medical imaging, in particular to an electronic digestive tract endoscope image processing method and related device. BACKGROUND

[0002] The digestive tract endoscope is used for checking the digestive tract of human and animals, and the endoscopic image collected by the digestive tract endoscope is used for identifying the details in the cavity and screening the lesions. The image brightness of the endoscopic image affects the sensitivity and accuracy of the identification of the details in the cavity and the screening of the lesions. Therefore, after the endoscopic image is acquired, the brightness of the endoscopic image needs to be processed.

[0003] At present, the image brightness processing method of the endoscopic image mainly adjusts the gray scale of the original endoscopic image in a nonlinear manner to brighten the dark area and flatten the bright area while keeping the color constant. Although this method can adjust the image brightness of the endoscopic image, it has the problems of uneven brightness balance, deterioration of dark area details, and thus affects the image quality of the adjusted endoscopic image.

[0004] Therefore, the prior art still needs to be improved and enhanced. SUMMARY

[0005] The technical problem to be solved by the present application is to provide an electronic digestive tract endoscope image processing method and related device to solve the problems of the prior art.

[0006] To solve the above technical problems, the first aspect of the present application provides an electronic digestive tract endoscope image processing method, which comprises:

[0007] Splitting the endoscopic image into three single-channel images, wherein the three single-channel images include R-channel images, G-channel images and B-channel images;

[0008] Determining the gray scale distribution data corresponding to the R-channel image, and selecting a plurality of target gray scale levels according to the gray scale distribution data;

[0009] Calculating the gain coefficient corresponding to the endoscopic image according to the plurality of target gray scale levels;

[0010] Gain processing the R-channel image, the G-channel image and the B-channel image according to the gain coefficient, and merging the gain-processed R-channel image, the G-channel image and the B-channel image to obtain a processed endoscopic image.

[0011] The electronic digestive tract endoscope image processing method, wherein the endoscopic image is a YUV image collected by an electronic digestive tract endoscope; before splitting the endoscopic image into three single-channel images, the method comprises:

[0012] The endoscopic image is converted into an endoscopic image in RGB format.

[0013] The method for processing electronic gastrointestinal endoscope images, wherein determining the grayscale distribution data corresponding to the R channel image specifically involves:

[0014] Calculate the grayscale histogram of the R-channel image, and calculate the grayscale distribution data based on the grayscale histogram.

[0015] The method for processing electronic gastrointestinal endoscopic images, wherein selecting several target gray levels based on the grayscale distribution data specifically includes:

[0016] Obtain several preset grayscale distribution probability values;

[0017] For each grayscale distribution probability value, select the target grayscale level corresponding to the grayscale distribution probability value from the grayscale distribution data to obtain several target grayscale levels.

[0018] The method for processing electronic gastrointestinal endoscope images, wherein the plurality of grayscale distribution probability values ​​include 0.3, 0.5, 0.7 and 0.99.

[0019] The method for processing electronic gastrointestinal endoscope images, wherein calculating the gain coefficient corresponding to the endoscope image based on several target grayscale levels specifically includes:

[0020] The lower limit and upper limit of gray level gain are calculated based on several target gray level values, and the gamma coefficient corresponding to the endoscopic image and the maximum gray level corresponding to the R channel image are obtained.

[0021] For each gray level, the target gain coefficient corresponding to the pixel is determined based on the gamma coefficient, the maximum gray level, the upper limit of gray level gain, the lower limit of gray level gain, and the gray level, so as to obtain the gain coefficient corresponding to the endoscopic image.

[0022] The method for processing electronic gastrointestinal endoscopic images, wherein the step of increasing the gain of the R-channel image, G-channel image, and B-channel image according to the gain coefficient specifically includes:

[0023] For each pixel in the R-channel image, G-channel image, and B-channel image, the target gain coefficient corresponding to the pixel is selected from the gain coefficients;

[0024] The target gain coefficient is multiplied by the gray value of the pixel to obtain the gained R-channel image, G-channel image, and B-channel image.

[0025] A second aspect of this application provides a system for processing electronic gastrointestinal endoscopic images, the system comprising:

[0026] The splitting module is used to split the endoscopic image into three single-channel images, wherein the three single-channel images include an R-channel image, a G-channel image, and a B-channel image;

[0027] The selection module is used to determine the grayscale distribution data corresponding to the R channel image, and select several target grayscale levels based on the grayscale distribution data;

[0028] The calculation module is used to calculate the gain coefficient corresponding to the endoscopic image based on several target gray levels;

[0029] The gain module is used to gain the R-channel image, G-channel image and B-channel image according to the gain coefficient, and then merge the gained R-channel image, G-channel image and B-channel image to obtain the processed endoscopic image.

[0030] A third aspect of this application provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps in the electronic gastrointestinal endoscope image processing method as described above.

[0031] A fourth aspect of this application provides a terminal device, which includes: a processor, a memory, and a communication bus; the memory stores a computer-readable program that can be executed by the processor;

[0032] The communication bus enables communication between the processor and the memory;

[0033] When the processor executes the computer-readable program, it implements the steps in the electronic gastrointestinal endoscope image processing method as described above.

[0034] Beneficial Effects: Compared with existing technologies, this application provides a method and related apparatus for processing electronic gastrointestinal endoscopic images. The method includes splitting the endoscopic image into three single-channel images; determining the grayscale distribution data corresponding to the R-channel image, and selecting several target grayscale levels based on the grayscale distribution data; calculating the gain coefficient corresponding to the endoscopic image based on the several target grayscale levels; increasing the gain of the R-channel image, G-channel image, and B-channel image based on the gain coefficient, and merging the increased R-channel image, G-channel image, and B-channel image to obtain the processed endoscopic image. This application determines the gain coefficient through the R-channel image, and then adjusts each channel image using the gain coefficient. Due to the absorption and scattering characteristics of blood vessels and mucosal tissues in the human digestive tract for cold light source illumination, the absorption capacity of mucosa and blood vessels for red light is relatively weaker than that for green and blue light. Therefore, the R-channel image in the endoscopic image has a higher intensity than the G-channel and B-channel images. Thus, by determining the gain coefficient based on the R-channel image to adjust the endoscopic image, the image quality of the adjusted endoscopic image can be improved. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0036] Figure 1 A flowchart of the method for processing electronic gastrointestinal endoscope images provided in this application.

[0037] Figure 2 This is an example image of an endoscope.

[0038] Figure 3 for Figure 2 The R-channel image obtained by splitting the endoscopic image shown.

[0039] Figure 4 for Figure 2 The image shown is the G-channel image obtained by splitting the endoscopic image.

[0040] Figure 5 for Figure 2 The image shown is the B-channel image obtained by splitting the endoscopic image.

[0041] Figure 6 This is an example image of the grayscale histogram for the R channel.

[0042] Figure 7 This is a schematic diagram for determining several target gray levels based on gray level distribution data.

[0043] Figure 8 This is an example graph of the gain coefficient curve.

[0044] Figure 9 An example image of an unprocessed endoscope.

[0045] Figure 10 for Figure 9 The image shown is a processed version of the endoscopic image.

[0046] Figure 11 A schematic diagram of the structural principle of the electronic gastrointestinal endoscope image processing system provided in this application.

[0047] Figure 12 A schematic diagram of the terminal device provided in this application. Detailed Implementation

[0048] This application provides a method and related apparatus for processing electronic gastrointestinal endoscopic images. To make the objectives, technical solutions, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.

[0049] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0050] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0051] It should be understood that the sequence number and size of each step in this embodiment do not imply the order of execution. The execution order of each process is determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.

[0052] Research has shown that gastrointestinal endoscopes are used to examine the digestive tracts of humans and animals. Endoscopic images acquired through these endoscopes are crucial for identifying details within the lumen and screening for lesions. However, the brightness of these images affects the sensitivity and accuracy of this identification and lesion screening. Therefore, after acquiring endoscopic images, their brightness needs to be processed.

[0053] Current methods for processing endoscopic images primarily involve non-linearly adjusting the grayscale of the original endoscopic image to brighten dark areas, smooth out bright areas, and maintain color consistency. While this method can adjust the brightness of endoscopic images, it suffers from uneven brightness distribution, deteriorates details in dark areas, and consequently affects the image quality of the adjusted endoscopic image.

[0054] To address the aforementioned issues, in this embodiment, the endoscopic image is split into three single-channel images; the grayscale distribution data corresponding to the R-channel image is determined, and several target grayscale levels are selected based on the grayscale distribution data; the gain coefficient corresponding to the endoscopic image is calculated based on the several target grayscale levels; the R-channel image, G-channel image, and B-channel image are amplified based on the gain coefficient, and the amplified R-channel image, G-channel image, and B-channel image are merged to obtain the processed endoscopic image. This application determines the gain coefficient using the R-channel image, and then adjusts each channel image using the gain coefficient. Due to the absorption and scattering characteristics of blood vessels and mucosal tissues in the human digestive tract for cold light sources, the absorption capacity of mucosa and blood vessels for red light is relatively weaker than that for green and blue light. Therefore, the R-channel image in the endoscopic image has a higher intensity than the G-channel and B-channel images. Thus, by determining the gain coefficient based on the R-channel image to adjust the endoscopic image, the image quality of the adjusted endoscopic image can be improved.

[0055] The application content will be further explained below with reference to the accompanying drawings and the description of the embodiments.

[0056] This embodiment provides a method for processing images from an electronic gastrointestinal endoscope, such as... Figure 1 As shown, the method includes:

[0057] S10. Split the endoscopic image into three single-channel images.

[0058] Specifically, the endoscopic image is an RGB format image. The RGB color format is obtained by varying the red (R), green (G), and blue (B) color channels and superimposing them. R represents the red channel, B represents the green channel, and G represents the blue channel. Therefore, when the endoscopic image is split into three single-channel images, these three single-channel images are the R channel image, the G channel image, and the B channel image. For example, as... Figure 2 The endoscopic image is split into the following: Figure 3 The R channel image shown is as follows: Figure 4 The G-channel image shown and as Figure 5 The image shown is the B channel image.

[0059] Furthermore, the endoscopic images are acquired using an electronic gastrointestinal endoscope. These images can be acquired in real-time, stored in a storage device, or transmitted from an external device. However, in practical applications, the endoscopic images acquired in real-time by electronic gastrointestinal endoscopes are generally YUV images. Therefore, before splitting the endoscopic image into three single-channel images, it is necessary to detect whether the endoscopic image is in RGB format. If the endoscopic image is not in RGB format, it needs to be converted to RGB format.

[0060] Based on this, when the endoscopic image is a raw endoscopic image acquired through an electronic gastrointestinal endoscope, i.e., the endoscopic image is a YUV image, the method includes the following steps before splitting the endoscopic image into three single-channel images:

[0061] The endoscopic image is converted into an endoscopic image in RGB format.

[0062] Specifically, YUV is a type of true-color color space. Technical terms such as Y'UV, YUV, YCbCr, and YPbPr can all be referred to as YUV. Here, "Y" represents luminance (or luma), i.e., grayscale value, while "U" and "V" represent chrominance (or chroma), used to specify the color of a pixel. Converting the endoscopic image to an RGB format endoscopic image refers to converting a YUV format endoscopic image to an RGB format endoscopic image. Existing conversion formulas can be used for YUV to RGB conversion, which will not be detailed here.

[0063] S20. Determine the grayscale distribution data corresponding to the R channel image, and select several target grayscale levels based on the grayscale distribution data.

[0064] Specifically, grayscale distribution data is used to determine the distribution of grayscale levels of each pixel in the R-channel image. This grayscale distribution data is determined based on the probability distribution function of the histogram of the R-channel image. The grayscale distribution data can be calculated based on the grayscale histogram of the R-channel image. Therefore, determining the grayscale distribution data corresponding to the R-channel image specifically involves:

[0065] Calculate the grayscale histogram of the R-channel image, and calculate the grayscale distribution data based on the grayscale histogram.

[0066] Specifically, the grayscale histogram is a statistical representation of the distribution of gray levels in the endoscopic image, reflecting the frequency of occurrence of each gray level in the image. The grayscale histogram can be obtained by statistically analyzing the frequency of each pixel in the endoscopic image according to its gray value. For example, the grayscale histogram of an R-channel image is as follows: Figure 6 As shown.

[0067] The grayscale distribution data is obtained by calculating the cumulative density function of the grayscale histogram. The formula for calculating the cumulative density function is as follows:

[0068]

[0069] Where H(s) represents the gray-level histogram, f(s) represents the cumulative density function, s represents the gray level, N represents the number of pixels in the endoscopic image, and S represents the maximum gray level corresponding to the endoscopic image, S = 2. bit wide -1, bit wide represents the signal bit width corresponding to the endoscopic image. For example, when the signal bit width is 8 bits, S = 255.

[0070] Furthermore, each of the target gray levels is different from the others, and each target gray level corresponds to a gray level distribution probability value in the gray level distribution data. In other words, selecting several target gray levels based on the gray level distribution data means selecting several gray level distribution probability values ​​in the gray level distribution data, and then determining the gray level corresponding to each gray level distribution probability value to obtain several target gray levels.

[0071] Based on this, in one implementation, selecting several target gray levels according to the grayscale distribution data specifically includes:

[0072] Obtain several preset grayscale distribution probability values;

[0073] For each grayscale distribution probability value, select the target grayscale level corresponding to the grayscale distribution probability value from the grayscale distribution data to obtain several target grayscale levels.

[0074] Specifically, each of the several grayscale distribution probability values ​​is preset and can be determined according to actual usage. In a typical implementation, the several grayscale distribution probability values ​​include four grayscale distribution probability values, namely 0.3, 0.5, 0.7, and 0.99.

[0075] After determining several grayscale distribution probability values, the target grayscale level corresponding to each grayscale distribution probability value is selected from the grayscale distribution data. For example, ... Figure 7 As shown, several gray-level probability values ​​are distributed as 0.3, 0.5, 0.7, and 0.99. Therefore, the gray levels of several targets are s30 = f - 1 (y=0.3), s50=f- 1 (y=0.5), s70=f- 1 (y = 0.7), and s99 = f-1 (y = 0.99).

[0076] S30. Calculate the gain coefficient corresponding to the endoscopic image based on several target gray levels.

[0077] Specifically, the gain coefficient is used to adjust the grayscale values ​​of the R-channel, G-channel, and B-channel images. The gain coefficients for the R-channel, G-channel, and B-channel images are identical, all calculated based on several target grayscale levels determined by the R-channel image. By using gain coefficients determined based on several target grayscale levels from the R-channel image to adjust the grayscale of the R-channel, G-channel, and B-channel images respectively, the image quality of the processed endoscopic image based on the adjusted R-channel, G-channel, and B-channel images can be improved. Because of the absorption and scattering characteristics of blood vessels and mucosal tissues in the human digestive tract to cold light illumination, the absorption capacity of mucosa and blood vessels for red light is relatively weaker than that for green and blue light. Therefore, the R component of the light intensity reflected to the optical sensor is higher than the G and B components. Thus, determining the gain coefficient based on the R-channel image can improve the accuracy of the gain coefficient, thereby allowing the endoscopic image after gaining based on the gain coefficient to more clearly highlight the dark details within the cavity.

[0078] In one implementation, calculating the gain coefficient corresponding to the endoscopic image based on several target gray levels specifically includes:

[0079] The lower limit and upper limit of gray level gain are calculated based on several target gray level values, and the gamma coefficient corresponding to the endoscopic image and the maximum gray level corresponding to the R channel image are obtained.

[0080] For each gray level, the target gain coefficient corresponding to the pixel is determined based on the gamma coefficient, the maximum gray level, the lower limit of gray level gain, the lower limit of gray level gain, and the gray level, so as to obtain the gain coefficient corresponding to the endoscopic image.

[0081] Specifically, the gamma coefficient is used for gamma correction of the endoscopic image. This gamma coefficient can be preset or determined based on the endoscopic image; no specific restriction is imposed here. The maximum grayscale level is determined based on the signal bit width corresponding to the endoscopic image, where the maximum grayscale level S = 2. bit wide -1, bit wide represents the signal bit width corresponding to the endoscopic image. For example, when the signal bit width is 8 bits, S = 255.

[0082] Both the lower and upper limits of grayscale gain are calculated based on several target grayscale levels, and the lower limit of grayscale gain is not equal to the upper limit of grayscale gain. In one implementation, the target grayscale levels include four target grayscale levels, which are designated as target grayscale level 1, target grayscale level 2, target grayscale level 3, and target grayscale level 4 in ascending order of their corresponding grayscale distribution probability values. The calculation formulas for the lower limit of grayscale gain (base) and the upper limit of grayscale gain (peak) are as follows:

[0083] base = max(-s2, s1 - a(s3 - s1))

[0084] peak = min(s4, s3 + b(s3 - s1))

[0085] Where s1 represents target gray level 1, s2 represents target gray level 2, s3 represents target gray level 3, s4 represents target gray level 4, and a and b represent known coefficients.

[0086] Of course, it is worth noting that in other implementations, the target gray levels may include other numbers of target gray levels, such as 3, 5, etc., and the calculation methods for the lower limit of gray level gain and the upper limit of gray level gain may also be different. For example, the lower limit of gray level gain may be determined based on the minimum value among the target gray levels, and the upper limit of gray level gain may be determined based on the maximum value among the target gray levels, etc.

[0087] In one specific implementation, several target gray levels include gray levels corresponding to gray distribution probability values ​​of 0.3, 0.5, 0.7, and 0.99, denoted as s. 30 s 50 s 70 and s 99The grayscale gain lower limit (base) and grayscale gain upper limit (peak) are respectively:

[0088] base = max(-s) 50 ,s 30 -4·(s 70 -s 30 ))

[0089] peak = min(s) 99 ,s 70 +2.5·(s 70 -s 30 )).

[0090] Furthermore, after obtaining the lower limit of grayscale gain, the upper limit of grayscale gain, the gamma coefficient, and the maximum grayscale level, the gain coefficient is calculated based on these parameters. The gain coefficient is represented by a gain coefficient curve; for example, the gain coefficient might be as follows: Figure 9 The gain coefficient curve, wherein each target gain coefficient in the gain coefficient curve corresponds to a gray level, and the gray levels corresponding to each target gain coefficient are different. The gray levels in the gain coefficient curve are the maximum gray levels corresponding to the R channel image from 0. In a typical implementation, the formula for calculating the gain coefficient can be:

[0091]

[0092] Where s∈[0,S] represents gray level; S represents the maximum gray level corresponding to the R channel image; g∈[0,1] represents the gamma coefficient; α and β represent normalization coefficients, α, β∈[0,1], α+β=1; base represents the lower limit of gray level gain, and peak represents the upper limit of gray level gain.

[0093] In this embodiment, the gain coefficient is determined based on the gamma coefficient, the lower limit of the grayscale gain, and the upper limit of the grayscale gain. This combination of gamma-corrected gain coefficient and histogram stretching gain coefficient enhances images with uneven illumination, resulting in high-quality, brightness-uniform endoscopic images. This aids in the screening of digestive tract diseases and reduces the occurrence of missed diagnoses.

[0094] S40. The R-channel image, G-channel image and B-channel image are amplified according to the gain coefficient, and the amplified R-channel image, G-channel image and B-channel image are merged to obtain the processed endoscopic image.

[0095] Specifically, the R-channel, G-channel, and B-channel images are all augmented using gain coefficients determined based on the R-channel image. Due to the absorption and scattering characteristics of blood vessels and mucous membranes in the human digestive tract to cold light sources, the absorption of red light by mucous membranes and blood vessels is relatively weaker than that of green and blue light. Therefore, the R-channel image in the endoscopic image has a higher intensity than the G-channel and B-channel images. Using the R-channel image to determine the gain coefficients for the G-channel and B-channel images ensures the image quality after augmentation and avoids interference from other color channels when processing one color channel image. This avoids the problem of inaccurate identification of low, medium, and high illumination areas caused by directly processing undivided endoscopic images, thus improving image quality in dark areas. Furthermore, eliminating the need to calculate the gain coefficients of the G-channel and B-channel images reduces the calculation steps, making the processing method provided in this embodiment simple, efficient, and easy to implement in hardware.

[0096] In one implementation, the step of gaining the R-channel image, G-channel image, and B-channel image according to the gain coefficient, and then merging the gained R-channel image, G-channel image, and B-channel image to obtain the processed endoscopic image specifically includes:

[0097] For each pixel in the R-channel image, G-channel image, and B-channel image, the target gain coefficient corresponding to the pixel is selected from the gain coefficients;

[0098] The target gain coefficient is multiplied by the gray value of the pixel to obtain the gained R-channel image, G-channel image, and B-channel image.

[0099] Specifically, for each pixel in the R-channel, G-channel, and B-channel images, the gray value of that pixel can be used as the corresponding gray level s, and the target gain coefficient corresponding to the gray level is L(s). The gray value of the pixel in the R-channel image is denoted as R(s), the gray value of the pixel in the G-channel image is denoted as G(s), and the gray value of the pixel in the B-channel image is denoted as B(s). The gained R-channel image is denoted as RL. new (s), the gained G channel image is denoted as G. new (s), the amplified B-channel image is denoted as B. new (s), where R new (s), G new (s) and B new (s) can be represented as:

[0100] R new (s)=R(s)·L(s)

[0101] G new(s)=G(s)·L(s)

[0102] B new (s)=B(s)·L(s)

[0103] After acquiring the amplified R-channel, G-channel, and B-channel images, these images are merged to obtain the processed endoscopic image. This merging of the three single-color channels further enhances the image processing effect, resulting in an endoscopic image with both high contrast and high clarity, enabling users to efficiently identify tissues within endoscopic cavities. For example... Figure 9 The endoscopic images shown can be processed using the processing method provided in this embodiment to obtain the following: Figure 10 The endoscopic images shown are from Figure 9 and Figure 10 It is clear that the clarity of the processed endoscopic image is higher than that of the unprocessed endoscopic image, and the details in the dark areas of the endoscopic image can be clearly seen.

[0104] In summary, this embodiment provides a method and related apparatus for processing electronic gastrointestinal endoscopic images. The method includes splitting the endoscopic image into three single-channel images; determining the grayscale distribution data corresponding to the R-channel image and selecting several target grayscale levels based on the grayscale distribution data; calculating the gain coefficient corresponding to the endoscopic image based on the several target grayscale levels; applying gain to the R-channel image, G-channel image, and B-channel image based on the gain coefficient; and merging the gained R-channel image, G-channel image, and B-channel image to obtain the processed endoscopic image. This application determines the gain coefficient through the R-channel image and then adjusts each channel image using the gain coefficient. Due to the absorption and scattering characteristics of blood vessels and mucosal tissues in the human digestive tract for cold light illumination, the absorption capacity of mucosa and blood vessels for red light is relatively weaker than that for green and blue light. Therefore, the R-channel image in the endoscopic image has a higher intensity than the G-channel and B-channel images. Thus, by determining the gain coefficient based on the R-channel image to adjust the endoscopic image, the image quality of the adjusted endoscopic image can be improved.

[0105] Based on the above-described method for processing electronic gastrointestinal endoscopic images, this embodiment provides a system for processing electronic gastrointestinal endoscopic images, such as... Figure 11 As shown, the system includes:

[0106] The splitting module 100 is used to split the endoscopic image into three single-channel images, wherein the three single-channel images include an R-channel image, a G-channel image, and a B-channel image;

[0107] The selection module 200 is used to determine the grayscale distribution data corresponding to the R channel image, and select several target grayscale levels based on the grayscale distribution data;

[0108] The calculation module 300 is used to calculate the gain coefficient corresponding to the endoscopic image based on several target gray levels;

[0109] The gain module 400 is used to gain the R-channel image, G-channel image and B-channel image according to the gain coefficient, and to merge the gained R-channel image, G-channel image and B-channel image to obtain the processed endoscopic image.

[0110] Based on the above-described method for processing electronic gastrointestinal endoscopic images, this embodiment provides a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the steps in the electronic gastrointestinal endoscopic image processing method described in the above embodiment.

[0111] Based on the above-described method for processing electronic gastrointestinal endoscopic images, this application also provides a terminal device, such as... Figure 12 As shown, it includes at least one processor 20; a display screen 21; and a memory 22, and may also include a communications interface 23 and a bus 24. The processor 20, display screen 21, memory 22, and communications interface 23 can communicate with each other via the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setup mode. The communications interface 23 can transmit information. The processor 20 can invoke logical instructions in the memory 22 to execute the methods described in the above embodiments.

[0112] Furthermore, the logical instructions in the aforementioned memory 22 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0113] The memory 22, as a computer-readable storage medium, can be configured to store software programs, computer-executable programs, such as program instructions or modules corresponding to the methods in the embodiments of this disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions, or modules stored in the memory 22, thereby implementing the methods in the above embodiments.

[0114] The memory 22 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 22 may include high-speed random access memory (RAM) and non-volatile memory. Examples include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, as well as transient storage media.

[0115] Furthermore, the specific process of loading and executing multiple instruction processors in the aforementioned storage medium and terminal device has been described in detail in the above method, and will not be repeated here.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for processing images from an electronic gastrointestinal endoscope, characterized in that, The method includes: The endoscopic image is split into three single-channel images, wherein the three single-channel images include an R-channel image, a G-channel image, and a B-channel image; Determine the grayscale distribution data corresponding to the R channel image, and select several target grayscale levels based on the grayscale distribution data; Calculate the gain coefficient corresponding to the endoscopic image based on several target gray levels; The R-channel image, G-channel image, and B-channel image are amplified according to the gain coefficient, and the amplified R-channel image, G-channel image, and B-channel image are merged to obtain the processed endoscopic image. Specifically, calculating the gain coefficient corresponding to the endoscopic image based on several target gray levels includes: The lower limit and upper limit of gray level gain are calculated based on several target gray level values, and the gamma coefficient corresponding to the endoscopic image and the maximum gray level corresponding to the R channel image are obtained. The gain coefficient is calculated based on the lower limit of gray level gain, the upper limit of gray level gain, the gamma coefficient, and the maximum gray level. The target gain coefficient corresponding to the pixel is determined based on the gray level and the gain coefficient. The formula for calculating the gain coefficient is as follows: Where s∈[0,S] represents gray level; S represents the maximum gray level corresponding to the R channel image; g∈[0,1] represents the gamma coefficient; α and β represent normalization coefficients, α, β∈[0,1], α+β=1; base represents the lower limit of gray level gain, and peak represents the upper limit of gray level gain.

2. The method for processing electronic gastrointestinal endoscopic images according to claim 1, characterized in that, The endoscopic images are YUV images acquired using an electronic gastrointestinal endoscope; Before splitting the endoscopic image into three single-channel images, the method includes: The endoscopic image is converted into an endoscopic image in RGB format.

3. The method for processing electronic gastrointestinal endoscopic images according to claim 1, characterized in that, The specific steps for determining the grayscale distribution data corresponding to the R channel image are as follows: Calculate the grayscale histogram of the R-channel image, and calculate the grayscale distribution data based on the grayscale histogram.

4. The method for processing electronic gastrointestinal endoscopic images according to claim 1, characterized in that, The step of selecting several target gray levels based on the gray distribution data specifically includes: Obtain several preset grayscale distribution probability values; For each grayscale distribution probability value, select the target grayscale level corresponding to the grayscale distribution probability value from the grayscale distribution data to obtain several target grayscale levels.

5. The method for processing electronic gastrointestinal endoscopic images according to claim 4, characterized in that, The grayscale distribution probability values ​​include 0.3, 0.5, 0.7, and 0.

99.

6. The method for processing electronic gastrointestinal endoscopic images according to claim 1, characterized in that, The specific steps of gaining the R-channel image, G-channel image, and B-channel image according to the gain coefficient include: For each pixel in the R-channel image, G-channel image, and B-channel image, the target gain coefficient corresponding to the pixel is selected from the gain coefficients; The target gain coefficient is multiplied by the gray value of the pixel to obtain the gained R-channel image, G-channel image, and B-channel image.

7. A system for processing images from an electronic gastrointestinal endoscope, characterized in that, The system includes: The splitting module is used to split the endoscopic image into three single-channel images, wherein the three single-channel images include an R-channel image, a G-channel image, and a B-channel image; The selection module is used to determine the grayscale distribution data corresponding to the R channel image, and select several target grayscale levels based on the grayscale distribution data; The calculation module is used to calculate the gain coefficient corresponding to the endoscopic image based on several target gray levels; The gain module is used to gain the R-channel image, G-channel image and B-channel image according to the gain coefficient, and then merge the gained R-channel image, G-channel image and B-channel image to obtain the processed endoscopic image. Specifically, calculating the gain coefficient corresponding to the endoscopic image based on several target gray levels includes: The lower limit and upper limit of gray level gain are calculated based on several target gray level values, and the gamma coefficient corresponding to the endoscopic image and the maximum gray level corresponding to the R channel image are obtained. The gain coefficient is calculated based on the lower limit of gray level gain, the upper limit of gray level gain, the gamma coefficient, and the maximum gray level. The target gain coefficient corresponding to the pixel is determined based on the gray level and the gain coefficient. The formula for calculating the gain coefficient is as follows: Where s∈[0,S] represents gray level; S represents the maximum gray level corresponding to the R channel image; g∈[0,1] represents the gamma coefficient; α and β represent normalization coefficients, α, β∈[0,1], α+β=1; base represents the lower limit of gray level gain, and peak represents the upper limit of gray level gain.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps in the method for processing electronic gastrointestinal endoscopic images as described in any one of claims 1-6.

9. A terminal device, characterized in that, include: Processor, memory, and communication bus; The memory stores a computer-readable program that can be executed by the processor; The communication bus enables communication between the processor and the memory; When the processor executes the computer-readable program, it implements the steps of the method for processing electronic gastrointestinal endoscopic images as described in any one of claims 1-6.

Citation Information

Patent Citations

  • High-fidelity image mapping algorithm for electronic paper display

    CN114926376A

  • Electronic alimentary canal endoscope image processing method and device and electronic equipment

    CN115063398A