Histogram Specification
   HOME

TheInfoList



OR:

In
image processing An image or picture is a visual representation. An image can be two-dimensional, such as a drawing, painting, or photograph, or three-dimensional, such as a carving or sculpture. Images may be displayed through other media, including a pr ...
, histogram matching or histogram specification is the transformation of an image so that its
histogram A histogram is a visual representation of the frequency distribution, distribution of quantitative data. To construct a histogram, the first step is to Data binning, "bin" (or "bucket") the range of values— divide the entire range of values in ...
matches a specified histogram. The well-known
histogram equalization Histogram equalization is a method in image processing of contrast adjustment using the image's histogram. Histogram equalization is a specific case of the more general class of histogram remapping methods. These methods seek to adjust the ...
method is a special case in which the specified histogram is uniformly distributed. It is possible to use histogram matching to balance detector responses as a relative detector calibration technique. It can be used to normalize two images, when the images were acquired at the same local illumination (such as shadows) over the same location, but by different sensors, atmospheric conditions or global illumination.


Implementation

Consider a
grayscale In digital photography, computer-generated imagery, and colorimetry, a greyscale (more common in Commonwealth English) or grayscale (more common in American English) image is one in which the value of each pixel is a single sample (signal), s ...
input image X. It has a probability density function pr(r), where r is a grayscale value, and pr(r) is the probability of that value. This probability can easily be computed from the histogram of the image by p_r (r_j )= Where nj is the frequency of the grayscale value rj, and n is the total number of pixels in the image. Now consider a desired output probability density function pz(z). A transformation of pr(r) is needed to convert it to pz(z). Each pdf (probability density function) can easily be mapped to its cumulative distribution function by : S(r_k )= \sum_^k p_r(r_j),\qquad k = 0,1,2,3,\ldots,L-1 : G(z_k )= \sum_^k p_z(z_j),\qquad k = 0,1,2,3,\ldots,L-1 Where L is the total number of gray level (256 for a standard image). The idea is to map each r value in X to the z value that has the same probability in the desired
pdf Portable document format (PDF), standardized as ISO 32000, is a file format developed by Adobe Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
. I.e. ''S''(''r''''j'') = ''G''(''z''''i'') or ''z'' = ''G''−1(''S''(''r'')).


Example

The following input grayscale image is to be changed to match the reference histogram. The input image has the following histogram It will be matched to this reference histogram to emphasize the lower gray levels. After matching, the output image has the following histogramAnd looks like this


Algorithm

Given two images, the reference and the target images, we compute their histograms. Following, we calculate the
cumulative distribution function In probability theory and statistics, the cumulative distribution function (CDF) of a real-valued random variable X, or just distribution function of X, evaluated at x, is the probability that X will take a value less than or equal to x. Ever ...
s of the two images' histograms – F_1()\, for the reference image and F_2()\, for the target image. Then for each gray level G_1\in
,255 The comma is a punctuation mark that appears in several variants in different languages. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
/math>, we find the gray level G_2\, for which F_1(G_1)=F_2(G_2)\,, and this is the result of histogram matching function: M(G_1)=G_2\,. Finally, we apply the function M() on each pixel of the reference image.


Exact histogram matching

In typical real-world applications, with 8-bit pixel values (discrete values in range , 255, histogram matching can only approximate the specified histogram. All pixels of a particular value in the original image must be transformed to just one value in the output image. Exact histogram matching is the problem of finding a transformation for a discrete image so that its histogram ''exactly'' matches the specified histogram. Several techniques have been proposed for this. One simplistic approach converts the discrete-valued image into a continuous-valued image and adds small random values to each pixel so their values can be ranked without ties. However, this introduces noise to the output image. Because of this there may be holes or open spots in the output matched histogram.


Multiple histogram matching

The histogram matching algorithm can be extended to find a monotonic mapping between two sets of histograms. Given two sets of histograms P=\_^k and Q = \_^k , the optimal monotonic color mapping M is calculated to minimize the distance between the two sets simultaneously, namely \operatorname_M \sum_k d(M(p_k),q_k) where d(\cdot,\cdot) is a distance metric between two histograms. The optimal solution is calculated using dynamic programming.


See also

*
Histogram equalization Histogram equalization is a method in image processing of contrast adjustment using the image's histogram. Histogram equalization is a specific case of the more general class of histogram remapping methods. These methods seek to adjust the ...
*
Image histogram An image histogram is a type of histogram that acts as a graphical representation of the Lightness (color), tonal distribution in a digital image. It plots the number of pixels for each tonal value. By looking at the histogram for a specific ima ...
*
Color mapping Image color transfer is a function that maps (transforms) the colors of one (source) image to the colors of another (target) image. A color mapping may be referred to as the algorithm that results in the mapping function or the algorithm that tr ...


References

{{reflist, refs= {{cite conference , author1=Shapira D. , author2=Avidan S. , author3=Hel-Or Y. , year = 2013 , title = Multiple Histogram Matching , book-title = Proceedings of the IEEE International Conference on Image Processing , url = http://www.faculty.idc.ac.il/toky/Publications/Conference/hist_icip_13.pdf Image processing