CN110310250B - Global histogram equalization method based on optimization model - Google Patents

Global histogram equalization method based on optimization model Download PDF

Info

Publication number
CN110310250B
CN110310250B CN201910569031.1A CN201910569031A CN110310250B CN 110310250 B CN110310250 B CN 110310250B CN 201910569031 A CN201910569031 A CN 201910569031A CN 110310250 B CN110310250 B CN 110310250B
Authority
CN
China
Prior art keywords
histogram
hist
truncation
array
image
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
Application number
CN201910569031.1A
Other languages
Chinese (zh)
Other versions
CN110310250A (en
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.)
Huaqiao University
Original Assignee
Huaqiao University
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 Huaqiao University filed Critical Huaqiao University
Priority to CN201910569031.1A priority Critical patent/CN110310250B/en
Publication of CN110310250A publication Critical patent/CN110310250A/en
Application granted granted Critical
Publication of CN110310250B publication Critical patent/CN110310250B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration by the use of histogram techniques
    • 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/10016Video; Image sequence

Abstract

The invention relates to a global histogram equalization method based on an optimization model, which comprises the following steps: performing truncation and equipartition processing on the image histogram according to the successively changed truncation threshold, and averagely distributing the truncated part to a gray scale range to generate a current virtual output image and a corresponding current temporary histogram; calculating the information entropy and the contrast in each iteration process; then, according to the proposed optimization model, determining the optimal truncation threshold of the histogram by adopting a traversal optimization method; finally, carrying out global histogram equalization to obtain a result image; the global histogram equalization method based on the optimized model can improve the definition, brightness and contrast of images in various environments in a self-adaptive manner.

Description

Global histogram equalization method based on optimization model
Technical Field
The invention relates to the field of video image enhancement, in particular to a global histogram equalization method based on an optimization model.
Background
The histogram of an image is a statistical map obtained by counting pixel values of the image, contains distribution characteristics of image brightness, and is often used as a tool for image enhancement, thereby generating a plurality of correlation algorithms, and global histogram equalization is the most traditional method among the methods, and the image is optimized according to the distribution characteristics of the histogram, so that the histogram tends to be uniformly distributed, and the contrast of the image is enhanced, so that the image is more suitable for observation of human eyes. However, the traditional global histogram equalization algorithm has the problems of high contrast, overexposure, detail loss and the like, so that the equalized image is not suitable for observation of human eyes.
Therefore, many improved algorithms have been derived for the conventional histogram equalization algorithm, and the contrast-limited histogram equalization algorithm is one of the improved algorithms. The enhancement effect of most of algorithms is more natural than that of the traditional method, but the control parameters of the algorithms are mostly based on empirical values or statistical values, and whether the parameters such as preset truncation threshold values and the like are optimal solutions or not cannot be determined. The invention provides a mathematical optimization model which can ensure that control parameters obtain optimal values.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide an optimized model-based global histogram equalization method which can adaptively improve the definition, brightness and contrast of images in various environments.
In order to realize the purpose, the technical scheme of the invention is as follows:
an optimization model-based global histogram equalization method, comprising:
(a) Defining a histogram of an input image as Hist, accumulating a truncation threshold T from an initial value 0 by taking Step as a stepping length, and performing truncation and equipartition processing on the histogram according to the numerical value of the truncation threshold T after each accumulation;
(b) Carrying out equalization processing on the histogram Hist to obtain a new histogram Hnew, and carrying out histogram migration and merging processing on the new histogram Hnew to generate a current virtual output image and a corresponding current temporary histogram hit; the equalization process comprises the steps of averagely distributing the truncated part data and the value of the histogram Hist to all gray level ranges specified by a color standard;
(c) Calculating information Entropy Encopy and Contrast ratio Contrast according to the current temporary histogram, and then respectively storing the information Entropy Encopy and the Contrast ratio Contrast into an array E (T) and an array C (T);
(d) After traversing all the truncation thresholds T, respectively carrying out normalization operation on the logarithm group E (T) and the logarithm group C (T), and then calculating by using a hybrid optimization model to obtain an optimal truncation threshold Topt;
(e) Performing truncation processing operation on the histogram Hist according to the optimal truncation threshold Topt; and carrying out equipartition processing on the truncated histogram value, and finally carrying out histogram equalization processing to obtain a result image.
Preferably, the calculation formula of the Step length Step is as follows:
Step=Hmax/Step_index
where Step _ index is a preset integer value, and Hmax is the maximum value of the histogram Hist.
Preferably, the truncating and equally dividing the histogram according to the value of the truncating threshold T after each accumulation specifically includes: if the input histogram Hist is larger than or equal to the current truncation threshold, assigning the current truncation threshold to a new histogram Hcut; and if the input histogram Hist is smaller than the current truncation threshold, assigning the input histogram Hist to a new histogram Hcut.
Preferably, the sum of truncated partial data of the histogram Hist is equal to the sum of data obtained by subtracting Hcut from Hist; the new histogram Hnew obtained by equalizing the histogram Hist is expressed as follows:
Hnew=Hcut+∑(Hist-Hcut)/Drange
wherein DRange is the gray scale range specified by the color standard.
Preferably, the information Entropy control and the Contrast are calculated as follows:
Entropy=∑P(n)*log2P(n)
wherein, P (n) is the probability distribution function of the image histogram, and n is the effective gray level in the histogram;
Contrast=P(0)(n1-n0)+∑P(k)(nk-nk-1)
wherein n iskRepresenting a grey level numbered k, n0Is the 0 th gray level, n, of all gray levels1Is the 1 st gray level among all gray levels.
Preferably, the normalization operation is performed on the logarithm group E (T) and the logarithm group C (T), specifically, the minimum value of the logarithm group is changed to 0, and the maximum value of the logarithm group is changed to 1; the following were used:
E(T)=[E(T)-min(E)]/[max(E)-min(E)]
C(T)=[C(T)-min(C)]/[max(C)-min(C)]。
wherein min (E) represents the minimum value in the array E (T); max (E) represents the maximum value in array E (T); min (C) represents the minimum value in the array C (T); max (C) represents the maximum value in the array C (T).
Preferably, the hybrid optimization model is represented as follows:
Mix(T)=E(T)*C(T)/[E(T)+C(T)]
the optimal truncation threshold Topt is a corresponding truncation threshold T when Mix (T) is maximized.
After the scheme is adopted, the invention has the beneficial effects that:
according to the global histogram equalization method based on the optimized model, the truncation equalization of the histogram is carried out by traversing the truncation threshold and combining the optimized model, so that the complexity of the algorithm is reduced, meanwhile, an effective basis is provided for the selection of the truncation threshold, the image effect is improved, the algorithm is more practical, and the method is suitable for commercialization.
The present invention will be described in further detail with reference to the drawings and embodiments, but the global histogram equalization method based on the optimized model of the present invention is not limited to the embodiments.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a comparison of the effects of the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described and discussed in detail below with reference to the drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In this embodiment, an image is assumed to be an n-bit image in advance, and if the theoretical gray scale range of the image is [ Lmin, lmax ], then dry = Lmax-Lmin +1, note that Lmin is not the minimum value of the current image, and this value is determined by the color space of the image and is irrelevant to the current image; the same applies to Lmax. For example, if the image is the Y component of the YCbCr color space, the theoretical gray scale range of the image is [16 ] and then dry =220.
Referring to fig. 1, the invention relates to an optimization model-based global histogram equalization method, which includes:
s101, successively accumulating the truncation threshold T, and performing truncation and averaging operation on the histogram Hist according to the current T value to obtain the histogram Hnew.
Specifically, defining a histogram of an input image as Hist, performing accumulation operation by using Step = Hmax/Step _ index as a Step length from an initial value 0, and gradually accumulating to a maximum value Hmax from a minimum value, wherein Step _ index is a preset integer value greater than or equal to 1, hmax is the maximum value of the histogram Hist, and when the histogram is greater than a current truncation threshold, reassigning the histogram to be the current truncation threshold, and defining a new histogram as Hcut; the implementation method comprises the following steps:
Hcut=T,if Hist>=T;
Hcut=Hist,if Hist<T;
t = Step × current iteration number.
S102, carrying out histogram migration and merging processing on the histogram Hnew to generate a current virtual output image, and calculating a current temporary histogram hit of the image.
Specifically, according to each truncation threshold T, the sum of the truncated part of the histogram Hist is calculated, the value of the sum is equal to the sum obtained by subtracting Hcut from Hist, and the sum is evenly distributed to all the specified gray level ranges to obtain a new histogram Hnew, and the implementation method is as follows:
Hnew=Hcut+∑(Hist-Hcut)/Drange
wherein DRange is the gray scale range specified by the color standard.
And then carrying out histogram migration and merging processing according to the Hnew, wherein the traditional histogram equalization method is adopted in the thought and the steps, and the current virtual output image and the temporary histogram hit are obtained after the processing.
S103, calculating the information Entropy Encopy and the Contrast ratio Contrast according to the current temporary histogram, and then respectively storing the information Entropy Encopy and the Contrast ratio Contrast into an array E (T) and an array C (T).
Specifically, the information Entropy control = ∑ P (n) × log is calculated from the current temporary histogram2P (n), where P (n) is the probability distribution function of the image histogram, n is the effective gray level in the histogram, and the Contrast = P (0) (n) is calculated1-n0)+∑P(k)(nk-nk-1) Wherein n iskRepresenting a grey level numbered k, n0Is the 0 th gray level, n, of all gray levels1Is the 1 st gray level among all gray levels. And then stored in array E (T) and array C (T), respectively.
And S104, after traversing all the truncation thresholds T, respectively carrying out normalization operation on the array E (T) and the array C (T), and then calculating by using a hybrid optimization model to obtain the optimal truncation threshold Topt.
Specifically, after traversing all truncation thresholds T, normalization operations are respectively performed on the array E (T) and the array C (T), the array minimum value becomes 0, and the array maximum value becomes 1; is concretely implemented by the formula
E(T)=[E(T)-min(E)]/[max(E)-min(E)];
C(T)=[C(T)-min(C)]/[max(C)-min(C)];
And then, calculating an optimal truncation threshold Topt by using a hybrid optimization model Mix (T) = E (T) × C (T)/[ E (T) + C (T) ], wherein the optimal truncation threshold Topt is a corresponding truncation value T when Mix (T) obtains the maximum value.
And S105, performing truncation and equipartition operation on the histogram Hist according to Topt, and then performing histogram equalization processing to obtain a final result image.
Specifically, performing truncation processing operation on the histogram Hist according to the optimal truncation threshold Topt; and (4) carrying out equipartition processing on the truncated histogram value, and finally carrying out histogram equalization processing (refer to S101 and S102) to obtain a result image.
Fig. 2 is a graph showing a comparison of the enhancement effect of the experimental image of the present embodiment, in which fig. 2 (a) is an original image and fig. 2 (b) is an enhancement result graph. The effect graph after experimental enhancement shows that the invention provides the global histogram equalization method based on the optimization model, the degree of global histogram equalization is controlled by the truncation threshold based on the optimization model, so that the image avoids overhigh contrast, overexposure can keep the details of the image, and the image better conforms to the visual characteristics of human eyes.
The above is only one preferred embodiment of the present invention. However, the present invention is not limited to the above embodiments, and any equivalent changes and modifications made according to the present invention, which do not bring out the functional effects beyond the scope of the present invention, belong to the protection scope of the present invention.

Claims (2)

1. An optimization model-based global histogram equalization method, comprising:
(a) Defining a histogram of an input image as Hist, accumulating a truncation threshold T from an initial value 0 by taking Step as a stepping length, and performing truncation and equipartition processing on the histogram according to the numerical value of the truncation threshold T after each accumulation;
(b) Carrying out equalization processing on the histogram Hist to obtain a new histogram Hnew, and carrying out histogram migration and merging processing on the new histogram Hnew to generate a current virtual output image and a corresponding current temporary histogram hit; the equalization process comprises the steps of averagely distributing the truncated part data and the value of the histogram Hist to all gray level ranges specified by a color standard;
(c) Calculating information Entropy Encopy and Contrast ratio Contrast according to the current temporary histogram, and then respectively storing the information Entropy Encopy and the Contrast ratio Contrast into an array E (T) and an array C (T);
(d) After traversing all the truncation thresholds T, respectively carrying out normalization operation on the logarithm group E (T) and the logarithm group C (T), and then calculating by using a hybrid optimization model to obtain an optimal truncation threshold Topt;
(e) Performing truncation processing operation on the histogram Hist according to the optimal truncation threshold Topt; carrying out equipartition processing on the cut histogram value, and finally carrying out histogram equalization processing to obtain a result image;
performing truncation and equipartition processing on the histogram according to the numerical value of the truncation threshold T after each accumulation, specifically comprising the following steps: if the input histogram Hist is greater than or equal to the current truncation threshold, assigning the current truncation threshold to a new histogram Hcut; if the input histogram Hist is smaller than the current truncation threshold, assigning the input histogram Hist to a new histogram Hcut;
the sum of the truncated partial data of the histogram Hist is equal to the sum of the truncated partial data of the histogram Hist and the data obtained by subtracting Hcut; the new histogram Hnew obtained by equalizing the histogram Hist is represented as follows:
Hnew=Hcut+∑(Hist-Hcut)/Drange
wherein DRange is the gray level range specified by the color standard;
the information Entropy Encopy and the Contrast are calculated as follows:
Entropy=∑P(n)*log2P(n)
wherein, P (n) is the probability distribution function of the image histogram, and n is the effective gray level in the histogram;
Contrast=P(0)(n1-n0)+∑P(k)(nk-nk-1)
wherein n iskRepresenting a grey level numbered k, n0Is the 0 th gray level, n, of all gray levels1Is the 1 st gray level of all gray levels;
respectively carrying out normalization operation on the array E (T) and the array C (T), specifically, changing the array minimum value into 0 and changing the array maximum value into 1; the following were used:
E(T)=[E(T)-min(E)]/[max(E)-min(E)]
C(T)=[C(T)-min(C)]/[max(C)-min(C)]
wherein min (E) represents the minimum value in the array E (T); max (E) represents the maximum value in the array E (T); min (C) represents the minimum value in the array C (T); max (C) represents the maximum value in the array C (T);
the hybrid optimization model is represented as follows:
Mix(T)=E(T)*C(T)/[E(T)+C(T)]
the optimal cutoff threshold Topt is a cutoff threshold T corresponding to the maximum value of Mix (T).
2. The optimized model-based global histogram equalization method of claim 1, wherein said Step length Step is calculated as follows:
Step=Hmax/Step_index
step _ index is a preset integer value, and Hmax is the maximum value of the histogram Hist.
CN201910569031.1A 2019-06-27 2019-06-27 Global histogram equalization method based on optimization model Active CN110310250B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910569031.1A CN110310250B (en) 2019-06-27 2019-06-27 Global histogram equalization method based on optimization model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910569031.1A CN110310250B (en) 2019-06-27 2019-06-27 Global histogram equalization method based on optimization model

Publications (2)

Publication Number Publication Date
CN110310250A CN110310250A (en) 2019-10-08
CN110310250B true CN110310250B (en) 2022-11-01

Family

ID=68076876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910569031.1A Active CN110310250B (en) 2019-06-27 2019-06-27 Global histogram equalization method based on optimization model

Country Status (1)

Country Link
CN (1) CN110310250B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111127343B (en) * 2019-12-05 2023-03-24 华侨大学 Histogram double-control infrared image contrast enhancement method
CN111080563B (en) * 2019-12-13 2023-03-14 华侨大学 Histogram equalization method based on traversal optimization
CN111161165B (en) * 2019-12-13 2023-03-14 华侨大学 Image contrast enhancement method based on traversal optimization

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150002013A (en) * 2013-06-28 2015-01-07 전남대학교산학협력단 Histogram equalization apparatus using visual threshold
CN107133958A (en) * 2017-04-26 2017-09-05 北方工业大学 Optical remote sensing ship slice segmentation method based on block particle size pre-judging balance histogram
CN109003241A (en) * 2018-07-17 2018-12-14 华侨大学 A kind of linear image Enhancement Method with dual control function
CN109472759A (en) * 2018-11-23 2019-03-15 中国科学院长春光学精密机械与物理研究所 A kind of method, apparatus of adaptive image enhancement, equipment and storage medium
CN109801246A (en) * 2019-01-10 2019-05-24 华侨大学 A kind of color histogram equalization methods of adaptive threshold

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150002013A (en) * 2013-06-28 2015-01-07 전남대학교산학협력단 Histogram equalization apparatus using visual threshold
CN107133958A (en) * 2017-04-26 2017-09-05 北方工业大学 Optical remote sensing ship slice segmentation method based on block particle size pre-judging balance histogram
CN109003241A (en) * 2018-07-17 2018-12-14 华侨大学 A kind of linear image Enhancement Method with dual control function
CN109472759A (en) * 2018-11-23 2019-03-15 中国科学院长春光学精密机械与物理研究所 A kind of method, apparatus of adaptive image enhancement, equipment and storage medium
CN109801246A (en) * 2019-01-10 2019-05-24 华侨大学 A kind of color histogram equalization methods of adaptive threshold

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
Histogram Specification: A Fast and Flexible Method to Process Digital Images;Gabriel Thomas 等;《IEEE Transactions on Instrumentation and Measurement》;20110328;第60卷(第5期);第1565-1578页 *
双阈值映射自适应红外图像处理算法;王巍 等;《红外与激光工程》;20101231;第39卷(第06期);第1184-1187页 *
基于最大熵模型的双直方图均衡算法;戴声奎 等;《电子学报》;20190331;第47卷(第3期);第678-685页 *
基于直方图优化的遥感图像对比度增强算法;庄玉林;《计算机工程》;20160531;第42卷(第05期);第235-238页 *
直方图均衡化图像增强算法的改进及其 OpenCL 并行实现;黄丛珊;《中国优秀硕士学位论文全文数据库 信息科技辑》;20150315(第3期);第1-53页 *
结合直方图紧凑均衡的图像增强算法;邸男 等;《计算机技术与发展》;20131231;第23卷(第12期);第34-36页 *

Also Published As

Publication number Publication date
CN110310250A (en) 2019-10-08

Similar Documents

Publication Publication Date Title
CN110310250B (en) Global histogram equalization method based on optimization model
CN109410126B (en) Tone mapping method of high dynamic range image with detail enhancement and brightness self-adaption
JP7175197B2 (en) Image processing method and device, storage medium, computer device
CN111105371B (en) Enhancement method of low-contrast infrared image
KR100694153B1 (en) Method and Apparatus for Image Processing based on a Mapping Function
CN114092361B (en) Image local contrast enhancement method for optimizing CLAHE
CN112053309A (en) Image enhancement method and image enhancement device
Yap et al. A recursive soft-decision approach to blind image deconvolution
CN115965544A (en) Image enhancement method and system for self-adaptive brightness adjustment
CN115984570A (en) Video denoising method and device, storage medium and electronic device
CN109308709B (en) Vibe moving target detection algorithm based on image segmentation
CN109801246B (en) Global histogram equalization method for adaptive threshold
CN108305234B (en) Double-histogram equalization method based on optimization model
CN114283076B (en) Image processing method based on transmissivity and CLAHE algorithm
CN108765304B (en) High-dynamic infrared image enhancement method based on adaptive gradient gain control
Lakshmanan et al. Automatic contrast enhancement for low contrast images: A comparison of recent histogram based techniques
CN107404600B (en) Image processing apparatus and method
CN115619800A (en) COVID-19CT image segmentation method and device based on adaptive threshold segmentation
CN114565543A (en) Video color enhancement method and system based on UV histogram features
CN111161165B (en) Image contrast enhancement method based on traversal optimization
KR100900678B1 (en) Image quality enhancement method using dynamic range segmentation
CN111630558B (en) Image processing and matching method, device and storage medium
CN112348760A (en) Image processing method and system
Ghous et al. Efficient image enhancement using improved RIQMC based ROHIM model
Chang et al. Perceptual contrast enhancement of dark images based on textural coefficients

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