Вы находитесь на странице: 1из 6

Histogram Specification/Matching 2010

Submission for Tutorial

Histogram Specification
Histogram is a graphical representation, showing visual representation of
distributed data. It estimates the probability distribution of a continuous variable
and the term was coined by Karl Pearson.

A histogram consists of the tabular frequencies plotted on a graph; the total area
is equal to the number of data. Normalized histogram is represented by showing
the related frequencies. Histograms are used to plot the density of the data,
estimating the “probability density function”. The total area of a histogram used
for probability density is always normalized to 1.

Example:

Submitted By Abhishek Kumar B.Tech. VII sem CSE (0702910005) Page 1


Histogram Specification/Matching 2010
Submission for Tutorial
Histogram specification is a technique that transforms histogram of one image
into the histogram of another image. This transformation can be easily
accomplished by recognizing that if instead of using an equally-spaced ideal
histogram. In this way it is possible to impose an arbitrary histogram on any
image, subject to the constraint that single bins may not be split up.

In order to implement Histogram Specification/matching we need to understand


the concept of Histogram equalization.

Histogram Equalization: In histogram equalization we are trying to maximize the


image contrast by applying a gray level transform which tries to flatten the
resulting histogram. The gray level transform is a scaled version of the original
image's cumulative histogram. That is, the gray-level transform T is given by

T[i] = (G-1).c(i)

Where, G is the number of gray levels and c(i) is the normalized cumulative
histogram of the original image.

The method usually increases the global contrast of the images, especially when
the usable data of the image is represented by close contrast values. Histogram
equalization accomplishes spreading out the most frequent intensity values. This
method is usually useful with the images with backgrounds and foregrounds that
are both bright or both dark. This method can lead to better view of bone
structures in x-ray images, and to better detail in photographs that are over or
under-exposed. The best feature of Histogram Equalization is that it can be
reversed back to original Histogram.

Implementation of Histogram Equalization:

Consider a discrete grayscale image, and let ni be the number of occurrences of


gray level i. The probability of an occurrence of a pixel of level i in the image is

L is the total number of gray levels in the image, n being the total number of
pixels in the image, and p being in fact the image's histogram, normalized to [0,1].

Submitted By Abhishek Kumar B.Tech. VII sem CSE (0702910005) Page 2


Histogram Specification/Matching 2010
Submission for Tutorial
Let us also define c as the cumulative distribution function corresponding to p,
defined by:

known as the image's accumulated normalized histogram.


The discrete version of transformation function is,

Thus, a processed (output) image is obtained by mapping each pixel with level
rk in the input image into a corresponding pixel with level sk in the output image.
The transformation (mapping) given is called Histogram Equalization.

Example:

Original image and Histogram,

Submitted By Abhishek Kumar B.Tech. VII sem CSE (0702910005) Page 3


Histogram Specification/Matching 2010
Submission for Tutorial
Equalized Histogram and Image,

Histogram Specification/Matching:
Histogram matching is a method in image processing of color adjustment of two
images using the image histograms.

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.

It is useful sometimes to be able to specify the shape of the histogram that we


wish the processed image to have. The method used to generate a processed
image that has a specified histogram is called histogram matching or histogram
specification.

The technique can be implemented (theoretical approach) in the following steps:

1. Provide the template histogram. This can be accomplished by specifying a


particular histogram shape, or by calculating the histogram of a target
image.
2. Calculate the histogram of the image to be transformed.

Submitted By Abhishek Kumar B.Tech. VII sem CSE (0702910005) Page 4


Histogram Specification/Matching 2010
Submission for Tutorial
3. Calculate the cumulative sum of the template histogram. This is the idea
cumulative sum (not the linear line as in histogram equalization).
4. Calculate the cumulative sum of the histogram of the image to be changed.
5. Map pixels from one bin to another according to the rules of histogram
equalization. The primary rule is that the actual cumulative sum can be no
less than the ideal (template) cumulative sum.

Implementation (calculative approach):

1. Obtain the Histogram of the given image.


2. Use the equation

to precompute a mapped level sk for each level rk.


3. Obtain the transformation function G from the given pz(z) using

4. Precompute zk for each value of sk using the iterative scheme defined in


connection with equation

5. For each pixel in the original image, if the value of that pixel is rk, map this
value to its corresponding level sk; then map level sk into the final level zk.
Use the precomputed values from Steps (2) and (4) for these mappings.

Submitted By Abhishek Kumar B.Tech. VII sem CSE (0702910005) Page 5


Histogram Specification/Matching 2010
Submission for Tutorial

Example:

Histogram specification always imposes a template histogram on an image, but


the technique works best if the template histogram is already similar to the
actual one. For example, in situations where a large number of images of the
same kind are being processed, it may be advantageous to make the
histograms the same. In this way, the same set of image operations would
have the same results. This is almost always the case when processing images
from modern medical devices such as CT, MR, PET, or multi- dimensional
ultrasound.

Submitted By Abhishek Kumar B.Tech. VII sem CSE (0702910005) Page 6

Вам также может понравиться