CN115063398A - Method and device for processing electronic digestive tract endoscope image and electronic equipment - Google Patents

Method and device for processing electronic digestive tract endoscope image and electronic equipment Download PDF

Info

Publication number
CN115063398A
CN115063398A CN202210836269.8A CN202210836269A CN115063398A CN 115063398 A CN115063398 A CN 115063398A CN 202210836269 A CN202210836269 A CN 202210836269A CN 115063398 A CN115063398 A CN 115063398A
Authority
CN
China
Prior art keywords
image
color channel
histogram
gray
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210836269.8A
Other languages
Chinese (zh)
Inventor
熊乔洲
白晓淞
吴笑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Innermedical Co ltd
Original Assignee
Innermedical Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Innermedical Co ltd filed Critical Innermedical Co ltd
Priority to CN202210836269.8A priority Critical patent/CN115063398A/en
Publication of CN115063398A publication Critical patent/CN115063398A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10068Endoscopic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Radiology & Medical Imaging (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a method and a device for processing an electronic digestive tract endoscope image and electronic equipment, wherein the method comprises the following steps: converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image; splitting the first RGB image to obtain three single-color channel images, wherein the three single-color channel images comprise: an R channel image, a G channel image, and a B channel image; processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images; merging the processed three single-color channel images to obtain a second RGB image; and converting the second RGB image into a second YUV image. The invention has good pertinence to the blood vessel display and meets the use requirement of a user for efficiently identifying the blood vessel according to the endoscope image.

Description

电子消化道内窥镜图像的处理方法、装置及电子设备Electronic digestive tract endoscope image processing method, device and electronic equipment

技术领域technical field

本发明实施例涉及电子消化道内窥镜成像技术领域,尤其涉及一种电子消化道内窥镜图像的处理方法、装置及电子设备。Embodiments of the present invention relate to the technical field of electronic digestive tract endoscope imaging, and in particular, to a method, a device, and an electronic device for processing images of an electronic digestive tract endoscope.

背景技术Background technique

当前,为了提高用户对电子消化道内窥镜图像中各种物体的识别效率,特别是对内窥镜图像中血管的识别效率,往往需要增强电子消化道内窥镜图像的对比度,主要采用的方法有:At present, in order to improve the recognition efficiency of various objects in the electronic digestive tract endoscope image, especially the recognition efficiency of blood vessels in the endoscopic image, it is often necessary to enhance the contrast of the electronic digestive tract endoscope image. The main methods are: :

1)基于直方图均衡的对比度增强方法,将图像的灰度直方图调整为近似均匀分布,增加了像素灰度值差别的动态范围,从而增强血管的对比度;1) The contrast enhancement method based on histogram equalization adjusts the grayscale histogram of the image to an approximately uniform distribution, which increases the dynamic range of pixel grayscale value differences, thereby enhancing the contrast of blood vessels;

2)基于光谱估计的FICE技术(Flexible Spectral Imaging ColourEnhancement,智能色彩增强技术),选择利于观察血管的波长组合增强血管与组织间的对比度;基于边缘检测的方法,利用边缘检测算子区分出血管并加强血管的强度和色调;2) FICE technology (Flexible Spectral Imaging ColourEnhancement, intelligent color enhancement technology) based on spectral estimation, select the wavelength combination that is conducive to the observation of blood vessels to enhance the contrast between blood vessels and tissues; based on the edge detection method, use the edge detection operator to distinguish the blood vessels and Strengthens the strength and tone of blood vessels;

3)基于深度学习的方法,使用大量数据集去学习原始图像与目标图像之间的映射关系,来得到血管增强后的图像。3) Based on the deep learning method, a large number of data sets are used to learn the mapping relationship between the original image and the target image, so as to obtain the image after blood vessel enhancement.

然而,上述方法对于血管成像的针对性差,尤其容易对血管周围组织的过度增强对比度,造成了用户对血管图像的识别困难;并且经上述方法处理后的电子消化道内窥镜图像分辨率低,难以满足用户根据内窥镜图像高效率识别血管的使用需求,特别是对微血管和静脉血管识别。However, the above-mentioned methods have poor pertinence for vascular imaging, and are especially prone to excessively enhancing the contrast of the surrounding tissue, which makes it difficult for users to identify the vascular images; Meet the needs of users to efficiently identify blood vessels based on endoscopic images, especially for microvessels and venous vessels.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种电子消化道内窥镜图像的处理方法、装置及电子设备,以解决现有的电子消化道内窥镜图像的处理方法对于血管显示的针对性差、难以满足用户根据内窥镜图像高效率识别血管的使用需求的问题。Embodiments of the present invention provide an electronic digestive tract endoscope image processing method, device, and electronic equipment, so as to solve the problem that the existing electronic digestive tract endoscope image processing method has poor pertinence for blood vessel display, and is difficult to meet the needs of users according to the endoscope. The problem of using the image to efficiently identify the blood vessel needs.

为了解决上述技术问题,本发明是这样实现的:In order to solve the above-mentioned technical problems, the present invention is achieved in this way:

第一方面,本发明实施例提供了一种电子消化道内窥镜图像的处理方法,包括:In a first aspect, an embodiment of the present invention provides a method for processing an image of an electronic digestive tract endoscope, including:

将电子消化道内窥镜采集到的第一YUV图像转换为第一RGB图像;converting the first YUV image collected by the electronic digestive tract endoscope into a first RGB image;

对所述第一RGB图像进行拆分,得到三个单颜色通道图像,所述三个单颜色通道图像包括:R通道图像、G通道图像和B通道图像;Splitting the first RGB image to obtain three single-color channel images, the three single-color channel images include: an R channel image, a G channel image, and a B channel image;

采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像;Using the histogram equalization algorithm to process the three single-color channel images respectively to obtain three single-color channel images after processing;

合并所述处理后的三个单颜色通道图像,得到第二RGB图像;Merging the processed three single-color channel images to obtain a second RGB image;

将所述第二RGB图像转换为第二YUV图像。Converting the second RGB image to a second YUV image.

可选地,Optionally,

将电子消化道内窥镜采集到的第一YUV图像转换为第一RGB图像,之前包括:Convert the first YUV image collected by the electronic digestive tract endoscope into the first RGB image, which includes:

对所述第一YUV图像进行降噪处理,所述降噪处理用于降低以下至少一种噪声:亮度噪声、色彩噪声。Perform noise reduction processing on the first YUV image, where the noise reduction processing is used to reduce at least one of the following noises: luminance noise and color noise.

可选地,Optionally,

采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像,包括:The three single-color channel images are respectively processed by the histogram equalization algorithm, and three single-color channel images after processing are obtained, including:

根据各个所述单颜色通道图像,计算得到各个所述单颜色通道图像的灰度分布数据,将所述灰度分布数据发送至与用户关联的交互端;According to each of the single-color channel images, calculating the grayscale distribution data of each of the single-color channel images, and sending the grayscale distribution data to the interactive terminal associated with the user;

接收所述交互端发送的灰度直方图限制值,所述限制值与所述单颜色通道图像对应;receiving a grayscale histogram limit value sent by the interactive terminal, where the limit value corresponds to the single-color channel image;

根据所述灰度直方图限制值,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像;According to the limit value of the grayscale histogram, a histogram equalization algorithm is used to process the three single-color channel images respectively to obtain three processed single-color channel images;

或者,or,

采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像,包括:The three single-color channel images are respectively processed by the histogram equalization algorithm, and three single-color channel images after processing are obtained, including:

获取预设的所述灰度直方图限制值;obtaining the preset limit value of the grayscale histogram;

根据所述灰度直方图限制值,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像。According to the limit value of the grayscale histogram, a histogram equalization algorithm is used to process the three single-color channel images respectively to obtain three processed single-color channel images.

可选地,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像,包括:Optionally, use a histogram equalization algorithm to process the three single-color channel images respectively, to obtain three processed single-color channel images, including:

根据预设的切分规则对每个所述单颜色通道图像进行切分,得到与所述单颜色通道图像对应的多个图像分块;Segment each of the single-color channel images according to a preset segmentation rule to obtain a plurality of image segments corresponding to the single-color channel images;

获取与所述单颜色通道图像对应的灰度直方图限制值;obtaining a grayscale histogram limit value corresponding to the single-color channel image;

计算得到所述单颜色通道图像的每个所述图像分块的灰度直方图,根据与所述单颜色通道图像对应的灰度直方图限制值,对所述单颜色通道图像的每个所述图像分块的灰度直方图进行裁切,得到裁切后的每个所述图像分块的灰度直方图;The grayscale histogram of each of the image blocks of the single-color channel image is obtained by calculating, and according to the grayscale histogram limit value corresponding to the single-color channel image, for each of the single-color channel image The grayscale histogram of the image block is cut to obtain the grayscale histogram of each of the image blocks after the cropping;

根据裁切后的每个所述图像分块的灰度直方图,得到每一子图像的灰度映射函数;Obtain the grayscale mapping function of each sub-image according to the grayscale histogram of each of the cut image blocks;

针对每一图像分块,采用插值算法对所述图像分块相邻的图像分块的灰度映射函数进行插值,得到每一图像分块的目标灰度值;For each image block, an interpolation algorithm is used to interpolate the grayscale mapping function of the image blocks adjacent to the image block to obtain the target gray value of each image block;

根据所述目标灰度值增强与所述目标灰度值对应的图像分块的对比度,得到处理后的图像分块;根据所述预设的切分规则合并处理后的图像分块,得到处理后的三个单颜色通道图像。Enhance the contrast of the image blocks corresponding to the target gray value according to the target gray value to obtain the processed image blocks; merge the processed image blocks according to the preset segmentation rule to obtain the processed image blocks Three single-color channel images after.

可选地,Optionally,

根据与所述单颜色通道图像对应的灰度直方图限制值,对所述单颜色通道图像的每个所述图像分块的灰度直方图进行裁切,得到裁切后的每个所述图像分块的灰度直方图,包括:According to the limit value of the grayscale histogram corresponding to the single-color channel image, the grayscale histogram of each of the image blocks of the single-color channel image is trimmed to obtain each trimmed grayscale histogram. Grayscale histogram of image blocks, including:

裁切步骤:检测所述图像分块的灰度直方图中各灰度级,针对检测结果为对应的直方图统计值超出所述灰度直方图限制值的灰度级,对所述灰度级对应的直方图统计值进行裁切,使得裁切后的直方图统计值不超出所述灰度直方图限制值;Cropping step: Detecting each gray level in the grayscale histogram of the image block, and for the grayscale level whose detection result is that the corresponding statistical value of the histogram exceeds the limit value of the grayscale histogram, the grayscale level is determined. The histogram statistic value corresponding to the level is trimmed, so that the histogram statistic value after trimming does not exceed the gray-scale histogram limit value;

将裁切掉的直方图统计值平均分配给检测结果为对应的直方图统计值不超出所述灰度直方图限制值的其他灰度级;执行所述裁切步骤直至所述图像分块的灰度直方图中各灰度级均不超出所述灰度直方图限制值,得到裁切后的所述图像分块的灰度直方图。Allocate the cropped histogram statistical value to other gray levels whose detection result is that the corresponding histogram statistical value does not exceed the grayscale histogram limit value; perform the cropping step until the image block Each gray level in the grayscale histogram does not exceed the limit value of the grayscale histogram, and the grayscale histogram of the cut image block is obtained.

可选地,所述插值算法为双线性差值算法。Optionally, the interpolation algorithm is a bilinear difference algorithm.

第二方面,本发明实施例提供了一种电子消化道内窥镜图像的处理装置,包括:In a second aspect, an embodiment of the present invention provides an apparatus for processing an image of an electronic digestive tract endoscope, including:

转换模块,用于将电子消化道内窥镜采集到的第一YUV图像转换为第一RGB图像;a conversion module for converting the first YUV image collected by the electronic digestive tract endoscope into a first RGB image;

拆分模块,用于对所述第一RGB图像进行拆分,得到三个单颜色通道图像,所述三个单颜色通道图像包括:R通道图像、G通道图像和B通道图像;a splitting module, configured to split the first RGB image to obtain three single-color channel images, where the three single-color channel images include: an R-channel image, a G-channel image, and a B-channel image;

处理模块,用于采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像;a processing module, configured to process the three single-color channel images respectively by using a histogram equalization algorithm to obtain three processed single-color channel images;

合并模块,用于合并所述处理后的三个单颜色通道图像,得到第二RGB图像;a merging module for merging the processed three single-color channel images to obtain a second RGB image;

所述转换模块,还用于将所述第二RGB图像转换为第二YUV图像。The conversion module is further configured to convert the second RGB image into a second YUV image.

可选地,Optionally,

所述处理模块,还用于根据预设的切分规则对每个所述单颜色通道图像进行切分,得到与所述单颜色通道图像对应的多个图像分块;The processing module is further configured to segment each of the single-color channel images according to a preset segmentation rule to obtain a plurality of image segments corresponding to the single-color channel images;

所述处理模块,还用于获取与所述单颜色通道图像对应的灰度直方图限制值;The processing module is further configured to obtain a grayscale histogram limit value corresponding to the single-color channel image;

所述处理模块,还用于计算得到所述单颜色通道图像的每个所述图像分块的灰度直方图,根据与所述单颜色通道图像对应的灰度直方图限制值,对所述单颜色通道图像的每个所述图像分块的灰度直方图进行裁切,得到裁切后的每个所述图像分块的灰度直方图;The processing module is further configured to calculate and obtain a grayscale histogram of each of the image blocks of the single-color channel image, and calculate the grayscale histogram limit value corresponding to the single-color channel image for the single-color channel image. The grayscale histogram of each of the image blocks of the single-color channel image is trimmed, and the grayscale histogram of each of the image blocks after the trimming is obtained;

所述处理模块,还用于根据裁切后的每个所述图像分块的灰度直方图,得到每一子图像的灰度映射函数;The processing module is further configured to obtain a grayscale mapping function of each sub-image according to the cut grayscale histogram of each of the image blocks;

所述处理模块,还用于针对每一图像分块,采用插值算法对所述图像分块相邻的图像分块的灰度映射函数进行插值,得到每一图像分块的目标灰度值;The processing module is further configured to, for each image block, use an interpolation algorithm to interpolate the grayscale mapping function of the image blocks adjacent to the image block to obtain the target gray value of each image block;

所述处理模块,还用于根据所述目标灰度值增强与所述目标灰度值对应的图像分块的对比度,得到处理后的图像分块;根据所述预设的切分规则合并处理后的图像分块,得到处理后的三个单颜色通道图像。The processing module is further configured to enhance the contrast of the image blocks corresponding to the target gray value according to the target gray value to obtain the processed image blocks; merge and process according to the preset segmentation rule After the image is divided into blocks, three single-color channel images are obtained after processing.

第三方面,本发明实施例提供了一种电子设备,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面中任一项所述的电子消化道内窥镜图像的处理方法中的步骤。In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a memory, and a program or instruction stored on the memory and executable on the processor, where the program or instruction is processed by the processor When the device is executed, the steps in the method for processing an image of an electronic digestive tract endoscope according to any one of the first aspects are implemented.

第四方面,本发明实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面中任一项所述的电子消化道内窥镜图像的处理方法中的步骤。In a fourth aspect, an embodiment of the present invention provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the implementation is as described in any one of the first aspect The steps in the processing method of electronic digestive tract endoscopy images.

本发明实施例中,通过将电子消化道内窥镜采集到的第一YUV图像转换为第一RGB图像;对第一RGB图像进行拆分,采用直方图均衡化算法分别对三个单颜色通道图像进行处理,能够避免对其中一颜色通道图像处理时其他颜色通道的存在对处理的干扰,进而避免了对未拆分的内窥镜图像直接处理造成的血管周围组织的过度增强对比度的问题,有利于提高血管成像的针对性;本发明实施例中,得到处理后的三个单颜色通道图像之后,合并处理后的三个单颜色通道图像有利于进一步提高图像处理的效果,使得处理后的内窥镜图像在具备高对比度的同时兼具高清晰度,能够满足用户根据内窥镜图像高效率识别血管的使用需求,特别是对微血管和静脉血管识别。In the embodiment of the present invention, the first YUV image collected by the electronic digestive tract endoscope is converted into the first RGB image; the first RGB image is split, and the histogram equalization algorithm is used to separate the three single-color channel images Processing can avoid the interference of the existence of other color channels when processing one color channel image, thereby avoiding the problem of excessive contrast enhancement of perivascular tissue caused by direct processing of unsplit endoscopic images. It is beneficial to improve the pertinence of vascular imaging; in the embodiment of the present invention, after obtaining the processed three single-color channel images, merging the processed three single-color channel images is conducive to further improving the effect of image processing, so that the processed internal The endoscopic image has high contrast and high definition, which can meet the needs of users to efficiently identify blood vessels according to the endoscopic image, especially the identification of microvessels and venous vessels.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered limiting of the invention. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:

图1为本发明实施例电子消化道内窥镜图像的处理方法的流程示意图之一;FIG. 1 is one of the schematic flowcharts of a method for processing an image of an electronic digestive tract endoscope according to an embodiment of the present invention;

图2为本发明实施例电子消化道内窥镜图像的处理方法的流程示意图之二;2 is a second schematic flowchart of a method for processing an image of an electronic digestive tract endoscope according to an embodiment of the present invention;

图3为本发明实施例电子消化道内窥镜图像的处理方法中双线性插值算法的原理示意图;3 is a schematic diagram of the principle of a bilinear interpolation algorithm in a method for processing an image of an electronic digestive tract endoscope according to an embodiment of the present invention;

图4为本发明实施例电子消化道内窥镜图像的处理方法的流程示意图之三;4 is a third schematic flowchart of a method for processing an image of an electronic digestive tract endoscope according to an embodiment of the present invention;

图5为对单颜色通道图像的每个图像分块的灰度直方图进行裁切的原理示意图;5 is a schematic diagram of the principle of cropping the grayscale histogram of each image block of a single-color channel image;

图6为本发明实施例电子消化道内窥镜图像的处理装置的原理示意图;FIG. 6 is a schematic diagram of the principle of an image processing device of an electronic digestive tract endoscope according to an embodiment of the present invention;

图7为本发明实施例电子设备的原理框图。FIG. 7 is a schematic block diagram of an electronic device according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明实施例提供了一种电子消化道内窥镜图像的处理方法,参见图1所示,图1为本发明实施例电子消化道内窥镜图像的处理方法的流程示意图之一,包括:An embodiment of the present invention provides a method for processing an image of an electronic digestive tract endoscope. Referring to FIG. 1 , FIG. 1 is one of the schematic flowcharts of a method for processing an image of an electronic digestive tract endoscope according to an embodiment of the present invention, including:

步骤11:将电子消化道内窥镜采集到的第一YUV图像转换为第一RGB图像;Step 11: Convert the first YUV image collected by the electronic digestive tract endoscope into a first RGB image;

步骤12:对第一RGB图像进行拆分,得到三个单颜色通道图像,三个单颜色通道图像包括:R通道图像、G通道图像和B通道图像;Step 12: splitting the first RGB image to obtain three single-color channel images, where the three single-color channel images include: an R-channel image, a G-channel image, and a B-channel image;

步骤13:采用直方图均衡化算法分别对三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像;Step 13: using the histogram equalization algorithm to process the three single-color channel images respectively, to obtain three processed single-color channel images;

步骤14:合并处理后的三个单颜色通道图像,得到第二RGB图像;Step 14: combine the processed three single-color channel images to obtain a second RGB image;

步骤15:将第二RGB图像转换为第二YUV图像。Step 15: Convert the second RGB image to a second YUV image.

YUV,是一种颜色编码方法。常使用在各个视频处理组件中。YUV在对照片或视频编码时,考虑到人类的感知能力,允许降低色度的带宽。YUV, is a color coding method. Often used in various video processing components. YUV allows for reduced bandwidth for chroma taking into account human perception when encoding photos or videos.

YUV是编译true-color颜色空间(colorspace)的种类,Y'UV,YUV,YCbCr,YPbPr等专有名词都可以称为YUV,彼此有重叠。“Y”表示明亮度(Luminance或Luma),也就是灰阶值,“U”和“V”表示的则是色度(Chrominance或Chroma),作用是描述影像色彩及饱和度,用于指定像素的颜色。YUV is a type of compiling true-color color space (colorspace). Proper nouns such as Y'UV, YUV, YCbCr, YPbPr can be called YUV, which overlap each other. "Y" represents the brightness (Luminance or Luma), that is, the grayscale value, and "U" and "V" represent the chroma (Chrominance or Chroma), which are used to describe the color and saturation of the image, and are used to specify pixels. s color.

RGB色彩模式是工业界的一种颜色标准,是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色,这个标准几乎包括了人类视力所能感知的所有颜色,是运用最广的颜色系统之一。The RGB color mode is a color standard in the industry. It obtains various colors by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other. Yes, RGB is the color representing the three channels of red, green and blue. This standard includes almost all the colors that human vision can perceive and is one of the most widely used color systems.

本发明的一些实施例中,可选地,步骤11中,将第一YUV图像转换为第一RGB图像的转换公式为:In some embodiments of the present invention, optionally, in step 11, the conversion formula for converting the first YUV image to the first RGB image is:

R=Y+1.403×(V-128);R=Y+1.403×(V-128);

G=Y-0.343×(U-128)-0.714×(V-128);G=Y-0.343×(U-128)-0.714×(V-128);

B=Y+1.77×(U-128)。B=Y+1.77×(U-128).

本发明的一些实施例中,可选地,步骤15中,将第二RGB图像转换为第二YUV图像的转换公式为:In some embodiments of the present invention, optionally, in step 15, the conversion formula for converting the second RGB image to the second YUV image is:

Y=0.299×R+0.587×G+0.114×B;Y=0.299×R+0.587×G+0.114×B;

U=-0.169×R-0.331×G+0.5×B+128;U=-0.169×R-0.331×G+0.5×B+128;

V=0.5×R-0.419×G-0.081×B+128。V=0.5×R−0.419×G−0.081×B+128.

本发明实施例中,通过将电子消化道内窥镜采集到的第一YUV图像转换为第一RGB图像;对第一RGB图像进行拆分,采用直方图均衡化算法分别对三个单颜色通道图像进行处理,能够避免对其中一颜色通道图像处理时其他颜色通道的存在对处理的干扰,进而避免了对未拆分的内窥镜图像直接处理造成的血管周围组织的过度增强对比度的问题,有利于提高血管成像的针对性;本发明实施例中,得到处理后的三个单颜色通道图像之后,合并处理后的三个单颜色通道图像有利于进一步提高图像处理的效果,使得处理后的内窥镜图像在具备高对比度的同时兼具高清晰度,能够满足用户根据内窥镜图像高效率识别血管的使用需求,特别是对微血管和静脉血管识别。In the embodiment of the present invention, the first YUV image collected by the electronic digestive tract endoscope is converted into the first RGB image; the first RGB image is split, and the histogram equalization algorithm is used to separate the three single-color channel images Processing can avoid the interference of the existence of other color channels when processing one color channel image, thereby avoiding the problem of excessive contrast enhancement of perivascular tissue caused by direct processing of unsplit endoscopic images. It is beneficial to improve the pertinence of vascular imaging; in the embodiment of the present invention, after obtaining the processed three single-color channel images, merging the processed three single-color channel images is conducive to further improving the effect of image processing, so that the processed internal The endoscopic image has high contrast and high definition, which can meet the needs of users to efficiently identify blood vessels according to the endoscopic image, especially the identification of microvessels and venous vessels.

本发明的一些实施例中,可选地,将电子消化道内窥镜采集到的第一YUV图像转换为第一RGB图像,之前包括:In some embodiments of the present invention, optionally, converting the first YUV image collected by the electronic digestive tract endoscope into a first RGB image includes:

对所述第一YUV图像进行降噪处理,所述降噪处理用于降低以下至少一种噪声:亮度噪声、色彩噪声。Perform noise reduction processing on the first YUV image, where the noise reduction processing is used to reduce at least one of the following noises: luminance noise and color noise.

图像传感器由于自身性质(例如:cmos感光元件具有噪声大的特点)、传感器制造工艺、以及进光条件等一系列原因可能造成存在亮度噪声和/或色彩噪声的问题。在本发明实施例中,在将第一YUV图像转换为第一RGB图像之前,对第一YUV图像进行降噪处理,有利于提高格式转换后第一RGB图像的图像素质,并有利于在后续的采用直方图均衡化算法分别对三个单颜色通道图像进行处理的过程中提高处理效率以及处理效果。Image sensors may have problems with luminance noise and/or color noise due to a series of reasons such as their own properties (for example, cmos photosensitive elements are noisy), sensor manufacturing processes, and light entry conditions. In the embodiment of the present invention, before the first YUV image is converted into the first RGB image, noise reduction processing is performed on the first YUV image, which is beneficial to improve the image quality of the first RGB image after format conversion, and is beneficial to the subsequent The histogram equalization algorithm is used to improve the processing efficiency and processing effect in the process of processing three single-color channel images respectively.

针对于亮度噪声和/或色彩噪声的降噪处理方法多种多样,无法穷举;并且具体的降噪处理方法并不是本发明的保护要点,故此处不再赘述。可以理解的,只要能够得到降低亮度噪声和/或色彩噪声的第一YUV图像,都应当被认为包含在本发明实施例的保护范围之内。The noise reduction processing methods for luminance noise and/or color noise are various and cannot be exhaustive; and the specific noise reduction processing method is not the protection point of the present invention, so it will not be repeated here. It can be understood that as long as the first YUV image with reduced luminance noise and/or color noise can be obtained, it should be considered to be included within the protection scope of the embodiments of the present invention.

本发明的一些实施例中,可选地,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像,包括:In some embodiments of the present invention, optionally, a histogram equalization algorithm is used to process the three single-color channel images respectively to obtain three processed single-color channel images, including:

根据各个所述单颜色通道图像,计算得到各个所述单颜色通道图像的灰度分布数据,将所述灰度分布数据发送至与用户关联的交互端;According to each of the single-color channel images, calculating the grayscale distribution data of each of the single-color channel images, and sending the grayscale distribution data to the interactive terminal associated with the user;

接收所述交互端发送的灰度直方图限制值,所述限制值与所述单颜色通道图像对应;receiving a grayscale histogram limit value sent by the interactive terminal, where the limit value corresponds to the single-color channel image;

根据所述灰度直方图限制值,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像;According to the limit value of the grayscale histogram, a histogram equalization algorithm is used to process the three single-color channel images respectively to obtain three processed single-color channel images;

或者,or,

采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像,包括:The three single-color channel images are respectively processed by the histogram equalization algorithm, and three single-color channel images after processing are obtained, including:

获取预设的所述灰度直方图限制值;obtaining the preset limit value of the grayscale histogram;

根据所述灰度直方图限制值,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像。According to the limit value of the grayscale histogram, a histogram equalization algorithm is used to process the three single-color channel images respectively to obtain three processed single-color channel images.

本发明实施例中,将所述灰度分布数据发送至与用户关联的交互端,使得用户能够参考灰度分布数据设置灰度直方图限制值,用户再将设置好的灰度直方图限制值通过交互端发送给本发明实施例的执行主体。本发明实施例的执行主体接收所述交互端发送的灰度直方图限制值,根据所述灰度直方图限制值,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像。In the embodiment of the present invention, the grayscale distribution data is sent to the interactive terminal associated with the user, so that the user can set the grayscale histogram limit value with reference to the grayscale distribution data, and the user then sets the set grayscale histogram limit value It is sent to the execution body of the embodiment of the present invention through the interactive end. The execution body of the embodiment of the present invention receives the grayscale histogram limit value sent by the interactive terminal, and according to the grayscale histogram limit value, uses a histogram equalization algorithm to process the three single-color channel images respectively, Three single-color channel images are obtained after processing.

本发明实施例中,灰度直方图限制值为预设的值,在采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理时,获取预设的灰度直方图限制值,根据所述灰度直方图限制值,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像。In the embodiment of the present invention, the grayscale histogram limit value is a preset value, and when the three single-color channel images are processed by the histogram equalization algorithm, the preset grayscale histogram limit value is obtained, According to the limit value of the grayscale histogram, a histogram equalization algorithm is used to process the three single-color channel images respectively to obtain three processed single-color channel images.

本发明的一些实施例中,可选地,参见图2所示,图2为本发明实施例电子消化道内窥镜图像的处理方法的流程示意图之二,采用直方图均衡化算法分别对三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像,包括:In some embodiments of the present invention, optionally, referring to FIG. 2 , FIG. 2 is the second schematic flowchart of a method for processing an electronic digestive tract endoscope image according to an embodiment of the present invention. The single-color channel image is processed to obtain three single-color channel images after processing, including:

步骤21:根据预设的切分规则对每个单颜色通道图像进行切分,得到与单颜色通道图像对应的多个图像分块;Step 21: segment each single-color channel image according to a preset segmentation rule to obtain a plurality of image segments corresponding to the single-color channel image;

步骤22:获取与单颜色通道图像对应的灰度直方图限制值;Step 22: Obtain the limit value of the grayscale histogram corresponding to the single-color channel image;

步骤23:计算得到单颜色通道图像的每个图像分块的灰度直方图,根据与单颜色通道图像对应的灰度直方图限制值,对单颜色通道图像的每个图像分块的灰度直方图进行裁切,得到裁切后的每个图像分块的灰度直方图;Step 23: Calculate the grayscale histogram of each image block of the single-color channel image, and calculate the grayscale of each image block of the single-color channel image according to the grayscale histogram limit value corresponding to the single-color channel image. The histogram is cropped to obtain the grayscale histogram of each image block after cropping;

步骤24:根据裁切后的每个图像分块的灰度直方图,得到每一子图像的灰度映射函数;Step 24: Obtain the grayscale mapping function of each sub-image according to the grayscale histogram of each image block after the cropping;

步骤25:针对每一图像分块,采用插值算法对图像分块相邻的图像分块的灰度映射函数进行插值,得到每一图像分块的目标灰度值;Step 25: for each image block, use an interpolation algorithm to interpolate the grayscale mapping function of the image block adjacent to the image block to obtain the target gray value of each image block;

步骤26:根据目标灰度值增强与目标灰度值对应的图像分块的对比度,得到处理后的图像分块;根据预设的切分规则合并处理后的图像分块,得到处理后的三个单颜色通道图像。Step 26: Enhance the contrast of the image blocks corresponding to the target gray value according to the target gray value to obtain the processed image blocks; merge the processed image blocks according to the preset segmentation rules to obtain the processed three image blocks. a single color channel image.

示例性的,每一单颜色通道图像均进行网格切分(为8×8网格密度,每一小格均为一图像分块);此外,三个单通道图像均根据同一预设的切分规则进行切分,使得三个单通道图像中的图像分块的数量与位置一一对应。Exemplarily, each single-channel image is divided into grids (8×8 grid density, and each small grid is an image block); in addition, the three single-channel images are based on the same preset The segmentation rule is used for segmentation, so that the number of image blocks in the three single-channel images corresponds to their positions one-to-one.

在本发明的一些实施例中,可选地,三个单通道图像可以根据同一预设的切分规则进行切分,三个单通道图像也可以不根据同一预设的切分规则进行切分。In some embodiments of the present invention, optionally, the three single-channel images may be segmented according to the same preset segmentation rule, or the three single-channel images may not be segmented according to the same preset segmentation rule .

在本发明的一些实施例中,可选地,根据具体的预设的切分规则,图像分块可以是正方形、矩形、圆形以及其他几何图形。In some embodiments of the present invention, optionally, according to a specific preset segmentation rule, the image segments may be squares, rectangles, circles, and other geometric shapes.

在本发明的一些实施例中,可选地,根据具体的预设的切分规则,同一单通道图像中的图像分块可以规则有序排列、也可以无序排列;各图像分块也可以具备相同的面积,也可以不具备相同的面积。In some embodiments of the present invention, optionally, according to a specific preset segmentation rule, the image blocks in the same single-channel image can be arranged in a regular and orderly manner, or they can be arranged in random order; each image block can also be It may or may not have the same area.

本发明实施例中,灰度映射函数的公式为:In the embodiment of the present invention, the formula of the grayscale mapping function is:

Figure BDA0003748437760000091
Figure BDA0003748437760000091

其中:r为灰度等级(0-255),H(r)为当前灰度等级r的直方图,N为小块内的总像素数量。Among them: r is the gray level (0-255), H(r) is the histogram of the current gray level r, and N is the total number of pixels in the small block.

本发明的一些实施例中,可选地,步骤25中所采用插值算法可以为双线性插值算法,即:针对每一图像分块,采用双线性插值算法对图像分块相邻的图像分块的灰度映射函数进行插值,得到每一图像分块的目标灰度值。In some embodiments of the present invention, optionally, the interpolation algorithm used in step 25 may be a bilinear interpolation algorithm, that is, for each image block, the bilinear interpolation algorithm is used to analyze the adjacent images of the image blocks. The grayscale mapping function of the block is interpolated to obtain the target gray value of each image block.

双线性插值,又称为双线性内插。在数学上,双线性插值是有两个变量的插值函数的线性插值扩展,其核心思想是在两个方向分别进行一次线性插值。双线性插值作为数值分析中的一种插值算法,广泛应用在信号处理,数字图像和视频处理等方面。Bilinear interpolation, also known as bilinear interpolation. Mathematically, bilinear interpolation is a linear interpolation extension of an interpolation function with two variables. The core idea is to perform a linear interpolation in two directions respectively. As an interpolation algorithm in numerical analysis, bilinear interpolation is widely used in signal processing, digital image and video processing and so on.

参见图3所示,图3为本发明实施例电子消化道内窥镜图像的处理方法中双线性插值算法的原理示意图,对应的双线性插值算法的公式为:Referring to FIG. 3, FIG. 3 is a schematic diagram of the principle of the bilinear interpolation algorithm in the processing method of the electronic digestive tract endoscope image according to the embodiment of the present invention, and the corresponding formula of the bilinear interpolation algorithm is:

Figure BDA0003748437760000101
Figure BDA0003748437760000101

其中,UL、UR、BL、BR为该像素点周边四个小块的灰度映射函数,且定义各小块的灰度映射函数处于其中心位置。d1、d2、d3、d4为该像素点距离各灰度映射函数的距离。i为该像素点原灰度值,I为该像素点的新灰度值。对原R、G、B按照上式遍历所有像素点得到对比度增强的R、G、B三通道图像。Among them, UL, UR, BL, and BR are the grayscale mapping functions of four small blocks around the pixel point, and the grayscale mapping functions of each small block are defined at its center position. d1, d2, d3, and d4 are the distances between the pixel and each grayscale mapping function. i is the original gray value of the pixel, and I is the new gray value of the pixel. For the original R, G, B, traverse all the pixels according to the above formula to obtain the R, G, B three-channel image with enhanced contrast.

在本发明的一些实施例中,可选地,参见图4所示,图4为本发明实施例电子消化道内窥镜图像的处理方法的流程示意图之三,根据与单颜色通道图像对应的灰度直方图限制值,对单颜色通道图像的每个图像分块的灰度直方图进行裁切,得到裁切后的每个图像分块的灰度直方图,包括:In some embodiments of the present invention, optionally, referring to FIG. 4 , FIG. 4 is a third schematic flowchart of a method for processing an electronic digestive tract endoscope image according to an embodiment of the present invention. The grayscale histogram of each image block of the single-color channel image is cropped, and the grayscale histogram of each image block after cropping is obtained, including:

步骤31:裁切步骤:检测图像分块的灰度直方图中各灰度级,针对检测结果为对应的直方图统计值超出灰度直方图限制值的灰度级,对灰度级对应的直方图统计值进行裁切,使得裁切后的直方图统计值不超出灰度直方图限制值;Step 31: Cropping step: Detecting each gray level in the grayscale histogram of the image block, for the gray level whose statistical value of the corresponding histogram exceeds the limit value of the grayscale histogram as the detection result, the corresponding gray level The statistical value of the histogram is cropped, so that the statistical value of the histogram after cropping does not exceed the limit value of the grayscale histogram;

步骤32:将裁切掉的直方图统计值平均分配给检测结果为对应的直方图统计值不超出灰度直方图限制值的其他灰度级;执行裁切步骤直至图像分块的灰度直方图中各灰度级均不超出灰度直方图限制值,得到裁切后的图像分块的灰度直方图。Step 32: Evenly distribute the cropped histogram statistics to other gray levels whose detection result is that the corresponding histogram statistics value does not exceed the gray level histogram limit value; perform the cropping step until the gray level histogram of the image block. Each gray level in the figure does not exceed the limit value of the gray histogram, and the gray histogram of the cut image block is obtained.

示例性的,参见图5所示,图5为对单颜色通道图像的每个图像分块的灰度直方图进行裁切的原理示意图。对R、G、B图像分别设置灰度直方图限制值:Climit_R、Climit_G及Climit_B(三者值可以根据图像进行选优)。R、G、B图像中各64个小块直方图分别以对应的限制值Climit_R、Climit_G、Climit_B作为其直方图的裁剪量。小块直方图中若某个灰度级超过限制值Climit则对该灰度级进行直方图裁剪,并统计小块中所有灰度级总共裁剪掉的像素点总量。将裁剪得到的总量均分到小块直方图其它未被裁剪的灰度级,得到每个小块的新灰度直方图。对得到的每个小块新直方图重复上述裁剪步骤,直到每个小块的新直方图均未超过对应限制值Climit,各小块得到最终的新直方图(相对于本发明实施例中裁切后的图像分块的灰度直方图)。Exemplarily, as shown in FIG. 5 , FIG. 5 is a schematic diagram of the principle of cropping the grayscale histogram of each image block of a single-color channel image. Set gray histogram limit values for R, G, and B images respectively: Climit_R, Climit_G, and Climit_B (the three values can be optimized according to the image). Each of the 64 small-block histograms in the R, G, and B images takes the corresponding limit values Climit_R, Climit_G, and Climit_B as the cropping amounts of their histograms. If a certain gray level in the small block histogram exceeds the limit value Climit, the histogram is cropped for the gray level, and the total number of cropped pixels for all gray levels in the small block is counted. The total amount obtained by clipping is equally divided into other uncropped gray levels of the histogram of the small block, and a new gray histogram of each small block is obtained. Repeat the above-mentioned cropping steps for each obtained new histogram of small blocks, until the new histogram of each small block does not exceed the corresponding limit value Climit, and each small block obtains the final new histogram (relative to the cutting in the embodiment of the present invention). grayscale histogram of the sliced image).

在本发明的一些实施例中,可选地,所述直方图均衡化算法为限制对比度自适应直方图均衡化CLAHE算法。In some embodiments of the present invention, optionally, the histogram equalization algorithm is a contrast-limited adaptive histogram equalization CLAHE algorithm.

普通的自适应直方图均衡AHE往往会放大图像近恒定区域中的对比度,因为此类区域中的直方图高度集中。结果,AHE可能导致噪声在近恒定区域中被放大。对比度受限AHE(CLAHE)是自适应直方图均衡的一种变体,其中对比度放大受到限制,从而减少了这种噪声放大问题。Ordinary adaptive histogram equalization AHE tends to amplify the contrast in near-constant regions of the image because the histograms in such regions are highly concentrated. As a result, AHE may cause noise to be amplified in a near-constant region. Contrast-limited AHE (CLAHE) is a variant of adaptive histogram equalization in which contrast amplification is limited, reducing this noise amplification problem.

在CLAHE中,给定像素值附近的对比度放大由变换函数的斜率给出。这与邻域累积分布函数(CDF)的斜率成比例,因此与该像素值处的直方图的值成比例。CLAHE通过在计算CDF之前将直方图裁剪为预定值来限制放大。这限制了CDF的斜率,从而限制了转换函数的斜率。直方图被裁剪的值,即所谓的裁剪极限,取决于直方图的规格化,并因此取决于邻域的大小。公用值将结果放大率限制在3到4之间。有利的是,不丢弃直方图超出裁剪限制的部分,而是在所有直方图块中平均分配它。In CLAHE, the contrast magnification around a given pixel value is given by the slope of the transform function. This is proportional to the slope of the neighborhood cumulative distribution function (CDF) and therefore to the value of the histogram at that pixel value. CLAHE limits upscaling by clipping the histogram to a predetermined value before computing the CDF. This limits the slope of the CDF and thus the slope of the transfer function. The value at which the histogram is clipped, the so-called clipping limit, depends on the normalization of the histogram and therefore on the size of the neighborhood. Common values limit result magnification to between 3 and 4. Advantageously, the part of the histogram that exceeds the clipping limit is not discarded, but it is distributed equally among all histogram blocks.

本发明实施例提供了一种电子消化道内窥镜图像的处理装置,参见图6所示,图6为本发明实施例电子消化道内窥镜图像的处理装置的原理示意图,电子消化道内窥镜图像的处理装置70包括:An embodiment of the present invention provides a device for processing an image of an electronic digestive tract endoscope. Referring to FIG. 6 , FIG. 6 is a schematic diagram of the principle of an image processing device of an electronic digestive tract endoscope according to an embodiment of the present invention. The processing device 70 includes:

转换模块71,用于将电子消化道内窥镜采集到的第一YUV图像转换为第一RGB图像;The conversion module 71 is used to convert the first YUV image collected by the electronic digestive tract endoscope into a first RGB image;

拆分模块72,用于对所述第一RGB图像进行拆分,得到三个单颜色通道图像,所述三个单颜色通道图像包括:R通道图像、G通道图像和B通道图像;A splitting module 72, configured to split the first RGB image to obtain three single-color channel images, where the three single-color channel images include: an R-channel image, a G-channel image, and a B-channel image;

处理模块73,用于采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像;The processing module 73 is configured to use the histogram equalization algorithm to process the three single-color channel images respectively to obtain three processed single-color channel images;

合并模块74,用于合并所述处理后的三个单颜色通道图像,得到第二RGB图像;a merging module 74 for merging the processed three single-color channel images to obtain a second RGB image;

所述转换模块71,还用于将所述第二RGB图像转换为第二YUV图像。The conversion module 71 is further configured to convert the second RGB image into a second YUV image.

在本发明的一些实施例中,可选地,电子消化道内窥镜图像的处理装置70还包括:In some embodiments of the present invention, optionally, the apparatus 70 for processing an image of an electronic digestive tract endoscope further includes:

降噪模块75,用于对所述第一YUV图像进行降噪处理,所述降噪处理用于降低以下至少一种噪声:亮度噪声、色彩噪声。The noise reduction module 75 is configured to perform noise reduction processing on the first YUV image, and the noise reduction processing is used to reduce at least one of the following noises: luminance noise and color noise.

在本发明的一些实施例中,可选地,In some embodiments of the present invention, optionally,

处理模块73,还用于根据各个所述单颜色通道图像,计算得到各个所述单颜色通道图像的灰度分布数据,将所述灰度分布数据发送至与用户关联的交互端;The processing module 73 is further configured to calculate and obtain the grayscale distribution data of each of the single-color channel images according to each of the single-color channel images, and send the grayscale distribution data to the interactive terminal associated with the user;

处理模块73,还用于接收所述交互端发送的灰度直方图限制值,所述限制值与所述单颜色通道图像对应;The processing module 73 is further configured to receive a grayscale histogram limit value sent by the interactive terminal, where the limit value corresponds to the single-color channel image;

处理模块73,还用于根据所述灰度直方图限制值,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像;The processing module 73 is further configured to use a histogram equalization algorithm to process the three single-color channel images respectively according to the grayscale histogram limit value, to obtain three processed single-color channel images;

在本发明的一些实施例中,可选地,In some embodiments of the present invention, optionally,

处理模块73,还用于获取预设的所述灰度直方图限制值;The processing module 73 is further configured to obtain the preset limit value of the grayscale histogram;

处理模块73,还用于根据所述灰度直方图限制值,采用直方图均衡化算法分别对所述三个单颜色通道图像进行处理,得到处理后的三个单颜色通道图像。The processing module 73 is further configured to process the three single-color channel images respectively by using a histogram equalization algorithm according to the grayscale histogram limit value, to obtain three processed single-color channel images.

在本发明的一些实施例中,可选地,In some embodiments of the present invention, optionally,

处理模块73,还用于根据预设的切分规则对每个所述单颜色通道图像进行切分,得到与所述单颜色通道图像对应的多个图像分块;The processing module 73 is further configured to segment each of the single-color channel images according to preset segmentation rules to obtain multiple image segments corresponding to the single-color channel images;

处理模块73,还用于获取与所述单颜色通道图像对应的灰度直方图限制值;The processing module 73 is further configured to obtain a grayscale histogram limit value corresponding to the single-color channel image;

处理模块73,还用于计算得到所述单颜色通道图像的每个所述图像分块的灰度直方图,根据与所述单颜色通道图像对应的灰度直方图限制值,对所述单颜色通道图像的每个所述图像分块的灰度直方图进行裁切,得到裁切后的每个所述图像分块的灰度直方图;The processing module 73 is further configured to calculate and obtain the grayscale histogram of each of the image blocks of the single-color channel image, and, according to the grayscale histogram limit value corresponding to the single-color channel image, for the single-color channel image. The grayscale histogram of each of the image blocks of the color channel image is trimmed to obtain the grayscale histogram of each of the image blocks after the cropping;

处理模块73,还用于根据裁切后的每个所述图像分块的灰度直方图,得到每一子图像的灰度映射函数;The processing module 73 is further configured to obtain a grayscale mapping function of each sub-image according to the cut grayscale histogram of each of the image blocks;

处理模块73,还用于针对每一图像分块,采用插值算法对所述图像分块相邻的图像分块的灰度映射函数进行插值,得到每一图像分块的目标灰度值;The processing module 73 is further configured to, for each image block, use an interpolation algorithm to interpolate the grayscale mapping function of the image blocks adjacent to the image block to obtain the target gray value of each image block;

处理模块73,还用于根据所述目标灰度值增强与所述目标灰度值对应的图像分块的对比度,得到处理后的图像分块;根据所述预设的切分规则合并处理后的图像分块,得到处理后的三个单颜色通道图像。The processing module 73 is further configured to enhance the contrast of the image blocks corresponding to the target gray value according to the target gray value, so as to obtain the processed image blocks; after merging and processing according to the preset segmentation rule The image is partitioned to obtain three single-color channel images after processing.

在本发明的一些实施例中,可选地,In some embodiments of the present invention, optionally,

处理模块73,还用于裁切步骤:检测所述图像分块的灰度直方图中各灰度级,针对检测结果为对应的直方图统计值超出所述灰度直方图限制值的灰度级,对所述灰度级对应的直方图统计值进行裁切,使得裁切后的直方图统计值不超出所述灰度直方图限制值;The processing module 73 is also used for the cropping step: detecting each gray level in the grayscale histogram of the image block, and for the grayscale whose detection result is that the corresponding statistical value of the histogram exceeds the limit value of the grayscale histogram level, the histogram statistic value corresponding to the gray level is trimmed, so that the trimmed histogram statistic value does not exceed the gray histogram limit value;

处理模块73,还用于将裁切掉的直方图统计值平均分配给检测结果为对应的直方图统计值不超出所述灰度直方图限制值的其他灰度级;执行所述裁切步骤直至所述图像分块的灰度直方图中各灰度级均不超出所述灰度直方图限制值,得到裁切后的所述图像分块的灰度直方图。The processing module 73 is further configured to evenly distribute the cropped histogram statistics to other gray levels whose detection results are that the corresponding histogram statistics do not exceed the grayscale histogram limit value; perform the cropping step Until each gray level in the grayscale histogram of the image block does not exceed the grayscale histogram limit value, the cut grayscale histogram of the image block is obtained.

本申请实施例提供的电子消化道内窥镜图像的处理装置能够实现图1至图5的方法实施例实现的各个过程,并达到相同的技术效果,为避免重复,这里不再赘述。The electronic digestive tract endoscope image processing apparatus provided in the embodiment of the present application can implement the various processes implemented by the method embodiments in FIGS. 1 to 5 , and achieve the same technical effect. To avoid repetition, details are not repeated here.

本发明实施例提供了一种电子设备80,参见图7所示,图7为本发明实施例电子设备80的原理框图,包括处理器81,存储器82及存储在存储器82上并可在处理器81上运行的程序或指令,程序或指令被处理器执行时实现本发明的任一项电子消化道内窥镜图像的处理方法中的步骤。An embodiment of the present invention provides an electronic device 80. Referring to FIG. 7, FIG. 7 is a schematic block diagram of the electronic device 80 according to the embodiment of the present invention, including a processor 81, a memory 82, and a memory 82 and a processor 82. The program or instruction running on 81, when the program or instruction is executed by the processor, implements any one of the steps in the electronic digestive tract endoscope image processing method of the present invention.

本发明实施例提供了一种可读存储介质,可读存储介质上存储程序或指令,程序或指令被处理器执行时实现如上述任一项的电子消化道内窥镜图像的处理方法的实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present invention provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, an embodiment of the processing method for an electronic digestive tract endoscope image as described above is implemented and can achieve the same technical effect, in order to avoid repetition, it will not be repeated here.

其中,所述的可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。The readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.

上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本发明的保护之内。The embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of the present invention, without departing from the spirit of the present invention and the scope protected by the claims, many forms can be made, which all belong to the protection of the present invention.

Claims (10)

1. A method for processing an electronic digestive tract endoscope image, comprising:
converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image;
splitting the first RGB image to obtain three single-color channel images, wherein the three single-color channel images comprise: an R channel image, a G channel image, and a B channel image;
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images;
merging the processed three single-color channel images to obtain a second RGB image;
and converting the second RGB image into a second YUV image.
2. The method for processing an electronic digestive tract endoscope image according to claim 1, characterized in that:
converting a first YUV image acquired by an electronic digestive tract endoscope into a first RGB image, comprising:
performing noise reduction processing on the first YUV image, wherein the noise reduction processing is used for reducing at least one of the following noises: luminance noise, color noise.
3. The method for processing an electronic digestive tract endoscope image according to claim 1, characterized in that:
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
calculating to obtain gray distribution data of each single-color channel image according to each single-color channel image, and sending the gray distribution data to an interaction terminal associated with a user;
receiving a gray level histogram limiting value sent by the interaction terminal, wherein the limiting value corresponds to the single-color channel image;
processing the three single-color channel images respectively by adopting a histogram equalization algorithm according to the gray level histogram limit value to obtain three processed single-color channel images;
or,
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
acquiring a preset gray level histogram limit value;
and processing the three single-color channel images respectively by adopting a histogram equalization algorithm according to the gray level histogram limit value to obtain the processed three single-color channel images.
4. The method for processing an electronic digestive tract endoscope image according to claim 1, characterized in that:
processing the three single-color channel images by adopting a histogram equalization algorithm to obtain processed three single-color channel images, wherein the processing comprises the following steps:
segmenting each single-color channel image according to a preset segmentation rule to obtain a plurality of image blocks corresponding to the single-color channel images;
acquiring a gray level histogram limit value corresponding to the single-color channel image;
calculating to obtain a gray histogram of each image block of the single-color channel image, and cutting the gray histogram of each image block of the single-color channel image according to a gray histogram limit value corresponding to the single-color channel image to obtain a cut gray histogram of each image block;
obtaining a gray mapping function of each sub-image according to the gray histogram of each cut image block;
for each image block, interpolating a gray mapping function of an adjacent image block of the image block by adopting an interpolation algorithm to obtain a target gray value of each image block;
enhancing the contrast of the image blocks corresponding to the target gray value according to the target gray value to obtain the processed image blocks; and combining the processed image blocks according to the preset segmentation rule to obtain the processed three single-color channel images.
5. The method for processing an electronic digestive tract endoscope image according to claim 4, characterized in that:
according to the gray histogram limit value corresponding to the single-color channel image, the gray histogram of each image block of the single-color channel image is cut to obtain the cut gray histogram of each image block, and the method comprises the following steps:
a cutting step: detecting each gray level in a gray level histogram of the image block, and cutting the histogram statistic value corresponding to the gray level aiming at the gray level of which the corresponding histogram statistic value exceeds the gray level histogram limit value as a detection result, so that the cut histogram statistic value does not exceed the gray level histogram limit value;
averagely distributing the cut histogram statistic values to other gray levels with the detection results that the corresponding histogram statistic values do not exceed the gray level histogram limit value; and executing the cutting step until all gray levels in the gray level histogram of the image block do not exceed the limit value of the gray level histogram, so as to obtain the cut gray level histogram of the image block.
6. The method of processing an electronic digestive tract endoscope image according to any one of claims 4 or 5, characterized in that:
the interpolation algorithm is a bilinear difference algorithm.
7. An apparatus for processing an electronic endoscope image of an alimentary tract, comprising:
the conversion module is used for converting a first YUV image acquired by the electronic digestive tract endoscope into a first RGB image;
a splitting module, configured to split the first RGB image to obtain three single-color channel images, where the three single-color channel images include: an R channel image, a G channel image, and a B channel image;
the processing module is used for respectively processing the three single-color channel images by adopting a histogram equalization algorithm to obtain three processed single-color channel images;
the merging module is used for merging the processed three single-color channel images to obtain a second RGB image;
the conversion module is further configured to convert the second RGB image into a second YUV image.
8. The apparatus for processing an electronic digestive tract endoscope image according to claim 7, characterized in that:
the processing module is further configured to segment each single-color channel image according to a preset segmentation rule to obtain a plurality of image blocks corresponding to the single-color channel image;
the processing module is further configured to obtain a gray level histogram limit value corresponding to the single-color channel image;
the processing module is further configured to calculate a gray histogram of each image partition of the single-color channel image, and cut the gray histogram of each image partition of the single-color channel image according to a gray histogram limit value corresponding to the single-color channel image to obtain a cut gray histogram of each image partition;
the processing module is further used for obtaining a gray mapping function of each sub-image according to the cut gray histogram of each image block;
the processing module is further used for interpolating the gray mapping functions of the image blocks adjacent to the image blocks by adopting an interpolation algorithm aiming at each image block to obtain a target gray value of each image block;
the processing module is further configured to enhance the contrast of the image partition corresponding to the target gray value according to the target gray value to obtain a processed image partition; and combining the processed image blocks according to the preset segmentation rule to obtain the processed three single-color channel images.
9. An electronic device, characterized in that: comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, which when executed by the processor implement the steps in the method of processing an electronic digestive tract endoscope image according to any one of claims 1 to 6.
10. A readable storage medium, characterized by: the readable storage medium stores thereon a program or instructions which, when executed by a processor, implement the steps in the method of processing an electronic digestive tract endoscope image according to any one of claims 1 to 6.
CN202210836269.8A 2022-07-15 2022-07-15 Method and device for processing electronic digestive tract endoscope image and electronic equipment Pending CN115063398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210836269.8A CN115063398A (en) 2022-07-15 2022-07-15 Method and device for processing electronic digestive tract endoscope image and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210836269.8A CN115063398A (en) 2022-07-15 2022-07-15 Method and device for processing electronic digestive tract endoscope image and electronic equipment

Publications (1)

Publication Number Publication Date
CN115063398A true CN115063398A (en) 2022-09-16

Family

ID=83206006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210836269.8A Pending CN115063398A (en) 2022-07-15 2022-07-15 Method and device for processing electronic digestive tract endoscope image and electronic equipment

Country Status (1)

Country Link
CN (1) CN115063398A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101873429A (en) * 2010-04-16 2010-10-27 杭州海康威视软件有限公司 Processing method and device of image contrast
US7840066B1 (en) * 2005-11-15 2010-11-23 University Of Tennessee Research Foundation Method of enhancing a digital image by gray-level grouping
CN102202163A (en) * 2011-05-13 2011-09-28 成都西图科技有限公司 Adaptive enhancement method and device for monitored video
CN110599426A (en) * 2019-09-19 2019-12-20 南京工程学院 CLAHE (class-invariant feature extraction) optimized underwater image enhancement method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7840066B1 (en) * 2005-11-15 2010-11-23 University Of Tennessee Research Foundation Method of enhancing a digital image by gray-level grouping
CN101873429A (en) * 2010-04-16 2010-10-27 杭州海康威视软件有限公司 Processing method and device of image contrast
CN102202163A (en) * 2011-05-13 2011-09-28 成都西图科技有限公司 Adaptive enhancement method and device for monitored video
CN110599426A (en) * 2019-09-19 2019-12-20 南京工程学院 CLAHE (class-invariant feature extraction) optimized underwater image enhancement method

Similar Documents

Publication Publication Date Title
US11816811B2 (en) Efficient image demosaicing and local contrast enhancement
WO2020125631A1 (en) Video compression method and apparatus, and computer-readable storage medium
US9842382B2 (en) Method and device for removing haze in single image
US8199227B2 (en) Image-signal processing apparatus for performing space-variant image-signal processing
CN110246087B (en) System and method for removing image chroma noise by referring to multi-resolution of multiple channels
CN108090876B (en) Image processing method and device
CN111163268B (en) Image processing method and device and computer storage medium
CN111784605B (en) Image noise reduction method based on region guidance, computer device and computer readable storage medium
US9185265B2 (en) Image processing method and image processing apparatus for performing a tone correction to acquire a combined image
US7889280B2 (en) Image processing apparatus and method thereof
JP4097587B2 (en) Image processing apparatus and image processing method
US8427560B2 (en) Image processing device
WO2018100950A1 (en) Image processing device, digital camera, image processing program, and recording medium
KR20200071866A (en) Method and apparatus for machine-learning based processing of high-resolution image
JP3387071B2 (en) Image identification apparatus and method
CN114998122A (en) Low-illumination image enhancement method
CN115063398A (en) Method and device for processing electronic digestive tract endoscope image and electronic equipment
JP2009200635A (en) Image processor, and processing method and program
CN108810320B (en) Image quality improving method and device
US20200286210A1 (en) Image processing method and electronic device thereof
CN111414877A (en) Table clipping method of removing color borders, image processing apparatus, and storage medium
KR101874538B1 (en) Method and Apparatus for Processing Image to Simultaneously Enhance Contrast and Saturation of Image
CN113781330B (en) Image processing method, device and electronic system
CN112308791B (en) Color constancy method based on gray pixel statistics
WO2022246663A1 (en) Image processing method, device and system, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination