Endoscope image enhancement method and device, electronic equipment and storage medium
By staining and structurally enhancing endoscopic images, the image quality problems caused by uneven endoscopic illumination and complex cavity structures are resolved, improving the brightness consistency and texture clarity of the images, and enhancing the ability to identify minute lesions and early-stage cancers.
Patent Information
- Application Number
- CN202511121343.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-10-28
AI Technical Summary
Existing endoscopic techniques suffer from uneven image brightness, unclear texture, and poor lesion visualization due to uneven illumination and the complex structure of human cavities, which particularly affects the visualization of small lesions in the early diagnosis of cancer.
By performing color enhancement and structural enhancement on endoscopic images, including algorithms such as tone transfer, multi-scale brightness enhancement, adaptive histogram equalization, directional filtering, and homomorphic filtering, combined with image classification models and fusion techniques, the brightness consistency and texture clarity of the images are improved.
It improves the brightness consistency and texture clarity of endoscopic images, enhances the ability to identify minute lesions and early-stage cancers, and assists doctors in making more accurate diagnoses.
Smart Images

Figure CN120852170A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an endoscopic image enhancement method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the continuous development of medical endoscopy technology, electronic staining has become an important tool for diagnosing lesions in cavities. Electronic staining uses digital image processing algorithms to virtually stain tissue surfaces, highlighting vascular morphology and mucosal structures. Currently, two main methods are used clinically: spectrophotometric staining and electronic staining. Electronic staining is widely used due to its advantages, such as eliminating the need for staining agents and its ease of operation.
[0003] In existing technologies, electronic staining techniques are typically implemented using white light-illuminated endoscope systems. These systems provide illumination via a light source at the endoscope's tip. After an image sensor acquires images of the intracavitary tissue, specific image processing algorithms are used to enhance the visualization of blood vessels and fine structures on the mucosal surface. However, the varying degrees of curvature of the endoscope's curved section as it enters the body cavity lead to uneven illumination distribution, resulting in areas of varying brightness and darkness on the image. Furthermore, the complex anatomical structures within the body cavity, such as the folds of the digestive tract and the depressions at bronchial bifurcations, cause differences in light reflection and absorption, further exacerbating the uneven illumination and directly affecting the imaging quality of electronic staining. This is particularly problematic in diagnosing early-stage cancers, where the visualization of minute lesions is often significantly reduced due to decreased image quality. Summary of the Invention
[0004] In view of this, the purpose of this application is to provide an endoscopic image enhancement method, device, electronic device and storage medium, which solves the problems of uneven image brightness, unclear texture and poor lesion visualization caused by uneven endoscopic illumination and complex human cavity structure in the prior art. It improves the brightness consistency, color naturalness and texture clarity of the image, and further enhances the ability to identify small lesions and early cancers using the target endoscopic image, assisting doctors in making more accurate diagnoses.
[0005] In a first aspect, embodiments of this application provide an endoscopic image enhancement method, the endoscopic image enhancement method comprising: The original endoscopic image acquired by the image acquisition element in the endoscope is obtained, and the original endoscopic image is stained and enhanced to obtain a first enhanced image; The image category corresponding to the original endoscopic image is determined, and the original endoscopic image is constructed and enhanced based on the construction enhancement algorithm corresponding to the image category to obtain a second enhanced image; The first enhanced image and the second enhanced image are fused to obtain an enhanced target endoscope image.
[0006] Furthermore, the step of staining and enhancing the original endoscopic image to obtain a first enhanced image includes: The original endoscope image is converted from the RGB color space to the Lab color space to obtain the original Lab image corresponding to the original endoscope image; The original Lab image is subjected to tone shifting and multi-scale brightness enhancement to obtain the target Lab image; The target Lab image is converted from the Lab color space to the RGB color space to obtain the first enhanced image.
[0007] Furthermore, when the image category of the original endoscopic image is a digestive tract image, the construction enhancement algorithm is an adaptive histogram equalization algorithm.
[0008] Furthermore, when the image category of the original endoscopic image is a respiratory tract image, the construction enhancement algorithm is a directional filtering algorithm.
[0009] Furthermore, when the image category of the original endoscopic image is a urinary system image, the construction enhancement algorithm is a homomorphic filtering algorithm.
[0010] Furthermore, determining the image category corresponding to the original endoscopic image includes: The original endoscopic image is input into a pre-trained image classification model to obtain the image category corresponding to the original endoscopic image; The image classification model is trained using the following steps: Acquire sample data; wherein, the sample data includes endoscopic sample images and the sample image categories corresponding to the endoscopic sample images; The endoscope sample image is input into the original image classification model to determine the predicted image category corresponding to the endoscope sample image; The sample image category corresponding to the endoscope sample image is compared with the predicted image category, and the loss function of the original image classification model in the current state is calculated. The original image classification model is iteratively trained based on the loss function until the preset training completion conditions are met, thus obtaining the trained image classification model.
[0011] Furthermore, determining the image category corresponding to the original endoscopic image includes: The model information corresponding to the endoscope is determined, and the image category corresponding to the original endoscope image is determined based on the model information.
[0012] Secondly, embodiments of this application also provide an endoscopic image enhancement device, the endoscopic image enhancement device comprising: The first enhancement module is used to acquire the original endoscopic image acquired by the image acquisition element in the endoscope, and to perform staining enhancement on the original endoscopic image to obtain the first enhanced image; The second enhancement module is used to determine the image category corresponding to the original endoscopic image, and to perform construction enhancement on the original endoscopic image based on the construction enhancement algorithm corresponding to the image category to obtain the second enhanced image; The image fusion module is used to fuse the first enhanced image and the second enhanced image to obtain an enhanced target endoscope image.
[0013] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the endoscopic image enhancement method described above are performed.
[0014] 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 described above.
[0015] This application provides an endoscopic image enhancement method, apparatus, electronic device, and storage medium. First, an original endoscopic image is acquired by an image acquisition element in the endoscope, and the original endoscopic image is stained and enhanced to obtain a first enhanced image. Then, the image category corresponding to the original endoscopic image is determined, and the original endoscopic image is constructed and enhanced based on the construction enhancement algorithm corresponding to the image category to obtain a second enhanced image. Finally, the first enhanced image and the second enhanced image are fused to obtain an enhanced target endoscopic image.
[0016] This application first performs color enhancement on the original image, and then selects the optimal structure enhancement algorithm based on the characteristics of different image categories to enhance the structure of the original image, thereby improving the recognition ability of specific structures. Finally, the color-enhanced image and the structure-enhanced image are fused to form a more complete color image. This solves the problems of uneven image brightness, unclear texture, and poor lesion visualization caused by uneven endoscopic illumination and the complex structure of human cavities in existing technologies. It improves the brightness consistency, color naturalness, and texture clarity of the image, further enhancing the ability to identify minute lesions and early cancers using target endoscopic images, and assisting doctors in making more accurate diagnoses.
[0017] 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
[0018] 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.
[0019] Figure 1 A flowchart illustrating an endoscopic image enhancement method provided in this application embodiment; Figure 2 This is one of the structural schematic diagrams of an endoscopic image enhancement device provided in the embodiments of this application; Figure 3 This is a second schematic diagram of the structure of an endoscopic image enhancement device provided in an embodiment of this application; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Detailed Implementation
[0020] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present application.
[0021] First, the applicable scenarios for this application will be introduced. This application can be applied to the field of image processing technology.
[0022] With the continuous development of medical endoscopy technology, electronic staining has become an important tool for diagnosing lesions in cavities. Electronic staining uses digital image processing algorithms to virtually stain tissue surfaces, highlighting vascular morphology and mucosal structures. Currently, two main methods are used clinically: spectrophotometric staining and electronic staining. Electronic staining is widely used due to its advantages, such as eliminating the need for staining agents and its ease of operation.
[0023] Research has found that in existing technologies, electron microscopy (EMS) staining techniques are typically based on white-light illumination endoscope systems. These systems provide illumination through a light source at the endoscope's tip. After an image sensor acquires images of the tissue within the cavity, specific image processing algorithms are used to enhance the visualization of blood vessels and fine structures on the mucosal surface. However, the varying degrees of curvature of the endoscope's curved section as it enters the body cavity lead to uneven illumination distribution, resulting in areas of varying brightness and darkness on the image. Furthermore, the complex anatomical structures within the body cavity, such as the folds of the digestive tract and the depressions at bronchial bifurcations, cause differences in light reflection and absorption, further exacerbating the uneven illumination and directly affecting the imaging quality of EMS. This is particularly problematic in diagnosing early-stage cancers, where the visualization of minute lesions is often significantly reduced due to decreased image quality.
[0024] Based on this, this application provides an endoscopic image enhancement method that solves the problems of uneven image brightness, unclear texture, and poor lesion visualization caused by uneven endoscopic illumination and complex human cavity structures in the prior art. It improves the brightness consistency, color naturalness, and texture clarity of the image, further enhancing the ability to identify minute lesions and early cancers using the target endoscopic image, and assisting doctors in making more accurate diagnoses.
[0025] Please see Figure 1 , Figure 1 This is a flowchart illustrating an endoscopic image enhancement method provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the endoscopic image enhancement method includes: S101, acquire the original endoscope image acquired by the image acquisition element in the endoscope, and perform color enhancement on the original endoscope image to obtain the first enhanced image.
[0026] Regarding step S101 above, in specific implementation, when the endoscope photographs the observation site within a living organism, it acquires the surface condition of the cavity or channel at the observation site as captured by the image acquisition element in the endoscope, thus obtaining a raw endoscopic image. Specifically, the raw endoscopic image is an RGB color image. Then, the raw endoscopic image is stained and enhanced to obtain a first enhanced image.
[0027] As an optional embodiment, regarding step S101 above, the step of staining and enhancing the original endoscopic image to obtain a first enhanced image includes: Step 1011: Convert the original endoscope image from RGB color space to Lab color space to obtain the original Lab image corresponding to the original endoscope image.
[0028] Here, the RGB color space represents the three primary color model of color and is widely used in computer screen displays. The Lab color space is a more general color model, consisting of three parts: a luminance (L) channel and two chrominance (a and b) channels, all of which provide a device-independent method of color representation.
[0029] Regarding step 1011 above, in specific implementation, the original endoscopic image is converted from the RGB color space to the Lab color space to obtain the original Lab image corresponding to the original endoscopic image. Here, it is necessary to first convert the original endoscopic image from the RGB color space to an XYZ image; then, using a color space conversion method, the XYZ image is converted to a Lab image to obtain the original Lab image corresponding to the original endoscopic image. Alternatively, a color conversion function can be used for Lab color space conversion. Specifically, RgbToLab can be used for color conversion; RgbToLab is a tool for converting RGB color space to Lab color space. The specific formula is as follows:
[0030] Step 1012: Perform tone shifting and multi-scale brightness enhancement on the original Lab image to obtain the target Lab image.
[0031] In specific implementation of step 1012, the original Lab image after Lab color space conversion is subjected to tone shifting and multi-scale brightness enhancement to obtain the target Lab image.
[0032] Specifically, regarding step 1012 above, the step of performing tone shifting and multi-scale brightness enhancement on the original Lab image to obtain the target Lab image includes: A: Perform channel decomposition on the original Lab image to obtain the L-channel image, the a-channel image, and the b-channel image.
[0033] Here, the L channel represents brightness, ranging from 0 (complete black) to 100 (complete white), with the midpoint 50 representing medium brightness. The a and b channels represent the chromaticity information of the color. The a channel varies from negative (green) to positive (red), and the b channel varies from negative (blue) to positive (yellow). The range of the a and b channels is [-128, 127].
[0034] In step A above, in specific implementation, the original Lab image is decomposed into L-channel image, a-channel image and b-channel image.
[0035] B: The Reinhard color transfer algorithm is used to perform tone transfer on the a-channel image and the b-channel image respectively, resulting in tone-transferred a-channel image and tone-transferred b-channel image.
[0036] Regarding step B above, in specific implementation, the Reinhard color transfer algorithm is used to perform tone transfer on the a-channel image and the b-channel image respectively, resulting in tone-transferred a-channel image and tone-transferred b-channel image. Here, the Reinhard color transfer algorithm adjusts the color style of the source image to be consistent with the target image by matching the color distribution of the source image (the image to be processed) and the target image (the reference image), while preserving the structural information of the source image.
[0037] Endoscopic images often suffer from uneven illumination (e.g., edge attenuation from cold light sources), color distortion (e.g., yellowish / reddish tint caused by mucosal surface reflection), and low contrast (blurred details in deep tissues). The Reinhard color transfer algorithm can adaptively correct uneven illumination, improving global consistency; preserve anatomical details, avoiding excessive distortion; naturally correct color shifts, meeting clinical needs; offer flexible parameters to adapt to different endoscopic modes; and boast high computational efficiency, suitable for real-time processing.
[0038] C: The L-channel image is enhanced with multi-scale brightness using the MSRCR algorithm to obtain the enhanced L-channel image.
[0039] Regarding step C above, in specific implementation, the MSRCR algorithm is used to perform multi-scale brightness enhancement on the L-channel image, resulting in a brightness-enhanced L-channel image. Here, MSRCR (Multi-Scale Retinex with Color Restoration) is mainly used to improve image quality under low-light conditions, especially performing excellently in color image processing. By using the MSRCR algorithm to perform multi-scale brightness enhancement on the L-channel image, the incident (illumination) and reflected (reflection) components of the image can be separated. Combined with multi-scale processing and color restoration mechanisms, detail enhancement and color fidelity are achieved, solving the detail loss problem of traditional image enhancement algorithms. The color restoration mechanism optimizes the processing effect of color images, resulting in a low-light image enhancement algorithm that balances detail enhancement and color fidelity. Specifically, the input L-channel image... And the blur radius, which is calculated during processing to create the blurred image of the L-channel image according to the blur radius. Then calculate according to the following formula. Value:
[0040] Then, Log[R(x,y)] is quantized into pixel values ranging from 0 to 255, which is used as the final output, i.e., the L-channel image after brightness enhancement.
[0041] D: The tone-shifted a-channel image, the tone-shifted b-channel image, and the brightness-enhanced L-channel image are combined to obtain the target Lab image.
[0042] Regarding step D above, in practical implementation, after color transfer and multi-scale brightness enhancement, the tone-transferred a-channel image, the tone-transferred b-channel image, and the brightness-enhanced L-channel image are synthesized to obtain the target Lab image. In this way, the MSRCR and Reinhard algorithms work synergistically to effectively improve the problem of uneven illumination and enhance the overall brightness and color consistency of the image.
[0043] Step 1013: Convert the target Lab image from Lab color space to RGB color space to obtain the first enhanced image.
[0044] Regarding step 1013 above, in specific implementation, the target Lab image is converted from the Lab color space to the RGB space to obtain the first enhanced image. Specifically, the LabToRgb algorithm is used to inversely transform the target Lab image from the Lab color space back to the RGB color space, including the following steps: (1) Normalize Lab values: Normalize the Lab channel values, and normalize the three Lab channels respectively to facilitate subsequent linear combination operations. (2) Generate intermediate variables L, M, S: Generate three new variables through linear combination for subsequent calculations. (3) Exponential operation (non-linear transformation): Perform exponential operation on the intermediate variables to convert the linear values into a non-linear space. (4) Generate RGB values through linear combination: Map L, M, S to the RGB space through linear transformation. (5) Ensure RGB values are within the legal range: Prevent the calculation results from overflowing and ensure that the output is a valid 8-bit unsigned integer.
[0045] S102, determine the image category corresponding to the original endoscope image, and perform construction enhancement on the original endoscope image based on the construction enhancement algorithm corresponding to the image category to obtain a second enhanced image.
[0046] Regarding step S102 above, in specific implementation, the image category corresponding to the original endoscopic image is determined, and the original endoscopic image is enhanced based on the construction enhancement algorithm corresponding to the image category to obtain a second enhanced image. In this way, the texture construction of the enhanced image can effectively solve the problem of unclear texture in some areas due to curvature, depressions, folds, etc. within the human body cavity. Here, the image category can be any one of digestive tract images, respiratory tract images, or urinary system images; this application does not specifically limit this. Because different organs within the human body cavity have their own unique characteristics, it is necessary to select the most suitable texture enhancement algorithm based on the anatomical structure, imaging characteristics, and clinical needs (such as lesion detection and structural assessment) of the digestive tract, respiratory tract, and urinary system, combined with their texture characteristics (such as mucosal folds, airway branches, and lumen complexity). Thus, by selecting the optimal texture enhancement algorithm according to different image categories, the recognition ability of specific structures is improved.
[0047] As an optional embodiment, the image category corresponding to the original endoscopic image can be determined in the following two ways: Method 1: Input the original endoscope image into a pre-trained image classification model to obtain the image category corresponding to the original endoscope image.
[0048] Regarding Method 1 above, in specific implementation, the original endoscopic image is input into a pre-trained image classification model. The image classification model is then used to predict the type of the original endoscopic image to obtain the corresponding image category. Here, as an example, the VGG model can be selected as the image classification model, and this application does not specifically limit it.
[0049] Method 2: Determine the model information of the endoscope, and determine the image category corresponding to the original endoscope image based on the model information.
[0050] Regarding Method 2, in its specific implementation, the model information of the endoscope is determined, and the image category corresponding to the original endoscope image is determined based on the model information.
[0051] Specifically, for method one, the image classification model is trained through the following steps: I: Obtain sample data.
[0052] Regarding step I above, in specific implementation, sample data is obtained for training the original image classification model. Specifically, the sample data includes endoscope sample images and the corresponding sample image categories.
[0053] II: Input the endoscope sample image into the original image classification model to determine the predicted image category corresponding to the endoscope sample image.
[0054] Regarding step II above, in specific implementation, the endoscope sample image is input into the original image classification model to determine the predicted image category corresponding to the endoscope sample image predicted by the original image classification model.
[0055] III: Compare the sample image category corresponding to the endoscope sample image with the predicted image category, and calculate the loss function of the original image classification model in the current state.
[0056] IV: Iteratively train the original image classification model based on the loss function until the preset training completion conditions are met, and obtain the trained image classification model.
[0057] It's important to note that a loss function is a function that maps the values of a random event or its related random variables to non-negative real numbers to represent the "risk" or "loss" of that random event. In applications, the loss function is often used as a learning criterion in relation to optimization problems; that is, the model is solved and evaluated by minimizing the loss function. Preset training completion conditions include the loss value of the loss function being less than a preset threshold or the preset number of training iterations being reached.
[0058] Regarding steps III-IV above, in specific implementation, for each endoscope sample image, the sample image category of the endoscope sample image is compared with the predicted image category. By comparing the sample image category with the predicted image category, the accuracy of the original image classification model's prediction is determined. If the sample image category and the predicted image category are different, the original image classification model's prediction is considered inaccurate. At this point, the loss function of the original image classification model in the current state needs to be calculated. The method for calculating the loss function is explained in detail in existing technologies and will not be elaborated further here. Then, the model parameters of the original image classification model are continuously adjusted. The original image classification model will continuously minimize the loss through iteration. At each iteration step, the loss function of the original image classification model is calculated. When the loss value of the original image classification model's loss function cannot reach the preset threshold, the model parameters of the original image classification model are continuously updated. The new parameters will calculate a new loss value, thus causing the loss value to show a fluctuating downward trend during the iteration process. Finally, when the loss value of the loss function is less than the preset threshold, or when the preset number of iterations is reached, training ends, and the trained image classification model is obtained.
[0059] As an optional embodiment, regarding step S102 above, when the image category of the original endoscopic image is a digestive tract image, the construction enhancement algorithm is an adaptive histogram equalization algorithm. Here, when the image category of the original endoscopic image is a digestive tract image, the adaptive histogram equalization algorithm is used to construct and enhance the original endoscopic image to obtain a second enhanced image. In endoscopic images of the digestive tract (stomach, intestines, etc.), the core textures are the tiny folds, villi, and vascular networks on the mucosal surface, as well as the blurred boundaries of lesions (such as ulcers, polyps, and inflammation). The requirement is to enhance mucosal details to improve the early lesion detection rate while preserving the continuity of normal structures. Therefore, the digestive tract needs to focus on enhancing mucosal texture and lesion boundaries. The adaptive histogram equalization (CLAHE) algorithm can be used. Endoscopic images often suffer from local contrast reduction due to uneven illumination (such as lens reflection). CLAHE uses block-based adaptive equalization to prioritize enhancing the contrast of small areas such as mucosal folds, avoiding the overexposure problem of global equalization.
[0060] In some examples, CLAHE uses a block-based adaptive equalization process as follows: (1) Block processing: The image is divided into many small blocks (called “tiles”). These tiles are typically 8x8, 16x16, or larger, depending on the image size and requirements. (2) Applying histogram equalization to each tile: Histogram equalization is performed on each tile separately. This means that the contrast of each tile in the image is enhanced. (3) Contrast limiting: To prevent excessively high contrast in each tile due to histogram equalization (which could lead to noise amplification), the CLAHE method limits the histogram “bins” to a specified limit value. Pixels exceeding this limit are evenly distributed to the other bins. The histogram “bins” (or “buckets”) are intervals used to statistically analyze the distribution of data. Each bin contains a specific range of pixel values and records the number of pixels falling within that range. (4) Bilinear interpolation: The boundaries between equalized patches will be discontinuous after the histogram is applied. In order to eliminate the "artifacts" between the boundaries of the patches, bilinear interpolation is used to adjust the value of the boundary pixels according to the equalization results of the adjacent patches. (5) Merging small patches: Finally, the adjusted small patches are recombined into the final image.
[0061] As an optional embodiment, regarding step S102 above, when the image category of the original endoscopic image is a respiratory tract image, the construction enhancement algorithm is a directional filtering algorithm. Here, in the images of the respiratory tract (trachea, bronchi, lungs), the requirement is to enhance the hierarchical structure of the airway to improve the accuracy of anatomical localization, while highlighting the morphological features of small lesions. Therefore, when the image category of the original endoscopic image is a digestive tract image, directional filtering (Gabor) is used to construct and enhance the original endoscopic image to obtain a second enhanced image. The directional filtering algorithm is described in detail in the prior art and will not be repeated here.
[0062] As an optional embodiment, regarding step S102 above, when the image category of the original endoscopic image is a urinary system image, the construction enhancement algorithm is a homomorphic filtering algorithm. Here, the core texture of the urinary system (kidney, ureter, bladder) consists of the complex branching structures of the renal calyces / pelvis (such as staghorn calculi), the mucosal folds of the bladder wall, and the internal structures of lesions such as stones and tumors (such as calcification and necrotic areas). The requirement is to enhance the edges and internal layers of the lumen to distinguish normal tissue from lesions (such as stones and blood clots, tumors and polyps). Therefore, when the image category of the original endoscopic image is a urinary system image, a homomorphic filtering algorithm is used to construct and enhance the original endoscopic image to obtain a second enhanced image. The homomorphic filtering algorithm is described in detail in the prior art and will not be repeated here.
[0063] S103, the first enhanced image and the second enhanced image are fused to obtain the enhanced target endoscope image.
[0064] Regarding step S103 above, in specific implementation, after obtaining the first enhanced image with staining enhancement and the second enhanced image with structural enhancement, the first enhanced image and the second enhanced image are fused to obtain the enhanced target endoscope image. Here, image fusion can be performed as a 1:1 fusion or a weighted fusion, and this application does not specifically limit it.
[0065] This application provides an endoscopic image enhancement method. First, an original endoscopic image is acquired by an image acquisition element in the endoscope, and the original endoscopic image is stained and enhanced to obtain a first enhanced image. Then, the image category corresponding to the original endoscopic image is determined, and the original endoscopic image is constructed and enhanced based on the construction enhancement algorithm corresponding to the image category to obtain a second enhanced image. Finally, the first enhanced image and the second enhanced image are fused to obtain an enhanced target endoscopic image.
[0066] This application first performs color enhancement on the original image, and then selects the optimal structure enhancement algorithm based on the characteristics of different image categories to enhance the structure of the original image, thereby improving the recognition ability of specific structures. Finally, the color-enhanced image and the structure-enhanced image are fused to form a more complete color image. This solves the problems of uneven image brightness, unclear texture, and poor lesion visualization caused by uneven endoscopic illumination and the complex structure of human cavities in existing technologies. It improves the brightness consistency, color naturalness, and texture clarity of the image, further enhancing the ability to identify minute lesions and early cancers using target endoscopic images, and assisting doctors in making more accurate diagnoses.
[0067] Please see Figure 2 , Figure 3 , Figure 2 This is one of the structural schematic diagrams of an endoscopic image enhancement device provided in the embodiments of this application. Figure 3 This is a second schematic diagram of the structure of an endoscopic image enhancement device provided in an embodiment of this application. Figure 2 As shown, the endoscopic image enhancement device 200 includes: The first enhancement module 201 is used to acquire the original endoscope image acquired by the image acquisition element in the endoscope, and to perform staining enhancement on the original endoscope image to obtain the first enhanced image; The second enhancement module 202 is used to determine the image category corresponding to the original endoscope image, and to perform construction enhancement on the original endoscope image based on the construction enhancement algorithm corresponding to the image category to obtain the second enhanced image; The image fusion module 203 is used to fuse the first enhanced image and the second enhanced image to obtain an enhanced target endoscope image.
[0068] Furthermore, when the first enhancement module 201 performs staining enhancement on the original endoscopic image to obtain a first enhanced image, the first enhancement module 201 is also used for: The original endoscope image is converted from the RGB color space to the Lab color space to obtain the original Lab image corresponding to the original endoscope image; The original Lab image is subjected to tone shifting and multi-scale brightness enhancement to obtain the target Lab image; The target Lab image is converted from the Lab color space to the RGB color space to obtain the first enhanced image.
[0069] Furthermore, when the image category of the original endoscopic image is a digestive tract image, the construction enhancement algorithm is an adaptive histogram equalization algorithm.
[0070] Furthermore, when the image category of the original endoscopic image is a respiratory tract image, the construction enhancement algorithm is a directional filtering algorithm.
[0071] Furthermore, when the image category of the original endoscopic image is a urinary system image, the construction enhancement algorithm is a homomorphic filtering algorithm.
[0072] Furthermore, when determining the image category corresponding to the original endoscopic image, the second enhancement module 202 is also used to: The original endoscopic image is input into a pre-trained image classification model to obtain the image category corresponding to the original endoscopic image.
[0073] Please see Figure 3 The endoscopic image enhancement device 200 further includes a model training module 204, which is used to train the image classification model through the following steps: Acquire sample data; wherein, the sample data includes endoscopic sample images and the sample image categories corresponding to the endoscopic sample images; The endoscope sample image is input into the original image classification model to determine the predicted image category corresponding to the endoscope sample image; The sample image category corresponding to the endoscope sample image is compared with the predicted image category, and the loss function of the original image classification model in the current state is calculated. The original image classification model is iteratively trained based on the loss function until the preset training completion conditions are met, thus obtaining the trained image classification model.
[0074] Furthermore, when determining the image category corresponding to the original endoscopic image, the second enhancement module 202 is also used to: The model information corresponding to the endoscope is determined, and the image category corresponding to the original endoscope image is determined based on the model information.
[0075] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in FIG, the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .
[0076] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned 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.
[0077] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned 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.
[0078] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0079] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.
[0080] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0081] 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.
[0082] 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.
[0083] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. These modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for enhancing endoscopic images, characterized in that, The endoscopic image enhancement method includes: The original endoscopic image acquired by the image acquisition element in the endoscope is obtained, and the original endoscopic image is stained and enhanced to obtain a first enhanced image; The image category corresponding to the original endoscopic image is determined, and the original endoscopic image is constructed and enhanced based on the construction enhancement algorithm corresponding to the image category to obtain a second enhanced image; The first enhanced image and the second enhanced image are fused to obtain an enhanced target endoscope image.
2. The endoscopic image enhancement method according to claim 1, characterized in that, The step of staining and enhancing the original endoscopic image to obtain a first enhanced image includes: The original endoscope image is converted from RGB space to Lab color space to obtain the original Lab image corresponding to the original endoscope image; The original Lab image is subjected to tone shifting and multi-scale brightness enhancement to obtain the target Lab image; The target Lab image is converted from the Lab color space to the RGB color space to obtain the first enhanced image.
3. The endoscopic image enhancement method according to claim 1, characterized in that, When the image category of the original endoscopic image is a digestive tract image, the construction enhancement algorithm is an adaptive histogram equalization algorithm.
4. The endoscopic image enhancement method according to claim 1, characterized in that, When the image category of the original endoscopic image is a respiratory tract image, the construction enhancement algorithm is a directional filtering algorithm.
5. The endoscopic image enhancement method according to claim 1, characterized in that, When the image category of the original endoscopic image is a urinary system image, the construction enhancement algorithm is a homomorphic filtering algorithm.
6. The endoscopic image enhancement method according to claim 1, characterized in that, Determining the image category corresponding to the original endoscopic image includes: The original endoscopic image is input into a pre-trained image classification model to obtain the image category corresponding to the original endoscopic image; The image classification model is trained using the following steps: Acquire sample data; wherein, the sample data includes endoscopic sample images and the sample image categories corresponding to the endoscopic sample images; The endoscope sample image is input into the original image classification model to determine the predicted image category corresponding to the endoscope sample image; The sample image category corresponding to the endoscope sample image is compared with the predicted image category, and the loss function of the original image classification model in the current state is calculated. The original image classification model is iteratively trained based on the loss function until the preset training completion conditions are met, thus obtaining the trained image classification model.
7. The endoscopic image enhancement method according to claim 1, characterized in that, Determining the image category corresponding to the original endoscopic image includes: The model information corresponding to the endoscope is determined, and the image category corresponding to the original endoscope image is determined based on the model information.
8. An endoscopic image enhancement device, characterized in that, The endoscopic image enhancement device includes: The first enhancement module is used to acquire the original endoscopic image acquired by the image acquisition element in the endoscope, and to perform staining enhancement on the original endoscopic image to obtain the first enhanced image; The second enhancement module is used to determine the image category corresponding to the original endoscopic image, and to perform construction enhancement on the original endoscopic image based on the construction enhancement algorithm corresponding to the image category to obtain the second enhanced image; The image fusion module is used to fuse the first enhanced image and the second enhanced image to obtain an enhanced target endoscope image.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the endoscopic image enhancement method as described in any one of claims 1 to 7.
10. 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 7.