Content deleted Content added
Tag: Reverted |
review: you don't want to use that first option. consistent terminology. |
||
(47 intermediate revisions by 20 users not shown) | |||
Line 3:
{{Use American English|date=March 2021}}
{{Use mdy dates|date=March 2021}}
[[Image:Histogrammeinebnung.png|thumb|right|300px|alt=A histogram which is zero apart from a central area containing strong peaks is transformed by stretching the peaked area to fill the entire x-axis.|Histograms of an image before and after equalization.]]▼
'''Histogram equalization''' is a method in [[image processing]] of [[contrast (vision)|contrast]] adjustment using the
Histogram equalization is a specific case of the more general class of histogram remapping methods.
▲[[Image:Histogrammeinebnung.png|thumb|right|300px|alt=A histogram which is zero apart from a central area containing strong peaks is transformed by stretching the peaked area to fill the entire x-axis.|Histograms of an image before and after equalization.]]
==Overview==
This method usually increases the global
The method is useful in images with backgrounds and foregrounds that are both bright or both dark. In particular, the method can lead to better views of [[bone]] structure in [[x-ray]] images
Histogram equalization often produces unrealistic effects in photographs; however it is very useful for scientific images like [[Thermography|thermal]], [[satellite]] or [[x-ray]] images, often the same class of images to which one would apply [[false-color]]. Also histogram equalization can produce undesirable effects (like visible [[image gradient]]) when applied to images with low [[color depth]]. For example, if applied to 8-bit image displayed with [[List of 8-bit computer hardware palettes|8-bit gray-scale palette]] it will further reduce [[color depth]] (number of unique shades of gray) of the image. Histogram equalization will work the best when applied to images with much higher [[color depth]] than [[Palette (computing)|palette]] size, like [[Continuous function|continuous]] data or 16-bit gray-scale images.
There are two ways to think about and implement histogram equalization, either as image change or as [[Palette (computing)|palette]] change. The operation can be expressed as
Modifications of this method use multiple histograms, called subhistograms, to emphasize local contrast
A signal transform equivalent to histogram equalization also seems to happen in [[biological neural networks]] so as to maximize the output firing rate of the neuron as a function of the input statistics. This has been proved in particular in the [[fly]] [[retina]].<ref>{{cite journal|last=Laughlin|first=S.B|year=1981|title=A simple coding procedure enhances a neuron's information capacity|journal=Z. Naturforsch.|volume=9–10(36):910–2}}</ref>
▲Histogram equalization is a specific case of the more general class of histogram remapping methods. These methods seek to adjust the image to make it easier to analyze or improve visual quality (e.g., [[retinex]])
===Back projection===
The
For each group of pixels taken from the same position from all input single-channel images, the function puts the histogram bin value to the destination image, where the coordinates of the bin are determined by the values of pixels in this input group. In terms of statistics, the value of each output image pixel characterizes the probability that the corresponding input pixel group belongs to the object whose histogram is used.<ref>{{cite
==Implementation==
Consider a discrete [[
:<math>\
<math>
Let us
:<math>\operatorname{cdf}
which is also the image's accumulated normalized histogram.
We would like to create a transformation
:<math>\operatorname{cdf}
for some constant
:<math>\
where <math>\ i </math> is in the range <math> [0,L-1] </math>. Notice that <math>\ T </math> maps the levels into the range <math>[0,1]</math>, since we used a normalized histogram of
:<math>\ k^\prime = k \cdot(\max(i) - \min(i)) + \min(i)= k \cdot(L- 1)</math><ref>{{web archive |url=https://web.archive.org/web/20200601000000*/https://www.math.uci.edu/icamp/courses/math77c/demos/hist_eq.pdf |title=University of California, Irvine Math 77C - Histogram Equalization}}</ref>
▲Notice that <math>\ T </math> maps the levels into the range [0,1], since we used a normalized histogram of {''x''}. In order to map the values back into their original range, the following simple transformation needs to be applied on the result:
:<math>\ y^\prime = y \cdot(\max\{x\} - \min\{x\}) + \min\{x\}= y \cdot(L- 1)</math>.▼
<math>\ y </math> is a real value while <math>\ y^\prime </math> has to be an integer. An intuitive and popular method<ref>{{Cite book|last=Gonzalez|first=Rafael C.|url=https://www.worldcat.org/oclc/991765590|title=Digital image processing|date=2018|publisher=Pearson|others=Richard E. Woods|isbn=978-1-292-22304-9|edition=4th|___location=New York, NY|pages=138–140|oclc=991765590}}</ref> is applying the round operation:▼
:<math>\ y^\prime = \operatorname{round} (y \cdot(L- 1))</math>.▼
However, detailed analysis results in slightly different formulation. The mapped value <math>\ y^\prime </math> should be 0 for the range of <math>0<y \leq1/L</math>. And <math>\ y^\prime =1</math> for <math>1/L < y \leq 2/L</math>, <math>\ y^\prime = 2 </math> for <math>2/L < y \leq 3/L</math>, ...., and finally <math>\ y^\prime =L-1</math> for <math>(L-1)/L < y \leq 1</math>. Then the quantization formula from <math>\ y</math> to <math>\ y^\prime </math> should be▼
▲<math>
▲:<math>\
▲However, detailed analysis results in slightly different formulation. The mapped value <math>
(Note: <math>y^\prime=-1 </math> when <math>\ y=0 </math> , however, it does not happen just because <math>\ y=0 </math> means that there is no pixel corresponding to that value.)▼
▲(Note: <math>
== Of color images ==▼
The above
There are several histogram equalization methods in 3D space. Trahanias and Venetsanopoulos applied histogram equalization in 3D color space<ref>P. E. Trahanias and A. N. Venetsanopoulos, "[http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=202045 Color image enhancement through 3-D histogram equalization]," in Proc. 15th IAPR Int. Conf. Pattern Recognition, vol. 1, pp. 545–548, Aug.-Sep. 1992.</ref> However, it results in "whitening" where the probability of bright pixels are higher than that of dark ones.<ref>N. Bassiou and C. Kotropoulos, "[http://www.sciencedirect.com/science/article/pii/S1077314206002141 Color image histogram equalization by absolute discounting back-off]," Computer Vision and Image Understanding, vol. 107, no. 1-2, pp.108-122, Jul.-Aug. 2007</ref> Han et al. proposed to use a new cdf defined by the iso-luminance plane, which results in uniform gray distribution.<ref>{{Cite journal|doi = 10.1109/TIP.2010.2068555|title = A Novel 3-D Color Histogram Equalization Method with Uniform 1-D Gray Scale Histogram|year = 2011|last1 = Han|first1 = Ji-Hee|last2 = Yang|first2 = Sejung|last3 = Lee|first3 = Byung-Uk|journal = IEEE Transactions on Image Processing|volume = 20|issue = 2|pages = 506–512|pmid = 20801744| bibcode=2011ITIP...20..506H |s2cid = 17972519}}</ref>▼
▲There are several histogram equalization methods in 3D
==Examples==
For consistency with [[
===Small image===
Line 145 ⟶ 138:
|}
The histogram for this image is shown in the following table.
▲The histogram for this image is shown in the following table. Pixel values that have a zero count are excluded for the sake of brevity.
:{| class="wikitable"
|-
Line 202 ⟶ 194:
|}
The [[cumulative distribution function]] (
:{| class="wikitable"
|-
! <math>v</math>, Pixel Intensity !!
|-
| 52||1||0
Line 280 ⟶ 272:
|-
| 154||64||255
|} (Please note that <math>h(v)=\operatorname{ceil}(\operatorname{
This
:<math>
Line 288 ⟶ 280:
\mathrm{round}
\left(
\frac {\operatorname{
\times (L - 1)
\right)
</math>
where
''Note that to scale values in the original data that are above 0 to the range 1 to'' <math>L-1</math>'', inclusive, the above equation would instead be:''▼
▲''Note that to scale values in the original data that are above 0 to the range 1 to L-1, inclusive, the above equation would instead be:''
:<math>
Line 302 ⟶ 293:
\mathrm{round}
\left(
\frac {\operatorname{
\times (L - 2)
\right) + 1
</math>
''where cdf(v) > 0. Scaling from 1 to 255 preserves the non-zero-ness of the minimum value.''
The equalization formula for the example scaling data from 0 to 255, inclusive, is:
Line 320 ⟶ 310:
</math>
For example, the
:<math>
Line 339 ⟶ 329:
</math>
Once this is done then the values of the equalized image are directly taken from the normalized
{| class="wikitable"
Line 415 ⟶ 405:
|}
Notice that the minimum value
:{|
Line 449 ⟶ 439:
* [[Adaptive histogram equalization]]
* [[Normalization (image processing)]]
* [[Digital image processing]]
* [[Image segmentation]]
==
{{reflist}}
{{refbegin}}
*Acharya and Ray, ''Image Processing: Principles and Applications'', Wiley-Interscience 2005 {{ISBN|0-471-71998-6}}
*Russ, ''The Image Processing Handbook: Fourth Edition'', CRC 2002 {{ISBN|0-8493-2532-3}}
* [http://www.generation5.org/content/2004/histogramEqualization.asp "Histogram Equalization" at Generation5] ''([https://archive.today/20160516012012/http://www.generation5.org/content/2004/histogramEqualization.asp archive])''
{{refend}}
[[Category:Image processing]]
|