CN113112438B - Image enhancement method based on clipping histogram - Google Patents
Image enhancement method based on clipping histogram Download PDFInfo
- Publication number
- CN113112438B CN113112438B CN202110477068.9A CN202110477068A CN113112438B CN 113112438 B CN113112438 B CN 113112438B CN 202110477068 A CN202110477068 A CN 202110477068A CN 113112438 B CN113112438 B CN 113112438B
- Authority
- CN
- China
- Prior art keywords
- sub
- image
- histograms
- histogram
- clipping
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 17
- 230000011218 segmentation Effects 0.000 claims abstract description 10
- 238000004364 calculation method Methods 0.000 claims description 3
- 230000001186 cumulative effect Effects 0.000 claims description 2
- 238000004422 calculation algorithm Methods 0.000 abstract description 9
- 230000000694 effects Effects 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20076—Probabilistic image processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20112—Image segmentation details
- G06T2207/20132—Image cropping
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Facsimile Image Signal Circuits (AREA)
- Image Processing (AREA)
Abstract
The invention discloses an image enhancement method based on a clipping histogram. The method comprises the following steps: calculating the median value of the image, and dividing the image into two sub-histograms according to the median value; respectively calculating average brightness values of the two sub-histograms; taking the average brightness value of the two sub-histograms as a segmentation threshold value, and dividing the original image into three sub-histograms; cutting each sub-histogram; and homogenizing each sub-image, and combining to obtain a complete enhanced image. The invention uses the algorithm of histogram clipping to control enhancement, suppresses noise, improves contrast, and simultaneously keeps the details of the enhanced picture good.
Description
Technical Field
The invention relates to the technical field of image enhancement, in particular to an image enhancement method based on a clipping histogram.
Background
Image enhancement technology is an important direction of research in digital image processing, and can be applied to various fields, such as: archaeology, medical image processing and analysis, photographic image processing, and the like. Image enhancement aims to enhance the brightness of an image and improve the contrast of the image while maintaining local detail, and reducing noise influence.
The histogram equalization HE is widely used as a classical image enhancement algorithm due to its simplicity and ease of implementation. HE uniformly distributes the input image pixel mean values, which may cause excessive differences between the average brightness of the image and the enhanced image brightness, and may also generate noise and edge ghost. Based on histogram equalization, researchers have proposed a number of representative image enhancement algorithms, more representative contrast preserving histogram equalization BBHE, dual sub-image histogram equalization DSIHE, etc., which may lead to excessive enhancement and loss of detail.
Disclosure of Invention
The invention aims to provide an image enhancement method based on a clipping histogram, which ensures reasonable brightness contrast after image enhancement and has good detail keeping effect.
The technical solution for realizing the purpose of the invention is as follows: an image enhancement method based on clipping histograms, comprising the steps of:
step 1, calculating a median value of an image, and dividing the image into two sub-histograms according to the median value;
Step 2, calculating average brightness values of the two sub-histograms respectively;
Step 3, taking the average brightness value of the two sub-histograms as a segmentation threshold value, and dividing the original image into three sub-histograms;
Step 4, cutting each sub-histogram;
And 5, homogenizing each sub-image, and merging to obtain a complete enhanced image.
Further, the median of the image is calculated in step 1, and the image is divided into two sub-histograms according to the median, specifically as follows:
assuming a gray value range of the image [0, L-1], the probability density function h (x) of the image is defined as:
h(x)=H(x)/N (1)
in the above formula, H (x) is the sum of pixels with gray values equal to x, and
The median of the input image is represented as a gray value M e, and the corresponding cumulative density function is 0.5;
The definition variable z is:
z(x)=z(x-1)+h(x),x=0,1…L-1 (2)
and z (0) =h (0);
then M e is defined as:
Then, the histogram of the image is divided into two sub-histograms h L and h H according to M e:
hL=h(x),x=0,1…Me (4)
hH=h(x),x=Me+1,…L-1 (5)
Further, in step2, the average luminance values of the two sub-histograms are calculated respectively, which is specifically as follows:
The average luminance values of the two sub-histograms h L and h H are denoted as I ml and I mh, respectively, then
Further, in step 3, the average luminance value of the two sub-histograms is used as a segmentation threshold, and the original image is segmented into three sub-histograms, specifically:
taking I ml and I mh as segmentation thresholds, the histogram is again divided into 3 sub-histograms h 1,h2,h3, denoted as:
h1(x)=h(x),x=0,1…Iml (8)
h2(x)=h(x),x=Iml+1,…Imh (9)
h3(x)=h(x),x=Imh+1,…L-1(10)
Further, in step 4, clipping is performed on each sub-histogram, which is specifically as follows:
Using the average value of the frequency values of the gray values of each sub-histogram as the clipping threshold of each sub-histogram, denoted as c 1,c2,c3:
Clipping the three sub-histograms by using a clipping threshold value to obtain a clipped histogram expressed as h 1 c、h2 c、h3 c:
Normalizing the cut histogram to obtain a normalized histogram, which is expressed as:
Further, in step 5, the homogenizing treatment is performed on each sub-image, and then the merging is performed to obtain a complete enhanced image, which is specifically as follows:
the accumulated frequency CDF of the three sub-histograms is C 1,C2,C3 respectively, and the calculation formula is as follows:
After the CDF for each sub-histogram is determined, the transform function is determined using histogram equalization, resulting in an enhanced image denoted p 1、p2、p3:
p1=Iml×C1 (23)
p2=(Iml+1)+(Imh-Iml-1)×C2 (24)
p3=(Imh+1)+(L-Imh-2)×C3 (25)
And combining the three enhanced sub-images to obtain a complete enhanced image.
Compared with the prior art, the invention has the remarkable advantages that: (1) The advantages of histogram segmentation and histogram clipping are fully utilized, the enhancement is controlled, the noise is suppressed, the contrast is reasonably improved, and the image has good effects on the aspects of contrast and brightness maintenance after the image is enhanced; (2) The local details of the image are well preserved, so that the image can be enhanced and naturally and unobtrusively seen.
Drawings
Fig. 1 is a flow chart of the clipping histogram-based image enhancement method of the present invention.
Fig. 2 is a graph of image enhancement contrast of the method of the present invention with other image enhancement algorithms.
Detailed description of the preferred embodiments
The invention relates to an image enhancement method based on clipping histograms, which comprises the following steps:
step 1, calculating a median value of an image, and dividing the image into two sub-histograms according to the median value;
Step 2, calculating average brightness values of the two sub-histograms respectively;
Step 3, taking the average brightness value of the two sub-histograms as a segmentation threshold value, and dividing the original image into three sub-histograms;
Step 4, cutting each sub-histogram;
And 5, homogenizing each sub-image, and merging to obtain a complete enhanced image.
Further, in a first step, the median of the image is calculated.
Assuming the gray value range of the image [0, L-1], the probability density function of the image is defined as:
h(x)=H(x)/N (1)
in the above formula, H (x) is the sum of pixels with gray values equal to x, and
The median value of the input image is expressed as a gray value Me with an accumulated density function of 0.5.
The definition variable z is:
z(x)=z(x-1)+h(x),x=0,1…L-1 (2)
and z (0) =h (0).
Then median M e is defined as:
Then, according to the median value, M e divides the histogram of the image into two sub-histograms h L and h H.
hL=h(x),x=0,1…Me (4)
hH=h(x),x=Me+1,…L-1 (5)
Further, in the second step, an average luminance value is calculated.
The average luminance values of the two sub-histograms h L and h H are denoted as I ml and I mh, respectively, then
Further, in the third step, an average luminance value is calculated.
Sub-histogram partitioning
Taking I ml and I mh as segmentation thresholds, the histogram is again divided into 3 sub-histograms h 1,h2,h3, denoted as:
h1(x)=h(x),x=0,1…Iml (8)
h2(x)=h(x),x=Iml+1,…Imh (9)
h3(x)=h(x),x=Imh+1,…L-1 (10)
Further, in the fourth step, the sub-histogram is cut.
The average value of the frequency values of the gray values of each sub-histogram is used as a clipping threshold of each sub-histogram, denoted as c 1,c2,c3.
Cutting the three sub-histograms by using a cutting threshold value, and obtaining a cut histogram which is expressed as:
Normalizing the cut histogram to obtain a normalized histogram, which is expressed as:
Further, in the fifth step, histogram equalization processing and merging are performed.
The accumulated frequency CDF of the three sub-histograms is C 1,C2,C3 respectively, and the calculation formula is as follows:
after the CDF for each sub-histogram is found, the transformation function is determined using histogram equalization, and the resulting enhanced image is represented as:
p1=Iml×C1 (23)
p2=(Iml+1)+(Imh-Iml-1)×C2 (24)
p3=(Imh+1)+(L-Imh-2)×C3 (25)
And combining the three enhanced sub-images to obtain a complete enhanced image.
As can be seen from the simulation result of FIG. 2, the first to third rows are the first to third images in sequence, wherein the first column of images is the original image, the second column of images processed by the BBHE algorithm, the third column of images processed by the DSIHE algorithm, and the fourth column of images processed by the method of the invention. It can be seen from the figures that the first image, after enhancement, brings in significant noise with BBHE and DSIHE. The second image has a low contrast with the original image and the BBHE and DSIHE algorithms show excessive enhancement. In the third figure, the effect of BBHE enhancement is not very coordinated, DSIHE brings in significant noise. The algorithm of the invention has better effect after the three images are enhanced. The result shows that the method controls and enhances by utilizing the algorithm of the histogram clipping, suppresses noise, reasonably improves contrast, keeps the picture detail well, and enables the enhanced image to look more coordinated.
Claims (2)
1. An image enhancement method based on clipping histograms, comprising the steps of:
step 1, calculating a median value of an image, and dividing the image into two sub-histograms according to the median value;
Step 2, calculating average brightness values of the two sub-histograms respectively;
Step 3, taking the average brightness value of the two sub-histograms as a segmentation threshold value, and dividing the original image into three sub-histograms;
Step 4, cutting each sub-histogram;
Step 5, homogenizing each sub-image, and merging to obtain a complete enhanced image;
And (3) calculating the median value of the image in the step (1), and dividing the image into two sub-histograms according to the median value, wherein the method comprises the following steps of:
assuming a gray value range of the image [0, L-1], the probability density function h (x) of the image is defined as:
h(x)=H(x)/N (1)
in the above formula, H (x) is the sum of pixels with gray values equal to x, and
The median of the input image is represented as a gray value M e, and the corresponding cumulative density function is 0.5;
The definition variable z is:
z(x)=z(x-1)+h(x),x=0,1…L-1 (2)
and z (0) =h (0);
then M e is defined as:
Then, the histogram of the image is divided into two sub-histograms h L and h H according to M e:
hL=h(x),x=0,1…Me (4)
hH=h(x),x=Me+1,…L-1 (5)
And step 2, calculating average brightness values of the two sub-histograms respectively, wherein the average brightness values are as follows:
The average luminance values of the two sub-histograms h L and h H are denoted as I ml and I mh, respectively, then
And 3, taking the average brightness value of the two sub-histograms as a segmentation threshold value, and dividing the original image into three sub-histograms, wherein the method specifically comprises the following steps:
taking I ml and I mh as segmentation thresholds, the histogram is again divided into 3 sub-histograms h 1,h2,h3, denoted as:
h1(x)=h(x),x=0,1…Iml (8)
h2(x)=h(x),x=Iml+1,…Imh (9)
h3(x)=h(x),x=Imh+1,…L-1 (10)
and 4, clipping each sub-histogram, wherein the clipping process is specifically as follows:
Using the average value of the frequency values of the gray values of each sub-histogram as the clipping threshold of each sub-histogram, denoted as c 1,c2,c3:
Clipping the three sub-histograms by using a clipping threshold value to obtain a clipped histogram expressed as h 1 c、h2 c、h3 c:
Normalizing the cut histogram to obtain a normalized histogram, which is expressed as:
2. the image enhancement method based on clipping histograms according to claim 1, wherein in step 5, each sub-image is homogenized and combined to obtain a complete enhanced image, specifically as follows:
the accumulated frequency CDF of the three sub-histograms is C 1,C2,C3 respectively, and the calculation formula is as follows:
After the CDF for each sub-histogram is determined, the transform function is determined using histogram equalization, resulting in an enhanced image denoted p 1、p2、p3:
p1=Iml×C1 (23)
p2=(Iml+1)+(Imh-Iml-1)×C2 (24)
p3=(Imh+1)+(L-Imh-2)×C3 (25)
And combining the three enhanced sub-images to obtain a complete enhanced image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110477068.9A CN113112438B (en) | 2021-04-29 | 2021-04-29 | Image enhancement method based on clipping histogram |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110477068.9A CN113112438B (en) | 2021-04-29 | 2021-04-29 | Image enhancement method based on clipping histogram |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113112438A CN113112438A (en) | 2021-07-13 |
CN113112438B true CN113112438B (en) | 2024-05-07 |
Family
ID=76720560
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110477068.9A Active CN113112438B (en) | 2021-04-29 | 2021-04-29 | Image enhancement method based on clipping histogram |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113112438B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113808048A (en) * | 2021-09-23 | 2021-12-17 | 安徽理工大学 | Image enhancement system for excavation simulation field |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106530237A (en) * | 2016-09-19 | 2017-03-22 | 中山大学 | Image enhancement method |
CN110136089A (en) * | 2019-05-23 | 2019-08-16 | 大连理工大学 | A kind of human embryos cardiac ultrasound images Enhancement Method |
CN110211058A (en) * | 2019-05-15 | 2019-09-06 | 南京极目大数据技术有限公司 | A kind of data enhancement methods of medical image |
CN110852955A (en) * | 2018-08-21 | 2020-02-28 | 中南大学 | Image enhancement method based on image intensity threshold and adaptive cutting |
CN112365424A (en) * | 2020-11-17 | 2021-02-12 | 昆明物理研究所 | Infrared image denoising enhancement method, device and system based on local self-adaptive CLAHE and computer readable storage medium |
-
2021
- 2021-04-29 CN CN202110477068.9A patent/CN113112438B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106530237A (en) * | 2016-09-19 | 2017-03-22 | 中山大学 | Image enhancement method |
CN110852955A (en) * | 2018-08-21 | 2020-02-28 | 中南大学 | Image enhancement method based on image intensity threshold and adaptive cutting |
CN110211058A (en) * | 2019-05-15 | 2019-09-06 | 南京极目大数据技术有限公司 | A kind of data enhancement methods of medical image |
CN110136089A (en) * | 2019-05-23 | 2019-08-16 | 大连理工大学 | A kind of human embryos cardiac ultrasound images Enhancement Method |
CN112365424A (en) * | 2020-11-17 | 2021-02-12 | 昆明物理研究所 | Infrared image denoising enhancement method, device and system based on local self-adaptive CLAHE and computer readable storage medium |
Non-Patent Citations (1)
Title |
---|
直方图分割耦合裁剪控制均衡化的图像增强算法;越琳;高丽燕;;计算机工程与设计(第02期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113112438A (en) | 2021-07-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110599415B (en) | Image contrast enhancement implementation method based on local self-adaptive gamma correction | |
Kaur et al. | Survey of contrast enhancement techniques based on histogram equalization | |
Ooi et al. | Bi-histogram equalization with a plateau limit for digital image enhancement | |
US9147238B1 (en) | Adaptive histogram-based video contrast enhancement | |
US8150202B2 (en) | Gaussian mixture model based illumination normalization for global enhancement | |
CN111105371B (en) | Enhancement method of low-contrast infrared image | |
US20080085061A1 (en) | Method and Apparatus for Adjusting the Contrast of an Input Image | |
CN106846276A (en) | A kind of image enchancing method and device | |
CN111968041A (en) | Self-adaptive image enhancement method | |
CN108280836B (en) | Image processing method and device | |
CN111709898B (en) | Infrared image enhancement method and system based on optimized CLAHE | |
CN113112438B (en) | Image enhancement method based on clipping histogram | |
Srinivasan et al. | Adaptive contrast enhancement using local region stretching | |
Abdullah-Al-Wadud | A modified histogram equalization for contrast enhancement preserving the small parts in images | |
CN201726464U (en) | Novel video image sharpening processing device | |
Zhu et al. | Image enhancement using fuzzy intensity measure and adaptive clipping histogram equalization | |
Hai et al. | Image enhancement based on contrast limited adaptive histogram equalization for 3D images of stereoscopic endoscopy | |
Feng et al. | Low-light image enhancement by refining illumination map with self-guided filtering | |
Li et al. | Saliency guided naturalness enhancement in color images | |
CN116029944B (en) | Self-adaptive contrast enhancement method and device for gray level image | |
CN112308793A (en) | Novel method for enhancing contrast and detail of non-uniform illumination image | |
CN112581400B (en) | Gaussian standard deviation and contrast ratio based tuned image enhancement method | |
Jain et al. | A survey of contrast enhancement technique for remote sensing images | |
Kong et al. | Histogram based image enhancement for non-uniformly illuminated and low contrast images | |
CN112348749B (en) | Image defogging method based on self-adaptive Gamma function and improved CLAHE |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |