Endoscope image enhancement method and device, electronic equipment and storage medium
By adjusting the channel parameters and feature fusion of endoscopic images, combined with dynamic threshold segmentation, the problems of low processing efficiency and insufficient clarity of endoscopic images were solved, achieving accurate segmentation and enhancement of blood vessels and mucosal regions, and improving image processing efficiency and clarity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI SHIXIN MEDICAL TECH CO LTD
- Filing Date
- 2026-04-02
- Publication Date
- 2026-07-24
AI Technical Summary
Existing endoscopic image processing technologies suffer from low image processing efficiency and insufficient clarity, especially in bleeding point detection. Red dual-color imaging technology requires switching light sources, which affects efficiency, while deep learning methods have high computational complexity and require a large amount of labeled data.
By adjusting image channel parameters, grayscale image features are extracted and fused. Dynamic feature weighting coefficients and dual threshold segmentation are used to determine blood vessel and mucosal regions. Channel parameters are adjusted to enhance image processing, thereby improving image clarity and efficiency.
While ensuring the accuracy of image enhancement processing, it improves the efficiency and clarity of endoscopic image processing, especially in the detection of bleeding points, by enhancing the contrast between blood vessels and mucosal areas.
Smart Images

Figure CN121961964B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to methods, apparatus, electronic devices and storage media for enhancing endoscopic images. Background Technology
[0002] An endoscope is a medical device that integrates optics, electronics, and precision mechanics. Its core function is to enter the body through natural cavities or tiny incisions to collect real-time images of the cavities and organs and transmit them to an external display terminal, which can help doctors to observe lesions directly.
[0003] To ensure the clarity and accuracy of the images, the processor needs to enhance the images acquired by the image acquisition elements in the endoscope, improve the visibility of the field of view in endoscopic imaging, and enhance the difference between the bleeding point and the surrounding area. These are urgent problems to be solved.
[0004] In existing technologies, red dichromatic imaging (RDI) (Reference 1 (CN201880070109.9)) can be used to process acquired endoscopic images, or a deep learning-based method for detecting gastrointestinal bleeding in endoscopic images (Reference 2 (CN201910135020.2)) can be used to construct a detection model and improve the accuracy of bleeding point location through feature fusion and bounding box regression algorithms. However, RDI technology requires multiple light sources with different spectra, and different light sources need to be switched during use, which takes a long time and affects image processing efficiency. Using deep learning methods, image features are learned through a large amount of labeled data to achieve more accurate image segmentation and coloring, but there are problems such as high computational complexity, the need for a large amount of labeled data, and low image processing efficiency. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a method, apparatus, electronic device and storage medium for enhancing endoscopic images, thereby improving the overall image clarity and reducing a large number of data processing steps, while ensuring the accuracy of image enhancement processing and improving image processing efficiency.
[0006] In a first aspect, embodiments of this application provide a method for enhancing endoscopic images, the enhancement method comprising:
[0007] Acquire a first image captured by the image acquisition element in the endoscope, adjust the channel parameters of the image channel of the first image, and determine the adjusted second image;
[0008] Extract multiple image features from the grayscale image corresponding to the first image, and fuse the multiple image features according to dynamically determined feature weight coefficients to obtain the third image;
[0009] The third image is segmented according to the determined first threshold and second threshold, the region selection module in the third image is determined, and the blood vessel region and mucosa region in the third image are extracted based on the region selection module; wherein, the first threshold and the second threshold are determined according to the average gray level of the third image and the gray level variance of the third image;
[0010] The image processing mode is determined, and based on the parameter adjustment factor corresponding to the image processing mode, the channel parameters in the blood vessel region and the mucosa region are adjusted respectively, and the adjusted target channel value is determined.
[0011] Based on the target channel values in the vascular region and the mucosal region, the second image is adjusted to determine the enhanced target image.
[0012] Secondly, embodiments of this application also provide an endoscope image enhancement device, the enhancement device comprising:
[0013] The image adjustment module is used to acquire a first image captured by the image acquisition element in the endoscope, adjust the channel parameters of the image channel of the first image, and determine the adjusted second image.
[0014] The image feature extraction module is used to extract multiple image features of the grayscale image corresponding to the first image, and fuse the multiple image features according to dynamically determined feature weight coefficients to obtain the third image;
[0015] The image segmentation module is used to segment the third image according to a determined first threshold and a second threshold, determine the region selection module in the third image, and extract the blood vessel region and mucosa region in the third image based on the region selection module.
[0016] The numerical adjustment module is used to determine the image processing mode and, based on the parameter adjustment factor corresponding to the image processing mode, adjust the channel parameters in the blood vessel region and the mucosa region respectively, and determine the adjusted target channel value.
[0017] The target image determination module is used to adjust the second image based on the target channel values in the blood vessel region and the mucosa region to determine the enhanced target image.
[0018] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the endoscopic image enhancement method as described in any of the first aspects.
[0019] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the endoscopic image enhancement method as described in any of the first aspects.
[0020] The endoscopic image enhancement method, apparatus, electronic device, and storage medium provided in this application embodiment acquire a first image captured by an image acquisition element in an endoscope; adjust the channel parameters of the image channels of the first image to determine an adjusted second image; extract multiple image features of the grayscale image corresponding to the first image, and fuse the multiple image features according to dynamically determined feature weight coefficients to obtain a third image; perform segmentation processing on the third image according to a determined first threshold and a second threshold to determine the vascular region and mucosal region in the third image; determine an image processing mode, and adjust the channel parameters in the vascular region and mucosal region respectively based on the parameter adjustment factor corresponding to the image processing mode to determine the adjusted target channel value; and perform segmentation processing based on the vascular region and mucosal region. The target channel value is adjusted in the second image to determine the enhanced target image. This process involves extracting and fusing multiple image features from the acquired endoscopic image, then segmenting the fused feature image using a dual-threshold method to identify the vascular and mucosal regions. Under different image processing modes, the vascular and mucosal regions in the endoscope are accurately segmented to obtain the target image. This improves the contrast between the vascular and mucosal regions in the endoscopic image and enhances the image regions corresponding to different image processing modes, resulting in an enhanced target image. This improves the overall image clarity and reduces a large number of data processing steps, ensuring the accuracy of image enhancement while also improving image processing efficiency.
[0021] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating an endoscopic image enhancement method provided in an embodiment of this application;
[0024] Figure 2 This is a schematic diagram of the endoscope system provided in the embodiments of this application;
[0025] Figure 3 This is a schematic diagram of the integrated endoscope structure provided as an example in this application;
[0026] Figure 4 This is a flowchart illustrating the enhancement process of endoscopic images provided in an embodiment of this application.
[0027] Figure 5 A schematic diagram of the structure of an endoscopic image enhancement device provided in an embodiment of this application;
[0028] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0030] This application provides a method for enhancing endoscopic images to improve the accuracy and efficiency of image enhancement processing.
[0031] Please see Figure 1 , Figure 1 This is a flowchart illustrating a method for enhancing endoscopic images provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the method for enhancing endoscopic images includes:
[0032] S101. Acquire the first image acquired by the image acquisition element in the endoscope, adjust the channel parameters of the image channel of the first image, and determine the adjusted second image.
[0033] S102. Extract multiple image features from the grayscale image corresponding to the first image, and fuse the multiple image features according to the dynamically determined feature weight coefficients to obtain the third image.
[0034] S103. The third image is segmented according to the determined first threshold and second threshold, the region selection module in the third image is determined, and the blood vessel region and mucosa region in the third image are extracted based on the region selection module; wherein, the first threshold and the second threshold are determined according to the average gray level of the third image and the gray level variance of the third image.
[0035] S104. Determine the image processing mode, and based on the parameter adjustment factor corresponding to the image processing mode, adjust the channel parameters in the blood vessel region and the mucosa region respectively, and determine the adjusted target channel value.
[0036] S105. Based on the target channel values in the blood vessel region and the mucosa region, adjust the second image to determine the enhanced target image.
[0037] The endoscopic image enhancement method provided in this application extracts and fuses multiple image features from the acquired endoscopic image. Then, it segments the fused feature image using a dual-threshold method to determine the vascular and mucosal regions in the image. Under different image processing modes, it accurately segments the vascular and mucosal regions in the endoscope to obtain the target image. This improves the contrast between the vascular and mucosal regions in the endoscopic image and enhances the image regions corresponding to different image processing modes, resulting in an enhanced target image. This improves the overall image clarity and reduces a large number of data processing steps, ensuring the accuracy of image enhancement while also improving image processing efficiency.
[0038] The exemplary steps of the embodiments of this application are described below:
[0039] S101. Acquire the first image acquired by the image acquisition element in the endoscope, adjust the channel parameters of the image channel of the first image, and determine the adjusted second image.
[0040] Please see Figure 2 , Figure 2 This is a schematic diagram of the endoscope system provided in the embodiments of this application, as shown below. Figure 2As shown, the endoscope system 200 includes: an endoscope 250 for capturing images of an observation site (living tissue) within a living organism; an image processor 221 for generating / processing a display image of the observation site based on the captured image signal; a light source device 222 for supplying illumination light to the endoscope 250 illuminating the observation site; and a display 230 for displaying the image. An operation input unit such as a keyboard and mouse can be connected to the image processor 221.
[0041] Furthermore, the endoscope 250 includes: an insertion part 252 that is inserted into the digestive tract of a living organism; an operation part 251 provided at the base of the insertion part 252; and a universal cable that connects the endoscope 250 to the image processor 221 and the light source device 222.
[0042] For example, the insertion section 252 of a flexible endoscope consists of a front end portion 253, a curved section, and a flexible tube portion arranged sequentially from the front end. The front end portion 253 has an illumination window for illuminating the observation area, an image acquisition window for transmitting an image of the observation area, and sometimes an air / water supply nozzle for supplying air / water to clean the image acquisition window, as well as a working channel for protruding instruments such as forceps and electronic scalpels for various procedures. Inside the image acquisition window, an image acquisition element and an objective lens optical system for imaging can be built in.
[0043] Among them, the image acquisition element is an image camera element, which can be a sensor based on complementary metal-oxide-semiconductor (CMOS) or a sensor based on charge-coupled device (CDD).
[0044] Furthermore, in addition to the angle knob, the operation unit 251 is also provided with a clamping port for inserting treatment instruments, an air / water delivery button for operating when air / water is delivered from the air / water delivery nozzle, and a button for taking pictures / recording videos (not shown in the figure).
[0045] In another possible implementation, please refer to Figure 3 , Figure 3 The schematic diagram of the integrated endoscope structure provided as an example in this application is shown below. Figure 3 As shown, in order to meet the portability requirements, the image processor 221, the light source device 222 and the display 230 can be integrated into one unit.
[0046] In this embodiment, the light source device 222 emits white light; in other examples of this application, an LED light source can be installed inside the illumination window, so that the endoscope can be illuminated without the need for an additional light source device, and the aforementioned LED light source emits white light. In this embodiment, the endoscopic image of the living body to be detected acquired by the image acquisition element of the endoscope is processed by the image processor 221 in the endoscope system.
[0047] Furthermore, to ensure the clarity and accuracy of images presented under different image processing modes, the processor needs to enhance the images acquired by the image acquisition elements in the endoscope. For example, taking bleeding point detection as an example, bleeding often occurs during endoscopic diagnosis and surgery. Blood can affect the visibility of the endoscope's field of view, making it difficult to detect bleeding points and increasing the difficulty of hemostasis. Excessive or frequent clotting may also lead to carbonization of the submucosal layer, thereby increasing the difficulty and risk of surgery. Therefore, improving the visibility of the field of view in endoscopic imaging and enhancing the difference between the bleeding point and its surrounding area are urgent problems to be solved.
[0048] In one possible implementation, the first image acquired by the image acquisition element is a BGR space image. The first image needs to be converted in image space and its colors adjusted to determine the adjusted second image for subsequent processing.
[0049] Specifically, the step "perform color space conversion and global color adjustment on the first image, and determine the adjusted second image" includes:
[0050] a1: Perform color space conversion on the first image to obtain the initial LAB color image.
[0051] a2: Perform channel decomposition on the initial LAB color image to obtain the L channel image, A channel image, and B channel image.
[0052] a3: For the L channel image, if the initial LAB color image is overexposed, enhance the contrast of the L channel image and determine to adjust the L channel image.
[0053] a4: Perform linear red-green tone balance adjustment on the A channel image and the B channel image to determine the adjustment of the A channel image and the B channel image.
[0054] a5: Reconstruct the adjusted L-channel image, the adjusted A-channel image, and the adjusted B-channel image to determine the second image.
[0055] In one possible implementation, the input first image is converted to a color space from BGR space to LAB color space to obtain an initial LAB color image. The initial LAB color image is then decomposed into channels to obtain an L channel image, an A channel image, and a B channel image.
[0056] In the initial LAB color image, the L channel represents lightness, describing the brightness information of the image; the A channel represents the range from green to red, with negative values leaning towards green and positive values leaning towards red, describing the red-green attribute of the color; the B channel represents the range from blue to yellow, with negative values leaning towards blue and positive values leaning towards yellow, describing the blue-yellow attribute of the color.
[0057] Furthermore, for the L channel image, if the image is overexposed, the contrast of the L channel is enhanced using CLAHE to obtain an adjusted L channel image.
[0058] CLAHE stands for Contrast Limited Adaptive Histogram Equalization.
[0059] Here, the L channel, as an independent carrier of brightness information, directly affects the effectiveness of subsequent color channel (A and B channels) adjustments due to its optimization quality. The L_1 channel obtained through CLAHE processing can provide a more balanced brightness benchmark, making subsequent color differentiation adjustments for different tissue regions more accurate, while reducing regional misjudgments caused by uneven brightness and improving the overall algorithm's adaptability to complex endoscopic scenarios.
[0060] Furthermore, linear red-green tone balance adjustment is performed on the A channel image and the B channel image to determine which channel image to adjust.
[0061] Specifically, the red-green balance can be controlled by adjusting the A channel image using the following linear transformation formula:
[0062] ;
[0063] Where A1 is the image with adjusted A channel; A is the image with A channel; This is the scaling factor, specifically... Set within the range [0,1] to gently compress the positive value range (red component) of channel A. For the constant term, specifically, The offset is generally set in the range of [0,5]. By slightly increasing the overall channel baseline, the red intensity is reduced while retaining a moderate red tendency, which counteracts the green color cast interference commonly seen in endoscopic images (such as the green component formed by mucosal surface reflection), and finally achieves a dynamic balance of red and green tones.
[0064] Specifically, the B channel image can be adjusted using the following linear transformation formula:
[0065] ;
[0066] Where B1 is the adjusted B channel image; B is the B channel image; This is the scaling factor, specifically... Set within the range [1,2] to slightly amplify the positive value range (yellow component) of the B channel. For the constant term, specifically, The offset is typically set within the range of [0,5] to enhance the overall yellow signal.
[0067] Here, the adjustment of the B channel image complements the red control of the A channel. By moderately increasing the yellow component, the vascular tissue presents a natural orange-red color under the synergistic effect of red and yellow tones, which conforms to the typical visual perception of vascular morphology in clinical practice. At the same time, it avoids the monotony or color bias that may result from adjusting the A channel alone, and further enhances the sense of color hierarchy and tissue recognition after red-green balance.
[0068] Furthermore, the adjusted L-channel image, adjusted A-channel image, and adjusted B-channel image are recombined to obtain the second image.
[0069] Furthermore, after obtaining the second image through color space conversion and color adjustment, feature extraction can be performed on the second image, and the extracted multiple image features can be fused to obtain the third image.
[0070] S102. Extract multiple image features from the grayscale image corresponding to the first image, and fuse the multiple image features according to the dynamically determined feature weight coefficients to obtain the third image.
[0071] In this embodiment of the application, after obtaining the grayscale image corresponding to the first image, feature extraction is performed on the grayscale image corresponding to the first image, and after feature extraction, the feature weight coefficient corresponding to each image feature is dynamically determined and feature fusion is performed to obtain the target fused image.
[0072] Specifically, S102 includes:
[0073] b1: Extract multiple image features from the grayscale image corresponding to the first image, and normalize each image feature to obtain the image feature matrix.
[0074] b2: For each image feature in the image feature matrix, determine the feature weight coefficient corresponding to that image feature.
[0075] b3: Based on the feature weight coefficient of each image feature, perform feature weighting calculation on each image feature to obtain the initial fused feature image.
[0076] b4: Perform Gamma correction on the initial fused feature image to determine the third image.
[0077] In this embodiment of the application, after extracting features from the grayscale image corresponding to the first image, the extracted image features are normalized by Min-Max to map each image feature to the [0,1] interval, thereby constructing an image feature matrix. For each image feature in the image feature matrix, the feature weight coefficient corresponding to each image feature is determined.
[0078] In one possible implementation, the extracted image features of the grayscale image corresponding to the first image may include at least one of the following: grayscale features, texture features, color features, and clinical prior features.
[0079] Clinical prior features refer to a set of visual features of anatomical structures and lesions in endoscopic images that are clinically significant, determined in advance by combining endoscopic clinical diagnostic experience and medical anatomy knowledge. These features include characteristics such as blood vessel diameter and continuous course.
[0080] In one possible implementation, the grayscale feature extraction process can be as follows: the grayscale image corresponding to the second image is enhanced with the difference of Gaussians (DoG) function to enhance the grayscale difference between the blood vessels and the background, thereby obtaining grayscale feature F1.
[0081] For example, the second image can be blurred twice with Gaussian filters of radius 0.5 and 1.0 respectively, and the two blurred images can be subtracted to extract the detail information of the second image between the two blur scales, thereby enhancing the grayscale difference between the blood vessels and the background and obtaining the grayscale feature F1.
[0082] In another possible implementation, the process of extracting texture features can be as follows: calculate the four-dimensional parameters of contrast, energy, texture entropy, and correlation based on the gray-level co-occurrence matrix (GLCM), and obtain the texture features F2 by dimensionality reduction through principal component analysis (PCA).
[0083] For example, by statistically analyzing the gray-level pairings of each pixel in the image with its neighbors at a distance of 1 in the four directions of East (0°), Northeast (45°), North (90°), and Northwest (135°), a matrix is constructed in four directions. The four-dimensional parameters of contrast, energy, texture entropy, and correlation are calculated, and the texture feature F2 is obtained by dimensionality reduction through principal component analysis (PCA).
[0084] Specifically, texture feature extraction can be determined using the following formula:
[0085] ;
[0086] Where F2 represents texture features; Contrast represents contrast; Energy represents energy; Entropy represents texture entropy; and Correlation represents correlation.
[0087] In another possible implementation, the process of extracting color features can be as follows: extract the mean μA and standard deviation σA of channel A and the mean μB of channel B, construct color difference features, and obtain color feature F3.
[0088] Specifically, color feature extraction can be determined using the following formula:
[0089] ;
[0090] Among them, F3 represents color characteristics; A X The A channel component value of pixel X; B X is the B channel component value of pixel X; μA is the mean value of the A channel; denoted as , where is the standard deviation of channel A; μB is the mean of channel B. The above formula highlights the red-yellow hue aggregation characteristics of vascular regions using a Gaussian kernel.
[0091] In another possible implementation, the process of extracting clinical prior features can be as follows: based on the clinical features of "blood vessel diameter 20-200μm, continuous direction", a morphological prior mask is constructed, and suspected blood vessel regions are assigned 1 and non-blood vessel regions are assigned 0.1, thus obtaining clinical prior features F4.
[0092] Furthermore, different feature weight coefficients can be set for different image features, so that subsequent feature fusion processing can be performed based on the determined dynamic weight coefficients. The determination method of feature weight coefficients for different image features will be explained below.
[0093] In one possible implementation, determining the feature weight coefficients includes:
[0094] c1: When the image feature is a grayscale feature, determine the grayscale value of each pixel in the grayscale image corresponding to the first image.
[0095] c2: Determine the maximum gray value among the gray values of each pixel, and calculate the gray value difference between the maximum gray value and the average gray value of the pixels.
[0096] c3: Based on the grayscale difference, the maximum grayscale value, preset weight parameters, and grayscale value coefficients, determine the feature weight coefficients corresponding to the grayscale feature; or,
[0097] c4: When the image feature is a texture feature, determine multiple texture entropy values in the grayscale image corresponding to the first image;
[0098] c5: Determine the maximum texture entropy value among multiple texture entropy values, and calculate the entropy difference between the maximum texture entropy value and the average texture entropy value of the multiple texture entropy values;
[0099] c6: Based on the entropy difference, the maximum texture entropy, preset weight parameters, and entropy coefficients, determine the feature weight coefficients corresponding to the texture features; or,
[0100] c7: When the image feature is a color feature or a clinical prior feature, the feature weight coefficient corresponding to the image feature is set to a preset weight coefficient.
[0101] In one possible implementation, when the image feature is a grayscale feature, it can be that for each pixel in the grayscale image corresponding to the first image, the maximum grayscale value among the grayscale values of the pixels is selected, and the grayscale difference between the maximum grayscale value and the average grayscale value of multiple pixels is calculated. Then, the feature weight coefficient corresponding to the grayscale feature is determined by combining the grayscale difference.
[0102] Specifically, the feature weight coefficient corresponding to the grayscale feature can be calculated using the following formula:
[0103] ;
[0104] Where ω1 is the feature weight coefficient corresponding to the gray-level feature; F1 is the gray-level feature; max(F1) is the maximum gray-level value; mean(F1) is the average gray-level value of multiple pixels; α w1 ,β w1 For example, α is a preset constant. w1 β is 0.3 w1 It is 0.2.
[0105] In some cases, when the grayscale difference in grayscale feature F1 is significant (blood vessels are clearly distinguishable from the background), ω1 will be automatically increased, for example, by increasing α. w1 For example, ω1 can be set to a maximum of 0.5.
[0106] In one possible implementation, when the image feature is a texture feature, it can be that multiple texture entropy values in the grayscale image corresponding to the first image are determined, the maximum texture entropy value among the multiple texture entropy values is selected, and the entropy difference between the maximum texture entropy value and the average texture entropy value of the multiple texture entropy values is calculated. Then, the feature weight coefficient corresponding to the texture feature is determined by combining the entropy difference.
[0107] Specifically, the feature weight coefficients corresponding to texture features can be calculated using the following formula:
[0108] ;
[0109] Where ω2 is the feature weight coefficient corresponding to the texture feature; Entropy is the texture entropy; max((Entropy)) is the maximum texture entropy value; mean(Entropy) is the average texture entropy value of multiple texture entropy values; α w2 ,β w2 For example, α is a preset constant. w2 β is 0.3 w2 It is 0.2.
[0110] In some cases, when the texture complexity in the grayscale image corresponding to the first image is high, such as when there are dense blood vessel branches, ω2 is automatically boosted, for example, by increasing α. w2 The value of enhances the contribution of texture features.
[0111] Furthermore, for color features and clinical prior features, fixed preset weight coefficients can be used. That is, when the image features include color features and clinical prior features, the feature weight coefficients corresponding to the image features are preset weight coefficients.
[0112] Here, when the image features include color features, the feature weight coefficient ω3 corresponding to the color features can be set to a fixed basic weight value, such as 0.25, to ensure the stable contribution of the red and yellow hue features of blood vessels; when the image features include clinical prior features, the feature weight coefficient ω4 corresponding to the clinical prior features can be set to a fixed basic weight value, such as 0.15, to provide prior constraints for blood vessel morphology features.
[0113] Furthermore, after determining the feature weight coefficients corresponding to each image feature, feature weighting calculations can be performed on each image feature based on the feature weight coefficients to obtain the initial fused feature image.
[0114] Specifically, the initial fused feature image can be determined using the following formula:
[0115] ;
[0116] in, F1 represents the initial fused feature image; F2 represents the grayscale feature; F3 represents the texture feature; F4 represents the color feature; ω1 represents the feature weight coefficient corresponding to the grayscale feature; ω2 represents the feature weight coefficient corresponding to the texture feature; ω3 represents the feature weight coefficient corresponding to the color feature; and ω4 represents the feature weight coefficient corresponding to the clinical prior feature.
[0117] Furthermore, after obtaining the initial fused feature image, the initial fused feature image can be corrected to determine the third image.
[0118] Specifically, Gamma correction is performed on the initial fused feature image to enhance the response values of weak feature regions (such as microvessels) through nonlinear transformation, while suppressing background noise. The corrected feature map is the third image. At this point, the blood vessel region in the third image has a high gray value (high response), while the background region has a low gray value (low response), providing clear target guidance for subsequent accurate segmentation.
[0119] Furthermore, after obtaining the third image, the third image can be segmented using the determined first threshold and second threshold to determine the blood vessel mask and the mucosa mask, so as to determine the blood vessel region and the mucosa region in the third image based on the blood vessel mask and the mucosa mask.
[0120] S103. The third image is segmented according to the determined first threshold and second threshold, the region selection module in the third image is determined, and the blood vessel region and mucosa region in the third image are extracted based on the region selection module; wherein, the first threshold and the second threshold are determined according to the average gray level of the third image and the gray level variance of the third image.
[0121] In one possible implementation, a first threshold and a second threshold can be calculated based on the grayscale histogram corresponding to the third image; wherein the first threshold is higher than the second threshold.
[0122] Specifically, the enhancement method further includes:
[0123] d1: Determine the grayscale histogram corresponding to the third image, and calculate the average grayscale and grayscale variance of the third image based on the grayscale histogram.
[0124] d2: Based on the average gray level and gray level variance, determine the first threshold and the second threshold.
[0125] Here, we can define the grayscale histogram corresponding to the third image as H, where H(i) represents the number of pixels with a grayscale value of i.
[0126] Specifically, the average gray level of the third image can be calculated using the following formula:
[0127] ;
[0128] in, H is the average gray level of the third image; H(i) represents the number of pixels with a gray level of i.
[0129] Specifically, the grayscale variance of the third image can be calculated using the following formula:
[0130] ;
[0131] in, The grayscale variance of the third image; Let H(i) be the average gray level of the third image, and let H(i) represent the number of pixels with a gray level of i.
[0132] Here, the average gray level of the third image reflects the overall brightness level of the third image; the gray level variance of the third image reflects the degree of dispersion of gray level values, providing data support for the calculation of the dynamic first threshold and the second threshold.
[0133] Furthermore, after determining the average gray level and gray level variance, the first threshold and the second threshold can be determined based on the average gray level and gray level variance.
[0134] Specifically, the first threshold and the second threshold can be determined using the following formula:
[0135] ;
[0136] ;
[0137] in, The first threshold; The second threshold; The average gray level of the third image; Let be the grayscale variance of the third image.
[0138] Here, the first threshold covers the high-brightness blood vessel regions in the third image, and the second threshold covers the low-brightness blood vessel regions in the third image. The combination of the first and second thresholds is dynamically adjusted according to the grayscale distribution of the third image. Compared with a fixed threshold, this allows blood vessel regions with different brightness levels to be included in the segmentation range, improving the accuracy of subsequent blood vessel region segmentation.
[0139] Furthermore, after determining the first threshold and the second threshold, the image can be segmented based on the first threshold and the second threshold.
[0140] Specifically, the step "extracting the blood vessel region and mucosal region from the third image" includes:
[0141] e1: For the third image, the regions in the third image with pixel gray values greater than the first threshold are determined as blood vessel regions, and the regions in the third image with pixel gray values less than the second threshold are determined as background regions.
[0142] e2: In the third image, regions with pixel gray values less than the first threshold and greater than the second threshold are identified as candidate blood vessel regions.
[0143] e3: The region in the candidate blood vessel region that is connected to the blood vessel region and contains more than a preset number of pixels is determined as the blood vessel region.
[0144] Specifically, the third image can be segmented using the following formula:
[0145] ;
[0146] in, The first threshold; The second threshold is defined as Segment(i,j), which represents the pixel value at position i,j, and S(i,j), which represents the grayscale value of the pixel at position i,j.
[0147] In one possible implementation, for candidate blood vessel regions, a neighborhood analysis can be performed on the candidate blood vessel regions. Specifically, regions in the candidate blood vessel regions that are connected to the blood vessel regions and contain more than a preset number of pixels are identified as blood vessel regions.
[0148] For example, a candidate blood vessel region that is directly connected to the blood vessel region (255) and has a region area of ≥5 pixels is identified as a blood vessel region.
[0149] Furthermore, after segmenting the third image, a region selection module is determined in the third image.
[0150] Here, the region selection module represents the selective processing of spatial regions in the third image, filtering out the target regions that need to be processed by image algorithms, which can be represented by blood vessel masks and mucosal masks.
[0151] Specifically, the blood vessel mask is determined through the following steps:
[0152] f1: Assign the pixel values in the blood vessel region of the third image to preset pixel values to obtain the initial blood vessel mask.
[0153] f2: After performing morphological processing on the initial blood vessel mask, the blood vessel mask is determined.
[0154] Specifically, the pixel values of the blood vessel region in the third image can be assigned to 255, and the pixel values of the background region can be assigned to 0, effectively removing isolated artifacts in the third image and obtaining the initial blood vessel mask.
[0155] Furthermore, after performing vascular masking on the initial vascular mask, a vascular mask is obtained.
[0156] Here, the fundamental operation of morphological processing is the convolutional neighborhood operation (erosion, dilation, opening, closing, etc.) between the structuring element (SE) and the image. That is, after performing convolutional neighborhood operations on the initial blood vessel mask, the blood vessel mask is obtained.
[0157] Furthermore, after determining the blood vessel mask, the mucosal mask used in the target fusion image can be determined based on the blood vessel mask.
[0158] Specifically, the mucosal mask is determined through the following steps:
[0159] g1: Perform a bitwise inversion operation on the blood vessel mask to determine the basic mucosal mask.
[0160] g2: Determine the overexposure mask and underexposure mask based on the channel brightness parameters in the second image.
[0161] g3: Subtract the overexposed mask and the underexposed mask from the base mucosa mask according to the corresponding pixel values to determine the mucosa mask.
[0162] In one possible implementation, based on the spatial mutual exclusion between blood vessels and mucosa, the basic mucosa mask can be determined by performing a bitwise inversion operation on the blood vessel mask.
[0163] Specifically, the base mucosal mask can be determined using the following formula:
[0164] ;
[0165] Where mucosa_mask_base is the base mucosa mask; vessel_mask is the vessel mask; and ~ is the bitwise NOT operator.
[0166] Furthermore, based on the L channel brightness characteristics, an overexposed mask (overexpose_mask) and an underexposed mask (underexpose_mask) are constructed. Specifically, regions with L channel brightness greater than 220 are marked as 1 to form an overexposed mask, and regions with L channel brightness less than 30 are marked as 1 to form an underexposed mask.
[0167] In one possible implementation, the mucous membrane mask is determined by subtracting the overexposure mask and the underexposure mask from the base mucous membrane mask according to the corresponding pixel values.
[0168] Specifically, the mucosal mask can be determined using the following formula:
[0169] ;
[0170] Wherein, mucosa_mask_base is the base mucosa mask; overexpose_mask is the overexposed mask; and underexpose_mask is the underexposed mask.
[0171] Furthermore, after determining the blood vessel mask and the mucosa mask, the blood vessel region and the mucosa region in the third image can be determined based on the spatial positioning of the blood vessel mask and the mucosa mask. By fusing local image features (brightness, texture, color distribution, etc.) and adjusting the channel parameters in the blood vessel region and the mucosa region in the second image according to different image processing modes, the differential enhancement of blood vessels and mucosa can be achieved, thereby improving the clarity of the endoscopic image.
[0172] S104. Determine the image processing mode, and based on the parameter adjustment factor corresponding to the image processing mode, adjust the channel parameters in the blood vessel region and the mucosa region respectively, and determine the adjusted target channel value.
[0173] In one possible implementation, the image processing mode can be automatically determined. Specifically, different image processing modes can be determined based on the proportion of lesion mask in the target fused image.
[0174] Specifically, the step "Determine Image Processing Mode" includes:
[0175] h1: Determine the proportion of the lesion mask in the third image.
[0176] h2: If the proportion of the lesion mask is greater than the first mask proportion threshold, the image processing mode is determined to be the bleeding source identification mode.
[0177] h3: If the proportion of the lesion mask is less than the second mask proportion threshold, the mean value of the calculated blood vessel depth factor is greater than the preset mean depth threshold, and the mean value of the calculated blood vessel diameter is less than the preset mean diameter threshold, then the image processing mode is determined to be the deep blood vessel enhancement display mode.
[0178] h4: If the proportion of the lesion mask is greater than the second mask proportion threshold and less than the first mask proportion threshold, or if the mean value of the blood vessel depth factor is within the depth mean value range and the mean value of the blood vessel diameter is within the diameter mean value range, the image processing mode is determined to be the deep and superficial blood vessel comprehensive confirmation mode.
[0179] Here, the image processing mode may include at least one of the following: bleeding source identification mode, deep blood vessel enhancement display mode, and deep and superficial blood vessel comprehensive confirmation mode.
[0180] In one possible implementation, if the proportion of the lesion mask is determined to be greater than the first mask proportion threshold, the image processing mode is determined to be the bleeding source identification mode.
[0181] For example, if the proportion of the lesion mask is determined to be greater than 5%, the image processing mode is determined to be the bleeding source identification mode.
[0182] In another possible implementation, while determining the image processing mode based on the lesion mask, the current doctor's operation can also be taken into account. Specifically, if it is determined that the proportion of the lesion mask is greater than the third mask proportion threshold and the doctor triggers "emergency mode", then the current image processing mode is determined to be the bleeding source identification mode.
[0183] Furthermore, if it is determined that the proportion of the lesion mask is less than the second mask proportion threshold, and the calculated average value of the blood vessel depth factor is greater than the preset average depth threshold, and the calculated average blood vessel diameter is less than the preset average diameter threshold, then the image processing mode is determined to be the deep blood vessel enhancement display mode.
[0184] For example, if the lesion mask ratio is determined to be less than 1%, and the calculated mean value of the vessel depth factor is greater than 0.5, while the calculated mean value of the vessel diameter is less than 50 μm, the image processing mode is determined to be a deep vessel enhancement display mode. Further, if the lesion mask ratio is determined to be greater than a second mask ratio threshold and less than a first mask ratio threshold, or if the mean value of the vessel depth factor is within the depth mean range and the mean value of the vessel diameter is within the diameter mean range, the image processing mode is determined to be a comprehensive deep and superficial vessel confirmation mode.
[0185] For example, if the proportion of lesion mask is determined to be greater than 1% and less than 5%, or if the mean value of the blood vessel depth factor is within the range of [0.3, 0.5] and the mean value of the blood vessel diameter is within the range of [30μm, 100μm], the image processing mode is determined to be the deep and superficial blood vessel comprehensive confirmation mode.
[0186] In another possible implementation, the image processing mode can also be determined in response to the current physician's operation. For example, if the physician selects "bleeding source identification mode", then the current image processing mode is determined to be bleeding source identification mode.
[0187] In one possible implementation, if the second image is a LAB color image, for different image processing modes, the adjustment of the blood vessel region can be performed by adjusting the blood vessel A channel component and the blood vessel B channel component according to the parameter adjustment factor corresponding to the image processing mode, and the adjusted target channel value can be determined.
[0188] Specifically, the channel parameters of the blood vessel region in the second image are adjusted through the following steps to determine the adjusted target channel values:
[0189] i1: Extract the blood vessel A channel component, blood vessel B channel component, and blood vessel L channel component from the blood vessel region in the second image.
[0190] i2: Adjust the target channel value after adjustment based on the parameter adjustment factor for the blood vessel A channel component and the blood vessel B channel component.
[0191] In this embodiment, the A-channel component, B-channel component, and L-channel component of the blood vessel region can be extracted from the second image using a blood vessel mask. Then, the target channel value can be dynamically calculated by referring to local feature parameters of the blood vessel region, such as average brightness and texture entropy.
[0192] Here, the methods for determining the adjusted target channel values differ depending on the image processing mode. The steps for determining the adjusted target channel values under different image processing modes will be described below.
[0193] Firstly, when the image processing mode is a blood source identification mode, the step "adjusting the blood vessel A channel component and the blood vessel B channel component based on the parameter adjustment factor, and determining the adjusted target channel value" includes:
[0194] j1: Determine the bleeding probability factor based on the blood vessel A channel component and the blood vessel L channel component.
[0195] j2: For the blood vessel A channel component, enhance the blood vessel A channel component based on the bleeding probability factor to obtain the target blood vessel A channel value.
[0196] j3: For the blood vessel B channel component, enhance the blood vessel B channel component based on the bleeding probability factor to obtain the target blood vessel B channel value.
[0197] In one possible implementation, for the bleeding source identification mode, the purpose of adjusting the second image is to highlight the bright red features of the bleeding points and achieve rapid localization of the bleeding source. Therefore, a bleeding probability factor can be introduced to dynamically adjust the channel parameters of different channel components.
[0198] Specifically, the bleeding probability factor can be determined using the following formula:
[0199] ;
[0200] Where P_bleed is the bleeding probability factor; A_vessel is the A channel component of the blood vessel; L_vessel is the L channel component of the blood vessel; μA is the mean of the A channel; σA is the standard deviation of the A channel; sigmoid(x)=1 / (1+exp(-x)), P_bleed∈[0,1], and the higher the bleeding probability factor value, the greater the probability of bleeding.
[0201] The formula for determining the bleeding probability factor is a quantitative calculation method designed based on the visual characteristics of bleeding areas in endoscopic images. Essentially, it constructs a pixel-level probability index for determining the bleeding area using the channel values of the image's color space. In clinical endoscopic images, the visual characteristics of bleeding areas exhibit clear patterns: a distinct red hue (corresponding to the A channel value in the color space) and significantly lower brightness than the surrounding normal mucosal tissue (corresponding to the L channel value in the color space). The formula is based on this clinical visual pattern, transforming qualitative visual characteristics into quantitative probability values to achieve pixel-level accurate identification of bleeding areas.
[0202] Furthermore, after determining the bleeding probability factor, the channel parameters of the vascular A channel component can be adjusted according to the bleeding probability factor to enhance the A channel component.
[0203] Specifically, the adjusted target blood vessel A channel value can be determined using the following formula:
[0204] ;
[0205] Where A_vessel_adj is the adjusted target vessel A channel value; A_vessel is the vessel A channel component; P_bleed is the bleeding probability factor, α A1 β A1 γ A1 δ A1 It is a constant; for example, α A1 1.1, β A1 0.2, γ A1 4, δ A1 The value is 2.
[0206] Furthermore, after adjusting the blood vessel A channel component, it is necessary to simultaneously adjust the blood vessel B channel component in conjunction with the bleeding probability factor to enhance the B channel component.
[0207] Specifically, the adjusted target blood vessel B channel value can be determined using the following formula:
[0208] ;
[0209] Where B_vessel_adj is the adjusted B-channel value of the target vessel; B_vessel is the B-channel component of the vessel; P_bleed is the bleeding probability factor, α B1 β B1 γ B1 δ B1 It is a constant.
[0210] Among them, the enhancement of channel A is greater than the enhancement of channel B. Specifically, α A1 >α B1 or β A1 >β B1 or γ A1 >γ B1 or δ A1 ≥δ B1 For example, α B1 1.05, β B1 0.1, γ B1 For 2, δ B1 The value is 1. In another possible implementation, both the A channel and the B channel are based on the Lab color space. According to the LAB color space principle: A channel: represents the red-green color axis, a positive increase in value represents an enhancement of red tone, and a negative increase represents an enhancement of green tone; B channel: represents the yellow-blue color axis, a positive increase in value represents an enhancement of yellow tone, and a negative increase represents an enhancement of blue tone.
[0211] When detecting bleeding sources under endoscopy, the core visual feature of the bleeding area is dominated by red tones. Channel A is a direct quantitative indicator of red tones. The proportion of yellow / blue tones in the bleeding area is extremely low. Channel B is not related to the core visual features of the area and is only a background color dimension. Therefore, it is possible to enhance only the A channel component of the blood vessel and not process the B channel component of the blood vessel, thereby reducing the amount of data processing and improving data processing efficiency.
[0212] Secondly, when the image processing mode is a deep vascular enhancement display mode, the step "adjusting the blood vessel A channel component and the blood vessel B channel component based on the parameter adjustment factor, determining the adjusted target channel value, and determining the adjusted target channel value" includes:
[0213] k1: Determine the brightness of the mucosal region corresponding to the mucosal region in the second image.
[0214] k2: Determine the depth factor based on the L-channel component of the blood vessel and the brightness of the mucosal region.
[0215] k3: For the blood vessel A channel component, based on the depth factor, enhance the blood vessel A channel component and determine the adjusted target blood vessel A channel value.
[0216] k4: For the blood vessel B channel component, a color balance factor is determined based on the mean value of the blood vessel B channel in the blood vessel region and the mean value of the mucosal B channel in the mucosal region.
[0217] k5: Based on the depth factor and the color balance factor, perform color calibration on the blood vessel B channel component to determine the adjusted target blood vessel B channel value.
[0218] In one possible implementation, when the image processing mode is the deep blood vessel enhancement display mode, the purpose of adjusting the second image is to introduce a depth factor to address the characteristics of deep blood vessels such as "low brightness, blurred boundaries, and weak red components," and to adjust subsequent channel parameters through the depth factor.
[0219] Here, the depth factor can be determined by the vascular L-channel component and the mucosal region brightness.
[0220] Specifically, the depth factor can be determined using the following formula:
[0221] ;
[0222] Where D_depth is the depth factor; μLm is the mucosal region brightness; and L_vessel is the L-channel component of the blood vessel. D_depth belongs to the range [0,1]. The higher the depth factor value, the deeper the blood vessel. Dynamic matching enhances the intensity and avoids overexposure of the superficial layer and underexposure of the deep layer.
[0223] Furthermore, after determining the depth factor, the channel parameters of the vascular A channel component can be adjusted using the depth factor to enhance the vascular A channel component.
[0224] Specifically, the adjusted target blood vessel A channel value can be determined using the following formula:
[0225] ;
[0226] Where A_vessel_adj is the adjusted target vessel A channel value; A_vessel is the vessel A channel component; and D_depth is the depth factor. , γ A2 δ A2 It is a constant; for example, 1.05 0.1, γ A2 For 2, δ A2 The value is 1.
[0227] Furthermore, when adjusting the channel parameters of the blood vessel B channel component, the color tone of the blood vessel B channel component is calibrated, so a color balance factor can be introduced for subsequent adjustments.
[0228] Specifically, the color balance factor can be determined using the following formula:
[0229] ;
[0230] Wherein, K_balance is the color balance factor; μBv is the mean value of the vascular B channels in the vascular region; and μBm is the mean value of the mucosal B channels in the mucosal region.
[0231] Furthermore, the blood vessel B-channel component can be adjusted simultaneously based on color balance factors and depth factors.
[0232] Specifically, the adjusted target blood vessel B channel value can be determined using the following formula:
[0233] ;
[0234] Where B_vessel_adj is the adjusted B-channel value of the target vessel; B_vessel is the B-channel component of the vessel; D_depth is the depth factor; K_balance is the color balance factor; and α B2 β B2 γ B2 δ B2 ε B2 ζ B2 It is a constant.
[0235] Specifically, the enhancement of channel A is greater than the enhancement of channel B; that is, αA2 > αB2, βA2 > βB2, γA2 > γB2, or δA2 ≥ δB2. For example, α B2 1.03, β B2 0.08, ε B2 0.95, ζ B2 0.1, γ B2 1, δ B2 The value is 1.
[0236] Thirdly, when the image processing mode is a comprehensive confirmation mode for deep and superficial blood vessels, the step "adjusting the blood vessel A channel component and the blood vessel B channel component based on the parameter adjustment factor, and determining the adjusted target channel value" includes:
[0237] l1: For the superficial blood vessels in the vascular region, based on the determined blood vessel diameter factor, adjust the blood vessel A channel component to determine the adjusted target blood vessel A channel value.
[0238] l2: For deep blood vessels in the vascular region, based on the depth factor and texture entropy correction term, enhance the A-channel component of the blood vessel and determine the adjusted A-channel value of the target blood vessel.
[0239] l3: For the blood vessel B channel component, based on the depth factor, balance the blood vessel B channel component and determine the adjusted target blood vessel B channel value.
[0240] In one possible implementation, when the image processing mode is a comprehensive confirmation mode for deep and superficial blood vessels, the purpose of adjusting the second image is to: integrate the characteristics of "high brightness and clear boundaries" of superficial blood vessels with "low brightness and weak signal" of deep blood vessels, introduce the blood vessel diameter factor S_vessel, realize the linkage enhancement of "diameter-depth-color", and support the integrity assessment of blood vessel morphology.
[0241] in, S represents the area of the blood vessel region; S_vessel represents the blood vessel diameter factor.
[0242] In one possible implementation, for superficial blood vessels in a vascular region, i.e., blood vessels where the L-channel component of the blood vessel is greater than the mucosal region brightness μLm multiplied by 0.8, the adjusted target blood vessel A-channel value can be determined by the blood vessel diameter factor and the blood vessel A-channel component.
[0243] Specifically, the adjusted target blood vessel A channel value can be determined using the following formula:
[0244] ;
[0245] Where A_vessel_adj is the adjusted target vessel A-channel value; A_vessel is the vessel A-channel component; S_vessel is the vessel diameter factor; α A3 β A3 γ A3 δ A3 It is a constant. For example, α A3 1.02, β A3 0.06, γ A3 1, δ A3 The value is 2.
[0246] Here, for small blood vessels, i.e., blood vessels with a diameter factor of less than 30μm, a gain of 1.08 and an offset of 3 can be set to enhance details; for large blood vessels, i.e., blood vessels with a diameter factor of more than 100μm, a gain of 1.02 and an offset of 1 can be set to avoid excessive redness.
[0247] In another possible implementation, for deep blood vessels in a vascular region, where the blood vessel L channel component is less than or equal to the mucosal region brightness μLm multiplied by 0.8, the adjusted target blood vessel A channel value can be determined using the depth factor, texture entropy, and blood vessel A channel component.
[0248] Specifically, the adjusted target blood vessel A channel value can be determined using the following formula:
[0249] ;
[0250] Where A_vessel_adj is the adjusted target vessel A channel value; A_vessel is the vessel A channel component; D_depth is the depth factor; E_v is the texture entropy; α A4 β A4 γ A4 δ A4 ε B4 ζ B4 It is a constant. For example, α A4 1.05, β A4 0.1, γ A4 For 2, δ A4 For 1, For 1, It is 0.05.
[0251] Here, the intensity is enhanced for areas with complex textures (such as blood vessel branches) to highlight the structure.
[0252] Furthermore, a global balance adjustment can be performed on the blood vessel B channel component, and the adjusted target blood vessel B channel value can be determined based on the blood vessel B channel component and the depth factor.
[0253] Specifically, the adjusted target blood vessel B channel value can be determined using the following formula:
[0254] ;
[0255] Where B_vessel_adj is the adjusted B-channel value of the target vessel; B_vessel is the B-channel component of the vessel; D_depth is the depth factor; α B3 β B3 γ B3 δ B3 It is a constant. For example, α B3 1.03, β B3 0.04, γ B3 0.5, δ B3 It is 0.5.
[0256] For example, the adjusted channel parameters slightly increase the yellow color of superficial blood vessels (gain 1.07) and balance the yellow color of deep blood vessels (gain 1.03) to ensure color consistency across the entire vascular network.
[0257] In one possible implementation, for different image processing modes, the adjustment of the mucosal region can be achieved by adjusting the mucosal A channel component, mucosal B channel component, and mucosal L channel component according to the parameter adjustment factor corresponding to the image processing mode, and determining the adjusted target channel value.
[0258] Specifically, the channel parameters of the mucosal region in the second image are adjusted through the following steps to determine the adjusted target channel values:
[0259] m1: Extract the mucosa A channel component, mucosa B channel component, and mucosa L channel component from the mucosa region in the second image.
[0260] m2: Based on the parameter adjustment factor, the mucosa A channel component, the mucosa B channel component, and the mucosa L channel component are adjusted to determine the adjusted target channel value.
[0261] In this embodiment, the mucosa A channel component, mucosa B channel component, and mucosa L channel component in the mucosa region can be extracted from the second image using a mucosa mask, and then the target channel value can be dynamically calculated by referring to the local feature parameters of the mucosa region, such as the roughness feature R_m of the mucosa region.
[0262] The roughness feature R_m can be calculated using gray-level difference. Specifically, the roughness feature can be determined using the following formula:
[0263] ;
[0264] Where R_m is the roughness feature; Gray_m(i,j) is the gray value of pixel i,j; Gray_m(i+1,j) is the gray value of pixel i+1,j.
[0265] Here, the methods for determining the adjusted target channel values differ depending on the image processing mode. The steps for determining the adjusted target channel values under different image processing modes will be described below.
[0266] Firstly, when the image processing mode is a bleeding source identification mode, the step "adjusting the mucosa A channel component, the mucosa B channel component, and the mucosa L channel component based on a parameter adjustment factor, and determining the adjusted target channel value" includes:
[0267] n1: Determine the brightness difference factor based on the brightness of the vascular region and the brightness of the mucosal region.
[0268] n2: For the mucosal L-channel component, based on the brightness difference factor, brighten the mucosal L-channel component and determine the adjusted target mucosal L-channel value.
[0269] n3: For the mucosal A channel component, based on the bleeding probability factor, determine the adjusted target mucosal A channel value.
[0270] n4: For the mucosal B channel component, based on the roughness characteristics of the mucosal region, balance the mucosal B channel component and determine the adjusted target mucosal B channel value.
[0271] In one possible implementation, when the image processing mode is bleeding source identification mode, the purpose of adjusting the second image is to: purify the background around the bleeding point and highlight the bleeding source through a combination of "brightening-redness removal-noise reduction" operations. Specifically, a dynamic brightening coefficient is designed based on the brightness difference between the mucosa and the bleeding point to avoid overall overexposure.
[0272] Here, it is necessary to determine the brightness difference factor based on the brightness of the blood vessel area and the brightness of the mucosa area, and then adjust the channel parameters of the mucosa L channel component, mucosa A channel component and mucosa B channel component based on the brightness difference factor.
[0273] Specifically, the brightness difference factor can be determined using the following formula:
[0274] ;
[0275] Wherein, ΔL is the brightness difference factor; μLv is the brightness of the vascular region; μLm is the brightness of the mucosal region; the brightness difference factor is used to characterize the brightness difference between the bleeding point and the mucosa.
[0276] Here, when it is determined that ΔL is less than -30, that is, when the bleeding point is darker, the gain can be set to 1.12 and the offset to 5 to maximize the contrast between light and dark; when it is determined that ΔL is greater than -10, when the brightness of the bleeding point and the mucosa are similar, the gain can be set to 1.02 and the offset to 2 to avoid interference.
[0277] In one possible implementation, for the mucosal L-channel component, the adjusted target mucosal L-channel value can be determined using the mucosal L-channel component and the brightness difference factor.
[0278] Specifically, the adjusted target mucosal L-channel value can be determined using the following formula:
[0279] ;
[0280] Where L_mucosa_adj is the adjusted target mucosal L-channel value; L_mucosa is the mucosal L-channel component; ΔL is the brightness difference factor; η L1 θ L1 ι L1 κ L1 It is a constant. For example, η L1 1.02, θ L1 0.1, ι L1 For 2, κ L1 The value is 3.
[0281] Furthermore, for the mucosal A channel component, redness reduction optimization is needed. The mucosal A channel component can be adjusted based on the bleeding probability factor to determine the target mucosal A channel value after adjustment.
[0282] Specifically, the adjusted target mucosal A-channel value can be determined using the following formula:
[0283] ;
[0284] Where Amucosa_adj is the adjusted target mucosal A-channel value; A_mucosa is the mucosal A-channel component; P_bleed is the bleeding probability factor; η A1 θ A1 It is a constant. For example, η A1 0.85, θ A1 It is 0.1.
[0285] Furthermore, for the mucosal B channel component, the mucosal A channel component needs to be hue balanced. The mucosal B channel component can be adjusted according to the roughness characteristics to determine the target mucosal B channel value after adjustment.
[0286] Specifically, the adjusted target mucosal B-channel value can be determined using the following formula:
[0287] ;
[0288] Where Bmucosa_adj is the adjusted target mucosal B-channel value; B_mucosa is the mucosal B-channel component; R_m is the roughness feature; η B1 θ B1 ι B1 κ B1 It is a constant. For example, η B1 1.01, θ B1 0.04, ι B1 0.5, κ B1 It is 0.5.
[0289] Secondly, when the image processing mode is a deep vascular enhancement display mode, the step "adjusting the mucosa A channel component, the mucosa B channel component, and the mucosa L channel component based on the parameter adjustment factor, and determining the adjusted target channel value" includes:
[0290] o1: For the mucosal L-channel component, based on a pre-determined regional average depth factor, the mucosal L-channel component is brightened, and the adjusted target mucosal L-channel value is determined.
[0291] o2: For the mucosal A channel component, based on a predetermined regional average depth factor, the mucosal A channel component is suppressed, and the adjusted target mucosal A channel value is determined.
[0292] o3: For the mucosal B channel component, based on the roughness characteristics of the mucosal region, enhance the mucosal B channel component and determine the adjusted target mucosal B channel value.
[0293] In one possible implementation, when the image processing mode is the deep blood vessel enhancement display mode, the purpose of adjusting the second image is to balance the mucosal brightness and the display effect of deep blood vessels. By using the strategy of "weak brightening - low redness removal - texture preservation", the mucosa is prevented from being too bright and obscuring the blood vessel projection, while preserving the mucosal microstructure.
[0294] In one possible implementation, for the mucosal L-channel component, the mucosal L-channel component can be adjusted according to a predetermined regional average depth factor to determine the adjusted target mucosal L-channel value.
[0295] Specifically, the adjusted target mucosal L-channel value can be determined using the following formula:
[0296] ;
[0297] Where L_mucosa_adj is the adjusted target mucosal L-channel value; L_mucosa is the mucosal L-channel component; D_depth_avg is the region average depth factor; η L2 θ L2 ι L2 κ L2 It is a constant. For example, η L2 1.01, θ L2 0.04, ι L2 For 1, κ L2 The value is 2.
[0298] In some cases, for deep, densely vascularized areas, i.e., areas with an average depth factor greater than 0.6, the gain can be set to 1.05 and the offset to 3 for slight brightening; for shallow areas, i.e., areas with an average depth factor less than 0.6, the gain can be set to 1.01 and the offset to 1 to avoid interference.
[0299] Furthermore, for the mucosal A channel component, it is necessary to suppress the mucosal A channel component. This can be achieved by adjusting the mucosal A channel component using a regional average depth factor to obtain the adjusted target mucosal A channel value.
[0300] Specifically, the adjusted target mucosal A-channel value can be determined using the following formula:
[0301] ;
[0302] Where Amucosa_adj is the adjusted target mucosal A-channel value; A_mucosa is the mucosal A-channel component; D_depth_avg is the region average depth factor; η A2 θ A2 It is a constant. For example, η A2 0.9, θ A2 It is 0.05.
[0303] Here, to increase the redness removal intensity in deeper areas, the gain can be set to 0.9 to highlight the redness of blood vessels; to decrease the redness removal intensity in superficial areas, the gain can be set to 0.95 to maintain a natural appearance.
[0304] Furthermore, for the mucosal B channel component, the mucosal A channel component needs to be textured. The mucosal B channel component can be adjusted according to the roughness characteristics of the mucosal region to determine the adjusted target mucosal B channel value.
[0305] Specifically, the adjusted target mucosal B-channel value can be determined using the following formula:
[0306] ;
[0307] Where Bmucosa_adj is the adjusted target mucosal B-channel value; B_mucosa is the mucosal B-channel component; R_m is the roughness feature; η B2 θ B2 κ B2 It is a constant. For example, η B2 1.0, η B2 0.03, κ B2 It is 0.3.
[0308] Thirdly, when the image processing mode is a comprehensive confirmation mode for deep and superficial blood vessels, the step "adjusting the mucosal A channel component, the mucosal B channel component, and the mucosal L channel component based on the parameter adjustment factor, and determining the adjusted target channel value" includes:
[0309] p1: Determine the deviation of mucosal brightness.
[0310] p2: For the mucosal L-channel component, based on the mucosal brightness deviation and the mucosal region brightness, brighten the mucosal L-channel component and determine the adjusted target mucosal L-channel value.
[0311] p3: For the mucosal A channel component, perform color calibration on the mucosal A channel component to determine the adjusted target mucosal A channel value.
[0312] p4: For the mucosal B channel component, based on the roughness characteristics of the mucosal region, determine the adjusted target B mucosal channel value.
[0313] In one possible implementation, when the image processing mode is a comprehensive confirmation mode for deep and superficial blood vessels, the purpose of adjusting the second image is to maximize the preservation of the natural color and micro-texture of the mucosa, and to provide an observation basis that conforms to the visual habits of the human eye through a "weak enhancement-self-adaptation" strategy.
[0314] Here, the mucosal L-channel component can be adaptively and weakly brightened based on the determined mucosal brightness deviation, and the mucosal brightness deviation can be determined based on the brightness of the mucosal region.
[0315] Specifically, the mucosal brightness deviation can be determined using the following formula:
[0316] ;
[0317] Where ΔL_dev is the mucosal brightness deviation; μLm is the mucosal region brightness; and 128 is the standard neutral brightness.
[0318] Furthermore, after determining the mucosal brightness deviation, the mucosal L-channel component can be adjusted based on the mucosal brightness deviation and the mucosal region brightness to determine the adjusted target mucosal L-channel value.
[0319] Specifically, the target mucosal L-channel value can be determined using the following formula:
[0320] ;
[0321] Where L_mucosa_adj is the adjusted target mucosal L-channel value; L_mucosa is the mucosal L-channel component; ΔL_dev is the mucosal brightness deviation; μLm is the mucosal region brightness; η L3 θ L3 ι L3 It is a constant. For example, η L3 For 1, θ L3 0.03, ι L3 The value is 1.
[0322] Here, for overly dark mucous membranes, i.e., mucous membranes with a brightness of less than 80, the gain can be set to 1.03 and the offset to 1; for overly bright mucous membranes, i.e., mucous membranes with a brightness of more than 160, the gain can be set to 0.97 and the offset to -1 to return to natural brightness.
[0323] Furthermore, for the mucosal A-channel component, color calibration of the mucosal A-channel component is required to obtain the adjusted target mucosal A-channel value.
[0324] Specifically, the adjusted target mucosal A-channel value can be determined using the following formula:
[0325] A_mucosa_ad ;
[0326] Where Amucosa_adj is the adjusted target mucosal A-channel value; A_mucosa is the mucosal A-channel component; η A3 θ A3 It is a constant. For example, η A3 0.93, θ A3 The gain can be set to 0.07; when the A channel component of the mucosa is close to neutral (128) in normal mucosa, the gain can be set to 0.99. For abnormal mucosa that is reddish or greenish, the gain can be set to 0.93 for slight correction.
[0327] Furthermore, for the mucosal B-channel component, it is necessary to preserve the texture of the mucosal B-channel component. The mucosal B-channel component is adjusted by the roughness characteristics of the mucosal region to obtain the adjusted target mucosal B-channel value.
[0328] Specifically, the adjusted target mucosal B-channel value can be determined using the following formula:
[0329] ;
[0330] Where Bmucosa_adj is the adjusted target mucosal B-channel value; B_mucosa is the mucosal B-channel component; R_m is the roughness feature; η B3 θB3 It is a constant. For example, η B3 1.0, θ B3 It is 0.02.
[0331] Here, the smooth mucosa is slightly enhanced with a yellow tint, and the gain can be set to 1.02; the rough mucosa remains neutral, and the gain can be set to 1.0 to match the natural texture of different tissues.
[0332] Furthermore, after obtaining the adjusted target channel values, the image can be back-pasted based on the adjusted target channel values to obtain a mapped image. The mapped image is then converted to a different color space to determine the enhanced target image.
[0333] S105. Based on the target channel values in the blood vessel region and the mucosa region, adjust the second image to determine the enhanced target image.
[0334] In one possible implementation, numerical mapping processing can be performed separately for the vascular region and the mucosal region to obtain a mapped image, which in turn yields the target image.
[0335] Specifically, the step "adjusting the second image based on the target channel values in the vascular region and the mucosal region to determine the enhanced target image" includes:
[0336] q1: While mapping the target channel value corresponding to the blood vessel region to the channel corresponding to the second image, retain the channel parameters of other regions in the second image to determine the first mapped image.
[0337] q2: Map the target channel value corresponding to the mucosal region to the channel corresponding to the first mapped image to obtain the second mapped image.
[0338] q3: Based on the second mapped image, determine the enhanced target image.
[0339] In one possible implementation, for different image processing modes, the target channel values corresponding to the blood vessel region obtained under the image processing mode, namely, the target blood vessel A channel value and the target blood vessel B channel value, are mapped back to the A and B channels of the second image according to the spatial positioning information of the blood vessel mask. The channel parameters of other regions in the second image are retained, and the first mapped image, namely, the optimized intermediate image of the blood vessel, is determined.
[0340] Furthermore, for different image processing modes, the target channel values corresponding to the mucosal region obtained under the image processing mode, namely the target mucosal A channel value, the target mucosal B channel value, and the target mucosal L channel value, are mapped to the corresponding channels of the first mapped image using "pixel-level weighted fusion" instead of direct overlay, based on the spatial positioning information of the mucosal mask, to obtain the target second mapped image.
[0341] Here, the formula for pixel-level weighted fusion can be:
[0342] ;
[0343] Wherein, Channel_final is the final parameter of the channel; Channel_vessel is the channel blood vessel mask; Channel_adj is the channel adjustment parameter; and mask is a 0-1 mask to achieve a smooth transition between blood vessels and mucosal regions, avoid obvious boundary artifacts, and obtain the second mapped image.
[0344] Furthermore, the second mapped image obtained after adjustment is an image in the LAB color space. In order to improve the accuracy of subsequent imaging, the second mapped image needs to be converted from the LAB color space to the BGR space to obtain the enhanced target image.
[0345] Specifically, the step "determine the enhanced target image based on the second mapped image" includes:
[0346] r1: Perform color space conversion on the second mapped image to determine the initial target image after enhancement processing.
[0347] r2: Perform a linear transformation on each color channel in the initial target image to determine the enhanced target image.
[0348] In one possible implementation, the second mapped image is converted to the color space of BGR to obtain the initial target image. Then, the blue, green, and red channels are optimized, fine-tuned, and the color tone is balanced using a linear transformation formula to obtain the target image.
[0349] In one possible implementation, the blue channel can be adjusted using the following formula:
[0350] ;
[0351] Wherein, Bule_adj is the adjusted blue channel parameter; Bule_channel is the original blue channel parameter; the value range of α is [1,2]; the value range of β is [0,1]; when α is greater than 1, it can slightly increase the gain of the blue component to balance the warm tone shift caused by the enhancement of red and yellow tones and maintain the neutral color baseline of the image.
[0352] In another possible implementation, the green channel can be adjusted using the following formula:
[0353] ;
[0354] Wherein, Green_adj is the adjusted green channel parameter; Green_channel is the original green channel parameter; the value range of α is [0,1]; the value range of β is [0,1]; the value of α is within [0,1], which can moderately reduce the green component gain, suppress the excessive green reflection on the mucosal surface commonly seen in endoscopic images, and improve the color differentiation between blood vessels and mucosa.
[0355] In another possible implementation, the red channel can be adjusted using the following formula:
[0356] ;
[0357] Wherein, Red_adj is the adjusted red channel parameter; Red_channel is the original red channel parameter; the value range of α is [0,1]; the value range of β is [2,5]; the value of α in [0,1] can slightly reduce the gain of the red component; the value range of β in [2,5] can preserve the red features of blood vessels while avoiding the loss of detail caused by excessive redness, thus enhancing the natural look of the image.
[0358] The enhancement process of endoscopic images in the embodiments of this application will be illustrated below through specific examples:
[0359] Please see Figure 4 , Figure 4 This is a flowchart of the endoscopic image enhancement processing provided in the embodiments of this application, such as... Figure 4As shown, the first image acquired by the image acquisition element in the endoscope is obtained. The first image can be an input image (BGR image). The BGR image is converted into a LAB image. The LAB image is decomposed to obtain an L-channel image, an A-channel image, and a B-channel image. Brightness control and contrast enhancement are performed on the L-channel image to obtain an adjusted L-channel image. Global color adjustment is performed on the A-channel image and the B-channel image respectively to obtain an adjusted A-channel image and an adjusted B-channel image. For the BGR image, the corresponding grayscale image is determined, and after blood vessel detection, blood vessel masks and mucosal masks are obtained. The adjusted L-channel image, adjusted A-channel image, and adjusted B-channel image are combined and adjusted to obtain the adjusted L / A / B channel merge. The blood vessel regions of the adjusted A-channel image and the adjusted B-channel image are adjusted, and the mucosal regions of the adjusted L-channel image, adjusted A-channel image, and adjusted B-channel image are adjusted. The adjusted L / A / B channels are combined to obtain the adjusted LAB image. The LAB image is converted to BGR to obtain the BGR image. Then, tone balancing and suppression filtering are performed to obtain the target image.
[0360] Based on the same inventive concept, this application also provides an endoscopic image enhancement device corresponding to the endoscopic image enhancement method. Since the principle of the device in this application is similar to the endoscopic image enhancement method described above in this application, the implementation of the device can refer to the implementation of all embodiments of the method, and repeated parts will not be described again.
[0361] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of an endoscopic image enhancement device provided in an embodiment of this application. Figure 5 As shown, the enhancement device 500 includes:
[0362] The image adjustment module 510 is used to acquire a first image acquired by the image acquisition element in the endoscope, adjust the channel parameters of the image channel of the first image, and determine the adjusted second image.
[0363] The image feature extraction module 520 is used to extract multiple image features of the grayscale image corresponding to the first image, and fuse multiple image features according to dynamically determined feature weight coefficients to obtain the third image;
[0364] Image segmentation module 530 is used to segment the third image according to a determined first threshold and a second threshold, determine the region selection module in the third image, and extract the blood vessel region and mucosa region in the third image based on the region selection module; wherein, the first threshold and the second threshold are determined according to the average gray level of the third image and the gray level variance of the third image;
[0365] The numerical adjustment module 540 is used to determine the image processing mode and, based on the parameter adjustment factor corresponding to the image processing mode, adjust the channel parameters in the blood vessel region and the mucosa region respectively, and determine the adjusted target channel value.
[0366] The target image determination module 550 is used to adjust the second image based on the target channel values in the blood vessel region and the mucosa region to determine the enhanced target image.
[0367] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device 600 includes a processor 610, a memory 620, and a bus 630.
[0368] The memory 620 stores machine-readable instructions executable by the processor 610. When the electronic device 600 is running, the processor 610 and the memory 620 communicate via the bus 630. When the machine-readable instructions are executed by the processor 610, they can perform the operations described above. Figure 1 The steps of the endoscopic image enhancement method in the illustrated method embodiment are specifically implemented as described in the method embodiment, and will not be repeated here. In some examples, the aforementioned electronic device may be an image processor.
[0369] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 The steps of the endoscopic image enhancement method in the illustrated method embodiment can be found in the method embodiment for specific implementation, and will not be repeated here.
[0370] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0371] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0372] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0373] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0374] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes 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.
[0375] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, 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, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for enhancing endoscopic images, characterized in that, The enhancement method includes: Acquire a first image captured by the image acquisition element in the endoscope, adjust the channel parameters of the image channel of the first image, and determine the adjusted second image; Extract multiple image features from the grayscale image corresponding to the first image, and fuse the multiple image features according to dynamically determined feature weight coefficients to obtain the third image; The third image is segmented according to the determined first threshold and second threshold, the region selection module in the third image is determined, and the blood vessel region and mucosa region in the third image are extracted based on the region selection module; wherein, the first threshold and the second threshold are determined according to the average gray level of the third image and the gray level variance of the third image; The image processing mode is determined, and based on the parameter adjustment factor corresponding to the image processing mode, the channel parameters in the blood vessel region and the mucosa region are adjusted respectively, and the adjusted target channel value is determined. Based on the target channel values in the blood vessel region and the mucosa region, the second image is adjusted to determine the enhanced target image. The determination of the image processing mode includes: Determine the proportion of the lesion mask in the third image; If the proportion of the lesion mask is greater than the first mask proportion threshold, the image processing mode is determined to be the bleeding source identification mode. If the proportion of the lesion mask is less than the second mask proportion threshold, the mean value of the calculated blood vessel depth factor is greater than the preset mean depth threshold, and the mean value of the calculated blood vessel diameter is less than the preset mean diameter threshold, the image processing mode is determined to be the deep blood vessel enhancement display mode. If the proportion of the lesion mask is greater than the second mask proportion threshold and less than the first mask proportion threshold, or if the mean value of the blood vessel depth factor is within the depth mean value range and the mean value of the blood vessel diameter is within the diameter mean value range, the image processing mode is determined to be a comprehensive confirmation mode for deep and superficial blood vessels.
2. The enhancement method according to claim 1, characterized in that, The step of extracting multiple image features from the grayscale image corresponding to the first image and fusing the multiple image features according to dynamically determined feature weight coefficients to obtain the third image includes: Multiple image features of the grayscale image corresponding to the first image are extracted, and each image feature is normalized to obtain an image feature matrix; For each image feature in the image feature matrix, determine the feature weight coefficient corresponding to that image feature; Based on the feature weight coefficient of each image feature, feature weighting calculation is performed on each image feature to obtain the initial fused feature image; Gamma correction is performed on the initial fused feature image to determine the third image.
3. The enhancement method according to claim 2, characterized in that, The steps for determining feature weight coefficients include: When the image feature is a grayscale feature, the grayscale value of each pixel in the grayscale image corresponding to the first image is determined; Determine the maximum gray value among the gray values of each pixel, and calculate the gray value difference between the maximum gray value and the average gray value of the pixels of the multiple pixels; Based on the grayscale difference, the maximum grayscale value, preset weight parameters, and grayscale value coefficients, determine the feature weight coefficients corresponding to the grayscale features; or, When the image feature is a texture feature, determine multiple texture entropy values in the grayscale image corresponding to the first image; Determine the maximum texture entropy value among multiple texture entropy values, and calculate the entropy difference between the maximum texture entropy value and the average texture entropy value of the multiple texture entropy values; Based on the entropy difference, the maximum texture entropy, preset weight parameters, and entropy coefficients, determine the feature weight coefficients corresponding to the texture features; or, When the image feature is a color feature or a clinical prior feature, the feature weight coefficient corresponding to the image feature is set to a preset weight coefficient.
4. The enhancement method according to claim 1, characterized in that, The extraction of the vascular region and mucosal region from the third image includes: For the third image, the regions in the third image with pixel grayscale values greater than the first threshold are determined as blood vessel regions, and the regions in the third image with pixel grayscale values less than the second threshold are determined as background regions; In the third image, regions with pixel grayscale values less than the first threshold and greater than the second threshold are identified as candidate blood vessel regions. The region in the candidate blood vessel region that is connected to the blood vessel region and contains more than a preset number of pixels is determined as the blood vessel region.
5. The enhancement method according to claim 1, characterized in that, The second image is a LAB color image; the channel parameters of the blood vessel region in the second image are adjusted through the following steps to determine the adjusted target channel values: Extract the blood vessel A channel component, blood vessel B channel component, and blood vessel L channel component from the blood vessel region in the second image. The target channel values are determined by adjusting the A and B channel components of the blood vessel based on the parameter adjustment factor.
6. The enhancement method according to claim 5, characterized in that, When the image processing mode is the bleeding source identification mode, the adjustment of the blood vessel A channel component and the blood vessel B channel component based on the parameter adjustment factor to determine the adjusted target channel value includes: Based on the blood vessel A channel component and the blood vessel L channel component, a bleeding probability factor is determined; For the blood vessel A channel component, the blood vessel A channel component is enhanced based on the bleeding probability factor to obtain the target blood vessel A channel value; For the blood vessel B channel component, the blood vessel B channel component is enhanced based on the bleeding probability factor to obtain the target blood vessel B channel value.
7. The enhancement method according to claim 5, characterized in that, When the image processing mode is a deep vascular enhancement display mode, the adjustment of the blood vessel A channel component and the blood vessel B channel component based on the parameter adjustment factor to determine the adjusted target channel value includes: Determine the mucosal region brightness corresponding to the mucosal region in the second image; The depth factor is determined based on the L-channel component of the blood vessel and the brightness of the mucosal region. For the blood vessel A channel component, based on the depth factor, the blood vessel A channel component is enhanced, and the adjusted target blood vessel A channel value is determined; For the vascular B-channel component, a color balance factor is determined based on the mean value of the vascular B-channel in the vascular region and the mean value of the mucosal B-channel in the mucosal region. Based on the depth factor and the color balance factor, the B channel component of the blood vessel is color-calibrated to determine the adjusted B channel value of the target blood vessel.
8. The enhancement method according to claim 7, characterized in that, When the image processing mode is a comprehensive deep and superficial blood vessel confirmation mode, the adjustment of the blood vessel A channel component and the blood vessel B channel component based on the parameter adjustment factor to determine the adjusted target channel value includes: For superficial blood vessels in the vascular region, based on the determined blood vessel diameter factor, the blood vessel A channel component is adjusted to determine the adjusted target blood vessel A channel value. For deep blood vessels in the vascular region, the local feature parameters of the vascular region include texture entropy. Based on the depth factor and texture entropy correction term, the A-channel component of the blood vessel is enhanced, and the adjusted A-channel value of the target blood vessel is determined. For the blood vessel B channel component, based on the depth factor, the blood vessel B channel component is balanced to determine the adjusted target blood vessel B channel value.
9. The enhancement method according to claim 6, characterized in that, The second image is a LAB color image; The channel parameters of the mucosal region in the second image are adjusted using the following steps to determine the adjusted target channel values: Extract the mucosa A channel component, mucosa B channel component, and mucosa L channel component from the mucosa region in the second image; The target channel values are determined by adjusting the mucosal A channel component, the mucosal B channel component, and the mucosal L channel component based on the parameter adjustment factor.
10. The enhancement method according to claim 9, characterized in that, When the image processing mode is the bleeding source identification mode, the adjustment of the mucosa A channel component, the mucosa B channel component, and the mucosa L channel component based on the parameter adjustment factor to determine the adjusted target channel value includes: The brightness difference factor was determined based on the brightness of the vascular area and the brightness of the mucosal area. For the mucosal L-channel component, based on the brightness difference factor, the mucosal L-channel component is brightened, and the adjusted target mucosal L-channel value is determined; For the mucosal A channel component, the adjusted target mucosal A channel value is determined based on the bleeding probability factor; Based on the roughness characteristics of the mucosal region, the mucosal B channel component is balanced to determine the adjusted target mucosal B channel value.
11. The enhancement method according to claim 9, characterized in that, When the image processing mode is a deep vascular enhancement display mode, the adjustment of the mucosal A channel component, the mucosal B channel component, and the mucosal L channel component based on the parameter adjustment factor to determine the adjusted target channel value includes: For the mucosal L-channel component, based on a predetermined regional average depth factor, the mucosal L-channel component is brightened, and the adjusted target mucosal L-channel value is determined. For the mucosal A channel component, based on a predetermined regional average depth factor, the mucosal A channel component is suppressed, and the adjusted target mucosal A channel value is determined. Based on the roughness characteristics of the mucosal region, the mucosal B channel component is enhanced for the mucosal B channel component, and the adjusted target mucosal B channel value is determined.
12. The enhancement method according to claim 10, characterized in that, When the image processing mode is a comprehensive deep and superficial blood vessel confirmation mode, the adjustment of the mucosal A channel component, the mucosal B channel component, and the mucosal L channel component based on the parameter adjustment factor to determine the adjusted target channel value includes: Determine the deviation of mucosal brightness; For the mucosal L-channel component, based on the mucosal brightness deviation and the mucosal region brightness, the mucosal L-channel component is brightened, and the adjusted target mucosal L-channel value is determined. For the mucosal A channel component, color calibration is performed on the mucosal A channel component to determine the adjusted target mucosal A channel value; For the mucosal B channel component, the adjusted target B mucosal channel value is determined based on the roughness characteristics of the mucosal region.
13. The enhancement method according to claim 1, characterized in that, The step of adjusting the second image based on the target channel values in the vascular region and the mucosal region to determine the enhanced target image includes: While mapping the target channel value corresponding to the blood vessel region to the channel corresponding to the second image, the channel parameters of other regions in the second image are retained to determine the first mapped image; The target channel values corresponding to the mucosal region are mapped to the channels corresponding to the first mapped image to obtain the second mapped image; Based on the second mapped image, the enhanced target image is determined.
14. The enhancement method according to claim 1, characterized in that, The process of acquiring a first image captured by an image acquisition element in an endoscope, adjusting the channel parameters of the image channels of the first image, and determining the adjusted second image includes: The first image is converted to a color space to obtain an initial LAB color image; The initial LAB color image is decomposed into L channel image, A channel image and B channel image; For the L channel image, if the initial LAB color image is overexposed, the contrast of the L channel image is enhanced, and the L channel image is adjusted. For the A channel image and the B channel image, perform linear red-green tone balance adjustment to determine the A channel image and the B channel image to be adjusted; The second image is determined by recombining the adjusted L-channel image, the adjusted A-channel image, and the adjusted B-channel image.
15. An endoscopic image enhancement device, characterized in that, The enhancement device includes: The image adjustment module is used to acquire a first image captured by the image acquisition element in the endoscope, adjust the channel parameters of the image channel of the first image, and determine the adjusted second image. The image feature extraction module is used to extract multiple image features of the grayscale image corresponding to the first image, and fuse the multiple image features according to dynamically determined feature weight coefficients to obtain the third image; An image segmentation module is used to segment the third image according to a determined first threshold and a second threshold, determine a region selection module in the third image, and extract blood vessel regions and mucosal regions in the third image based on the region selection module; wherein, the first threshold and the second threshold are determined based on the average gray level of the third image and the gray level variance of the third image; The numerical adjustment module is used to determine the image processing mode and, based on the parameter adjustment factor corresponding to the image processing mode, adjust the channel parameters in the blood vessel region and the mucosa region respectively, and determine the adjusted target channel value. The target image determination module is used to adjust the second image based on the target channel values in the blood vessel region and the mucosa region to determine the enhanced target image. When determining the image processing mode, the numerical adjustment module is used to: Determine the proportion of the lesion mask in the third image; If the proportion of the lesion mask is greater than the first mask proportion threshold, the image processing mode is determined to be the bleeding source identification mode. If the proportion of the lesion mask is less than the second mask proportion threshold, the mean value of the calculated blood vessel depth factor is greater than the preset mean depth threshold, and the mean value of the calculated blood vessel diameter is less than the preset mean diameter threshold, the image processing mode is determined to be the deep blood vessel enhancement display mode. If the proportion of the lesion mask is greater than the second mask proportion threshold and less than the first mask proportion threshold, or if the mean value of the blood vessel depth factor is within the depth mean value range and the mean value of the blood vessel diameter is within the diameter mean value range, the image processing mode is determined to be a comprehensive confirmation mode for deep and superficial blood vessels.
16. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, the storage medium storing machine-readable instructions executable by the processor, wherein when the electronic device is in operation, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the endoscopic image enhancement method as described in any one of claims 1 to 14.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the endoscopic image enhancement method as described in any one of claims 1 to 14.