Endoscope image enhancement method, apparatus, device, and medium
By performing guided filtering, nonlocal mean filtering, and image fusion on endoscopic images, the problems of insufficient contrast and detail in medical electronic endoscope images are solved, image quality is improved, and accurate diagnosis of early lesions is supported.
Patent Information
- Application Number
- CN202211530793.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-12-01
AI Technical Summary
Existing medical electronic endoscope images lack sufficient contrast and detail in the early diagnosis of lesions, making it difficult to meet the diagnostic needs of doctors.
Guided filtering, nonlocal mean filtering, contrast-limited adaptive histogram equalization algorithm, illumination non-uniformity correction algorithm and linear weighted fusion algorithm are used to process endoscopic images, separate and enhance the base layer and detail layer of the image, and perform image fusion.
It improves the dynamic range and spatial contrast of images, enhances detail display, improves image quality and signal-to-noise ratio, and helps doctors better diagnose early lesions.
Smart Images

Figure CN116109533B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of endoscopy technology, and particularly to endoscopic image enhancement methods, apparatus, devices, and media. Background Technology
[0002] With the development of society and economy and the advancement of medical technology, minimally invasive and non-invasive diagnostic and treatment instruments are playing an increasingly significant role in clinical medicine. Medical electronic endoscope systems integrate advanced technologies such as optics and computers, allowing doctors to directly observe internal tissues and organs, facilitating the diagnostic process and improving diagnostic accuracy, thus gaining widespread application. Simultaneously, medical electronic endoscopes are also widely used in minimally invasive surgery; using electronic endoscopes during surgery reduces the risk of infection, postoperative pain, and physical and psychological harm to patients.
[0003] Currently, the primary diagnostic method using electronic endoscopy is through direct visual assessment by the operating physician. For early lesions and early recurrence of surgically created lesions, physicians demand higher contrast and greater detail in structural and edge details from electronic endoscopes. However, limitations imposed by the sensitivity and dynamic range of imaging sensors and the maximum luminous flux of the light source mean that the physical contrast, detail, and structural representation of medical electronic endoscopic images cannot meet the physician's requirements for diagnosing early lesions. Therefore, it is necessary to perform advanced image processing on medical electronic endoscopic images to improve diagnostic accuracy.
[0004] In summary, how to perform reasonable image enhancement processing on endoscopic images to improve image quality is a problem that needs to be solved in this field. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide an endoscopic image enhancement method, apparatus, device, and medium capable of performing reasonable image enhancement processing on endoscopic images to improve image quality. The specific solution is as follows:
[0006] In a first aspect, this application discloses an endoscopic image enhancement method, comprising:
[0007] Guided filtering is applied to the original image returned by the endoscope to obtain the original base layer image of the original image, and image subtraction is performed on the original image and the original base layer image to obtain the original detail layer image of the original image.
[0008] The original detail layer image is subjected to nonlocal mean filtering to obtain a filtered detail layer image, and the gain of the filtered detail layer image is controlled to obtain the target detail layer image.
[0009] The original base layer image is processed using a contrast-limited adaptive histogram equalization algorithm, an illumination non-uniformity correction algorithm, and a linear weighted fusion algorithm to obtain the target base layer image.
[0010] The target detail layer image and the target base layer image are fused to obtain the enhanced target image of the original image.
[0011] Optionally, the step of performing image subtraction on the original image and the original base layer image to obtain the original detail layer image of the original image includes:
[0012] The RGB channels of the original image and the RGB channels of the original base layer image are subjected to corresponding image subtraction processing to obtain the original detail layer image of the original image;
[0013] Accordingly, the step of performing nonlocal mean filtering on the original detail layer image to obtain a filtered detail layer image, and then performing gain control on the filtered detail layer image to obtain the target detail layer image, includes:
[0014] Non-local mean filtering is applied to the RGB channels of the original detail layer image to obtain the filtered detail layer image. Gain control is then applied to the RGB channels of the filtered detail layer image to obtain the target detail layer image.
[0015] Optionally, the step of processing the original base layer image using a contrast-limited adaptive histogram equalization algorithm, an illumination non-uniformity correction algorithm, and a linear weighted fusion algorithm to obtain the target base layer image includes:
[0016] The original base layer image is processed using a contrast-limited adaptive histogram equalization algorithm to obtain the first base layer image;
[0017] The original base layer image is subjected to illumination non-uniformity correction to obtain the second base layer image;
[0018] The first base layer image and the second base layer image are linearly weighted and fused to obtain the target base layer image.
[0019] Optionally, the step of processing the original base layer image using a contrast-limited adaptive histogram equalization algorithm to obtain the first base layer image includes:
[0020] The original base layer image is converted to a YUV format image, and the converted base layer image is then processed using a contrast-limited adaptive histogram equalization algorithm to obtain a processed base layer image.
[0021] The processed base layer image is then converted again to obtain the first base layer image in RGB format.
[0022] Optionally, the step of processing the transformed base layer image using a contrast-limited adaptive histogram equalization algorithm to obtain a processed base layer image includes:
[0023] The Y component of the transformed base layer image is processed using a contrast-limited adaptive histogram equalization algorithm to obtain the processed base layer image.
[0024] Optionally, the step of performing illumination non-uniformity correction on the original base layer image to obtain the second base layer image includes:
[0025] The grayscale value of the RGB channel of each pixel in the original base layer image is determined in order to determine the maximum grayscale value of each pixel;
[0026] The maximum gray value of the original base layer image is determined based on the maximum gray value of each pixel, so as to obtain the brightness correction image of the original base layer image using the maximum gray value of each pixel and the maximum gray value of the original base layer image;
[0027] The second base layer image is obtained using the brightness-corrected image, the maximum grayscale value of each pixel, and the grayscale value of the RGB channel of each pixel.
[0028] Optionally, the step of linearly weighting and fusing the first base layer image and the second base layer image to obtain the target base layer image includes:
[0029] Determine the first weighting coefficient and the second weighting coefficient;
[0030] Obtain the first product of the first weighting coefficient and the first base layer image, and obtain the second product of the second weighting coefficient and the second base layer image;
[0031] The sum of the first product and the second product is determined to obtain the target base layer image.
[0032] Secondly, this application discloses an endoscopic image enhancement device, comprising:
[0033] The image layering module is used to perform guided filtering on the original image returned by the endoscope to obtain the original base layer image of the original image, and to perform image subtraction on the original image and the original base layer image to obtain the original detail layer image of the original image.
[0034] The target detail layer image acquisition module is used to perform non-local mean filtering on the original detail layer image to obtain a filtered detail layer image, and to perform gain control on the filtered detail layer image to obtain the target detail layer image.
[0035] The target base layer image acquisition module is used to process the original base layer image using a contrast-limited adaptive histogram equalization algorithm, an illumination non-uniformity correction algorithm, and a linear weighted fusion algorithm to obtain the target base layer image.
[0036] The enhanced target image acquisition module is used to perform image fusion between the target detail layer image and the target base layer image to obtain the enhanced target image of the original image.
[0037] Thirdly, this application discloses an electronic device, including:
[0038] Memory, used to store computer programs;
[0039] A processor is configured to execute the computer program to implement the steps of the aforementioned disclosed endoscopic image enhancement method.
[0040] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed endoscopic image enhancement method.
[0041] As can be seen, this application performs guided filtering on the original image returned by the endoscope to obtain the original base layer image of the original image, and performs image subtraction processing on the original image and the original base layer image to obtain the original detail layer image of the original image; performs non-local mean filtering on the original detail layer image to obtain the filtered detail layer image, and performs gain control on the filtered detail layer image to obtain the target detail layer image; processes the original base layer image using a contrast-limited adaptive histogram equalization algorithm, an illumination non-uniformity correction algorithm, and a linear weighted fusion algorithm to obtain the target base layer image; and performs image fusion on the target detail layer image and the target base layer image to obtain the enhanced target image of the original image. Therefore, this application performs guided filtering on the original image returned by the endoscope, which can filter out random noise in the original image while preserving details; after applying non-local mean filtering to the original detail layer image and then performing gain control, it can both amplify the image detail information and filter out high-frequency noise in the detail layer; after processing the original base layer image using the contrast-limited adaptive histogram equalization algorithm, the illumination non-uniformity correction algorithm, and the linear weighted fusion algorithm, the resulting target base layer image has improved dynamic range and dark area brightness compared to the original base layer image, thereby achieving the purpose of improving display dynamic range and spatial contrast; therefore, after fusing the target base layer image and the target detail layer image, it can effectively improve the display dynamic range and spatial contrast of the original image, and also improve the signal-to-noise ratio of the enhanced target image to a certain extent, thereby achieving the purpose of improving image quality. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0043] Figure 1 This is a flowchart of an endoscopic image enhancement method disclosed in this application;
[0044] Figure 2 This application discloses a specific original image of the underside of the tongue;
[0045] Figure 3 This application discloses a specific target image after enhancement of the tongue floor;
[0046] Figure 4 This is a flowchart of a specific endoscopic image enhancement method disclosed in this application;
[0047] Figure 5This application discloses a specific original image of the esophagus;
[0048] Figure 6 This application discloses a specific enhanced target image of the esophagus;
[0049] Figure 7 This is a schematic diagram of the structure of an endoscopic image enhancement device disclosed in this application;
[0050] Figure 8 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0051] 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 the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0052] With the development of society and economy and the advancement of medical technology, minimally invasive and non-invasive diagnostic and treatment instruments are playing an increasingly significant role in clinical medicine. Medical electronic endoscope systems integrate advanced technologies such as optics and computers, allowing doctors to directly observe internal tissues and organs, facilitating the diagnostic process and improving diagnostic accuracy, thus gaining widespread application. Simultaneously, medical electronic endoscopes are also widely used in minimally invasive surgery; using electronic endoscopes during surgery reduces the risk of infection, postoperative pain, and physical and psychological harm to patients.
[0053] Currently, the primary diagnostic method using electronic endoscopy is through direct visual assessment by the operating physician. For early lesions and early recurrence of surgically created lesions, physicians demand higher contrast and greater detail in structural and edge details from electronic endoscopes. However, limitations imposed by the sensitivity and dynamic range of imaging sensors and the maximum luminous flux of the light source mean that the physical contrast, detail, and structural representation of medical electronic endoscopic images cannot meet the physician's requirements for diagnosing early lesions. Therefore, it is necessary to perform advanced image processing on medical electronic endoscopic images to improve diagnostic accuracy.
[0054] Therefore, this application provides an endoscopic image enhancement scheme to perform reasonable image enhancement processing on endoscopic images in order to improve image quality.
[0055] See Figure 1 As shown in the figure, this application discloses an endoscopic image enhancement method, including:
[0056] Step S11: Perform guided filtering on the original image returned by the endoscope to obtain the original base layer image of the original image, and perform image subtraction on the original image and the original base layer image to obtain the original detail layer image of the original image.
[0057] The Unsharpening Mask (USM) framework is employed, using guided filtering to divide the image into a base layer and a detail layer. The input is a standard RGB (Red, Green, Blue) image, i.e., the original sRGB image. Before inputting the original image, the raw data undergoes ISP (Image Signal Processing) processing, including de-mosaicing, white balance correction, and color correction, to obtain the original image. The image obtained after guided filtering of the original sRGB image is the original base layer image I. base Guided filtering is performed on the RGB channels of the original image to obtain the original base layer image I. base .
[0058] In this embodiment, it can be understood that the image subtraction process between the original image and the original base layer image to obtain the original detail layer image of the original image includes: performing corresponding image subtraction processes on the RGB channels of the original image and the RGB channels of the original base layer image to obtain the original detail layer image of the original image.
[0059] Step S12: Perform nonlocal mean filtering on the original detail layer image to obtain a filtered detail layer image, and perform gain control on the filtered detail layer image to obtain the target detail layer image.
[0060] In this embodiment, the step of performing nonlocal mean filtering on the original detail layer image to obtain a filtered detail layer image, and then performing gain control on the filtered detail layer image to obtain a target detail layer image, includes: performing nonlocal mean filtering on each of the RGB channels of the original detail layer image to obtain a filtered detail layer image, and then performing gain control on each of the RGB channels of the filtered detail layer image to obtain the target detail layer image. Performing nonlocal mean filtering on each of the RGB channels of the original detail layer image to obtain the filtered detail layer image D filter The gain of the RGB channels of the filtered detail layer image is then controlled to obtain the target detail layer image D. final .
[0061] In this embodiment, the filtered detail layer image D filter Gain control is performed, specifically by setting a coefficient k, and the target detail layer image D... final The maximum value Dmax and minimum value D min For example, if the coefficient k is 2, the maximum value D max The value is 511, and the minimum value is D. min The value is -512, where the target detail layer image D final The calculation formula is as follows:
[0062]
[0063] Step S13: Process the original base layer image using the limited contrast adaptive histogram equalization algorithm, the illumination non-uniformity correction algorithm, and the linear weighted fusion algorithm to obtain the target base layer image.
[0064] In this embodiment, the original base layer image is processed using the Limiting Contrast Adaptive Histogram Equalization (CLAHE) algorithm to obtain the first base layer image; the original base layer image is then subjected to illumination non-uniformity correction to obtain the second base layer image; and the first and second base layer images are then linearly weighted and fused to obtain the target base layer image I. enhance Before processing the original base layer image using the contrast-limited adaptive histogram equalization algorithm, the image format of the original base layer image needs to be converted from RGB to YUV so that the Y component can be processed using the contrast-limited adaptive histogram equalization algorithm. Then, it is converted from YUV to RGB to obtain the first base layer image.
[0065] Step S14: Perform image fusion on the target detail layer image and the target base layer image to obtain the enhanced target image of the original image.
[0066] In this embodiment, the target detail layer image D final and target base layer image I enhance Image fusion is performed to obtain the enhanced target image I from the original image. out The image fusion formula is shown below:
[0067] I out =D final +I enhance .
[0068] For example Figure 2 The original image of the tongue shown is processed through the above steps to obtain... Figure 3 The image shown is a specific target image after tongue enhancement. It can be seen that details such as capillaries at the base of the tongue are enhanced, and there is no significant increase in noise in the enhanced target image.
[0069] As can be seen, this application performs guided filtering on the original image returned by the endoscope to obtain the original base layer image of the original image, and performs image subtraction processing on the original image and the original base layer image to obtain the original detail layer image of the original image; performs non-local mean filtering on the original detail layer image to obtain the filtered detail layer image, and performs gain control on the filtered detail layer image to obtain the target detail layer image; processes the original base layer image using a contrast-limited adaptive histogram equalization algorithm, an illumination non-uniformity correction algorithm, and a linear weighted fusion algorithm to obtain the target base layer image; and performs image fusion on the target detail layer image and the target base layer image to obtain the enhanced target image of the original image. Therefore, this application performs guided filtering on the original image returned by the endoscope, which can filter out random noise in the original image while preserving details; after applying non-local mean filtering to the original detail layer image and then performing gain control, it can both amplify the image detail information and filter out high-frequency noise in the detail layer; after processing the original base layer image using the contrast-limited adaptive histogram equalization algorithm, the illumination non-uniformity correction algorithm, and the linear weighted fusion algorithm, the resulting target base layer image has improved dynamic range and dark area brightness compared to the original base layer image, thereby achieving the purpose of improving display dynamic range and spatial contrast; therefore, after fusing the target base layer image and the target detail layer image, it can effectively improve the display dynamic range and spatial contrast of the original image, and also improve the signal-to-noise ratio of the enhanced target image to a certain extent, thereby achieving the purpose of improving image quality.
[0070] See Figure 4 As shown in the figure, this application discloses a specific method for enhancing endoscopic images, including:
[0071] Step S21: Perform guided filtering on the original image returned by the endoscope to obtain the original base layer image of the original image, and perform image subtraction on the original image and the original base layer image to obtain the original detail layer image of the original image.
[0072] Step S22: Perform nonlocal mean filtering on the original detail layer image to obtain a filtered detail layer image, and perform gain control on the filtered detail layer image to obtain the target detail layer image.
[0073] Step S23: Process the original base layer image using the limited contrast adaptive histogram equalization algorithm to obtain the first base layer image; perform illumination non-uniformity correction on the original base layer image to obtain the second base layer image; perform linear weighted fusion on the first base layer image and the second base layer image to obtain the target base layer image.
[0074] In this embodiment, processing the original base layer image using a contrast-limited adaptive histogram equalization algorithm to obtain a first base layer image includes: converting the original base layer image to a YUV format to obtain a converted base layer image; processing the converted base layer image using the contrast-limited adaptive histogram equalization algorithm to obtain a processed base layer image; and further converting the processed base layer image to obtain a first base layer image in RGB format. The processed base layer image is then further converted to obtain a first base layer image in RGB format, i.e., a first base layer image with enhanced dynamic range (I). dynamic .
[0075] In this embodiment, processing the transformed base layer image using a contrast-limited adaptive histogram equalization algorithm to obtain a processed base layer image includes: processing the Y component of the transformed base layer image using the contrast-limited adaptive histogram equalization algorithm to obtain the processed base layer image. It is understood that when the contrast-limited adaptive histogram equalization algorithm is applied to the Y component, the U and V components remain unchanged.
[0076] In this embodiment, the step of performing illumination non-uniformity correction on the original base layer image to obtain a second base layer image includes: determining the RGB channel grayscale value of each pixel in the original base layer image to determine the maximum grayscale value of each pixel; determining the maximum grayscale value of the original base layer image based on the maximum grayscale value of each pixel, so as to obtain a brightness-corrected image of the original base layer image using the maximum grayscale value of each pixel and the maximum grayscale value of the original base layer image; and obtaining the second base layer image using the brightness-corrected image, the maximum grayscale value of each pixel, and the RGB channel grayscale value of each pixel. Where (x, y) represents pixel coordinates, I baser (x,y), I baseg (x,y), I baseb (x, y) represent the grayscale values of the R, G, and B channels of this pixel, respectively. The maximum grayscale value B for each pixel is determined. max The formula for (x,y) is shown below:
[0077] B max (x,y)=max(I baser (x,y),I baseg (x,y),I baseb (x,y));
[0078] Based on the maximum grayscale value B of each pixel max (x,y) determines the maximum grayscale value G of the original base layer image.max Set a threshold T, where γ represents the correction coefficient, for example... γ = 2.0 to obtain the brightness-corrected image I of the original base layer image. brightness The formula for (x,y) is shown below:
[0079]
[0080] Define the illumination non-uniformity correction matrix M(x,y)=I brightness (x,y) / B max (x,y) is used to obtain the three primary color components of the image after illumination non-uniformity correction, that is, to obtain the R component I of the second base layer image. NUCr , G component I NUCg , B component I NUCb Obtain R component I NUCr , G component I NUCg , B component I NUCb The formula is shown below:
[0081] I NUCr =M*I baser ;
[0082] I NUCg =M*I baseg ;
[0083] I NUCb =M*I baseb ;
[0084] Therefore, the second base layer image I NUC That is, I NUC ={I NUCr ,I NUCg ,I NUCb}
[0085] In this embodiment, the linear weighted fusion of the first base layer image and the second base layer image to obtain the target base layer image includes: determining a first weighting coefficient and a second weighting coefficient; obtaining a first product of the first weighting coefficient and the first base layer image, and obtaining a second product of the second weighting coefficient and the second base layer image; and determining the sum of the first product and the second product to obtain the target base layer image. The first weighting coefficient is determined. The second weighting coefficient is For example, the first weighting coefficient Therefore, the formula for linear weighted fusion is as follows:
[0086]
[0087] Among them, I enhance This represents the target base layer image.
[0088] Step S24: Perform image fusion on the target detail layer image and the target base layer image to obtain the enhanced target image of the original image.
[0089] For example Figure 5 The image shown is a specific original image of the esophagus. After processing through the above steps, the following is obtained: Figure 6 The image shown is a specific enhanced target image of the esophagus. It can be seen that the details and spatial contrast of the capillaries in the esophageal mucosa have been enhanced. At the same time, the dark and unclear images at the bottom of the esophagus caused by uneven lighting and image dynamic limitations have been significantly improved.
[0090] Therefore, the endoscopic image enhancement algorithm of this application improves the illumination non-uniformity of electronic endoscopes, increases image contrast and enhances image details without changing the hardware such as the imaging sensor, providing doctors with more informative images and facilitating the diagnosis of early lesions.
[0091] See Figure 7 As shown in the figure, this application discloses an endoscopic image enhancement device, including:
[0092] The image layering module 11 is used to perform guided filtering on the original image returned by the endoscope to obtain the original base layer image of the original image, and to perform image subtraction processing on the original image and the original base layer image to obtain the original detail layer image of the original image.
[0093] The target detail layer image acquisition module 12 is used to perform non-local mean filtering on the original detail layer image to obtain a filtered detail layer image, and to perform gain control on the filtered detail layer image to obtain the target detail layer image.
[0094] The target base layer image acquisition module 13 is used to process the original base layer image using a contrast-limited adaptive histogram equalization algorithm, an illumination non-uniformity correction algorithm, and a linear weighted fusion algorithm to obtain the target base layer image.
[0095] The enhanced target image acquisition module 14 is used to perform image fusion between the target detail layer image and the target base layer image to obtain the enhanced target image of the original image.
[0096] As can be seen, this application performs guided filtering on the original image returned by the endoscope to obtain the original base layer image of the original image, and performs image subtraction processing on the original image and the original base layer image to obtain the original detail layer image of the original image; performs non-local mean filtering on the original detail layer image to obtain the filtered detail layer image, and performs gain control on the filtered detail layer image to obtain the target detail layer image; processes the original base layer image using a contrast-limited adaptive histogram equalization algorithm, an illumination non-uniformity correction algorithm, and a linear weighted fusion algorithm to obtain the target base layer image; and performs image fusion on the target detail layer image and the target base layer image to obtain the enhanced target image of the original image. Therefore, this application performs guided filtering on the original image returned by the endoscope, which can filter out random noise in the original image while preserving details; after applying non-local mean filtering to the original detail layer image and then performing gain control, it can both amplify the image detail information and filter out high-frequency noise in the detail layer; after processing the original base layer image using the contrast-limited adaptive histogram equalization algorithm, the illumination non-uniformity correction algorithm, and the linear weighted fusion algorithm, the resulting target base layer image has improved dynamic range and dark area brightness compared to the original base layer image, thereby achieving the purpose of improving display dynamic range and spatial contrast; therefore, after fusing the target base layer image and the target detail layer image, it can effectively improve the display dynamic range and spatial contrast of the original image, and also improve the signal-to-noise ratio of the enhanced target image to a certain extent, thereby achieving the purpose of improving image quality.
[0097] Furthermore, embodiments of this application also provide an electronic device. Figure 8 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0098] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the endoscopic image enhancement method performed by the electronic device disclosed in any of the foregoing embodiments.
[0099] In this embodiment, the power supply 23 is used to provide operating voltage for various hardware devices on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0100] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0101] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.
[0102] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the endoscopic image enhancement method executed by the electronic device as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.
[0103] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program, which, when loaded and executed by a processor, implements the method steps performed during the endoscopic image enhancement process disclosed in any of the foregoing embodiments.
[0104] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0105] The above provides a detailed description of an endoscopic image enhancement method, apparatus, device, and medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. An endoscope image enhancement method characterized by, The method comprises the following steps: guiding filtering is performed on an original image returned by an endoscope to obtain an original base layer image of the original image, and image subtraction is performed on the original image and the original base layer image to obtain an original detail layer image of the original image; non-local mean filtering is performed on the original detail layer image to obtain a filtered detail layer image, and gain control is performed on the filtered detail layer image to obtain a target detail layer image; a limited contrast adaptive histogram equalization algorithm is used to process the original base layer image to obtain a first base layer image; illumination non-uniformity correction is performed on the original base layer image to obtain a second base layer image; linear weighted fusion is performed on the first base layer image and the second base layer image to obtain a target base layer image; image fusion is performed on the target detail layer image and the target base layer image to obtain an enhanced target image of the original image; wherein the non-local mean filtering performed on the original detail layer image to obtain a filtered detail layer image, and the gain control performed on the filtered detail layer image to obtain a target detail layer image, comprises: non-local mean filtering is respectively performed on the RGB channels of the original detail layer image to obtain a filtered detail layer image, and gain control is respectively performed on the RGB channels of the filtered detail layer image to obtain a target detail layer image; the calculation formula of the target detail layer image is: ; wherein, is a target detail layer image, is a maximum value of the target detail layer image, is a minimum value of the target detail layer image, is a filtered detail layer image, and k is a set coefficient. the illumination non-uniformity correction performed on the original base layer image to obtain a second base layer image, comprises: the RGB channel gray values of each pixel in the original base layer image are determined respectively to determine the gray maximum value of each pixel; the gray maximum value of the original base layer image is determined based on the gray maximum value of each pixel to obtain a brightness correction image of the original base layer image by using the gray maximum value of each pixel and the gray maximum value of the original base layer image; the ratio of the brightness correction image to the gray maximum value of each pixel is determined as an illumination non-uniformity correction matrix, and the RGB channel gray values of each pixel in the second base layer image are obtained by multiplying the illumination non-uniformity correction matrix with the RGB channel gray values of each pixel respectively.
2. The endoscopic image enhancement method of claim 1, wherein, the image subtraction performed on the original image and the original base layer image to obtain an original detail layer image of the original image, comprises: the RGB channels of the original image and the RGB channels of the original base layer image are subjected to corresponding image subtraction to obtain an original detail layer image of the original image.
3. The endoscopic image enhancement method of claim 1, wherein, the processing of the original base layer image by using the limited contrast adaptive histogram equalization algorithm to obtain a first base layer image, comprises: image format conversion is performed on the original base layer image to obtain a converted base layer image in YUV format, and the limited contrast adaptive histogram equalization algorithm is used to process the converted base layer image to obtain a processed base layer image; Conduct image conversion on the processed base layer image again to obtain a first base layer image in RGB format.
4. The endoscopic image enhancement method of claim 3, wherein, The processing of the converted base layer image by using the limited contrast adaptive histogram equalization algorithm comprises: The Y component of the converted base layer image is processed by using the limited contrast adaptive histogram equalization algorithm to obtain a processed base layer image.
5. The endoscopic image enhancement method of claim 1, wherein, The linearly weighted fusion of the first base layer image and the second base layer image to obtain a target base layer image comprises: determining a first weighting coefficient and a second weighting coefficient; obtaining a first product of the first weighting coefficient and the first base layer image, and a second product of the second weighting coefficient and the second base layer image; determining a sum of the first product and the second product to obtain a target base layer image.
6. An endoscope image enhancement device, characterized by, comprise: The image layering module is configured to conduct guided filtering on an original image returned by an endoscope to obtain an original base layer image of the original image, and conduct image subtraction processing on the original image and the original base layer image to obtain an original detail layer image of the original image. The target detail layer image acquisition module is configured to conduct non-local mean filtering on the original detail layer image to obtain a filtered detail layer image, and conduct gain control on the filtered detail layer image to obtain a target detail layer image. The target base layer image acquisition module is configured to process the original base layer image by using a limited contrast adaptive histogram equalization algorithm to obtain a first base layer image. The original base layer image is subjected to non-uniform illumination correction to obtain a second base layer image. The linearly weighted fusion of the first base layer image and the second base layer image to obtain a target base layer image. The enhanced target image acquisition module is configured to conduct image fusion on the target detail layer image and the target base layer image to obtain an enhanced target image of the original image. The non-local mean filtering on the original detail layer image to obtain a filtered detail layer image, and the gain control on the filtered detail layer image to obtain a target detail layer image, comprise: The RGB channels of the original detail layer image are subjected to non-local mean filtering respectively to obtain a filtered detail layer image, and the RGB channels of the filtered detail layer image are subjected to gain control respectively to obtain a target detail layer image; the calculation formula of the target detail layer image is: ; wherein, is a target detail layer image, is a maximum value of the target detail layer image, is a minimum value of the target detail layer image, is a filtered detail layer image, and k is a set coefficient. The target base layer image acquisition module is specifically configured to: determining the RGB channel gray scale value of each pixel in the original base layer image respectively, so as to determine the gray scale maximum value of each pixel; determining the gray scale maximum value of the original base layer image based on the gray scale maximum value of each pixel, so as to obtain the brightness correction image of the original base layer image by using the gray scale maximum value of each pixel and the gray scale maximum value of the original base layer image; determining the ratio of the brightness correction image and the gray scale maximum value of each pixel as the illumination non-uniformity correction matrix, and multiplying the RGB channel gray scale value of each pixel in the second base layer image by the illumination non-uniformity correction matrix respectively, so as to obtain the RGB channel gray scale value of each pixel in the second base layer image.
7. An electronic device, comprising: comprising: a memory for saving a computer program; a processor for executing the computer program to implement the steps of the endoscope image enhancement method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, a computer program product for storing a computer program; wherein the computer program is executed by a processor to implement the steps of the endoscope image enhancement method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and device for improving display brightness uniformity of OLED (organic light emitting diode)
CN106157889A
Rapid and effective mirror surface highlight image enhancement method and device and storage medium
CN111833271A
Improved MSCNN underwater image defogging method
CN113920018A