Content deleted Content added
No edit summary |
review: simplify link. format ref. |
||
Line 25:
The ''back projection'' of a histogrammed image is the re-application of the modified histogram to the original image, functioning as a look-up table for pixel brightness values.
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 manual|year=2001|title=Open Source Computer Vision Library Reference Manual|url=http://www.cs.unc.edu/~stc/FAQs/OpenCV/OpenCVReferenceManual.pdf|archive-url=https://web.archive.org/web/20150409155114/http://www.cs.unc.edu/~stc/FAQs/OpenCV/OpenCVReferenceManual.pdf|url-status=dead|archive-date=April 9, 2015|author=Intel Corporation|access-date=2015-01-11}}</ref
==Implementation==
Consider a discrete [[
:<math>\ p_X(i) = \frac{n_i}{n},\quad 0 \le i < L </math>
<math>L</math> being the total number of gray levels in the image
Let us then define the ''[[cumulative distribution function]]'' of pixels in image ''<math>X</math>''. For value ''<math>i</math>'' it is
Line 41:
:<math>\ T(i) = \operatorname{cdf}_X(i)</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>X</math>. In order to map the values back into their original range, the following simple transformation needs to be applied to each transformed image value <math>k</math>:
:<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><!--[[User:Kvng/RTH]]-->
<math>k </math> is a real value while<math>\ k^\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:
|