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

HISTOGRAM PROCESSING

Introduction
The histogram of an image is a plot of the number of occurrences of gray levels in the image against the gray level values.

The histogram provides a convenient summary of the intensities in an image, but it is unable to convey any information regarding spatial relationships between pixels.

The histogram of a dark image will be clustered towards the lower gray level. The histogram of a bright image will be clustered towards higher gray level. For a low-contrast image, the histogram will not spread equally, that is the histogram will be narrow.
For a high-contrast image, the histogram will have an equal spread in the gray level.

Histogram processing a powerfull tool!


p(k ) nk / n

A Histogram is a discrete function. nk is the number of pixels with the k-th gray level. n is the total number of pixels. Histogram entry p(k ) gives the probability of gray value k of appearing in the image.

First Method X-axis has gray levels & Y-axis has No. of pixels in each gray levels.

Second Method:
X-axis has gray levels & Y-axis has probability of occurrence of gray levels.

P(k) = nk/ n; where, k gray level nkno. of pixels in kth gray level n total number of pixels in an image

Histogram Types

Dark Image

Bright Image

Histogram Types

Low Contrast

High Contrast

Histogram processing
Different types of mapping linear

Histogram processing
Non-linear, e.g., Logarithmic Arbitrary

Improving contrast
Humans cannot tell the difference between grey level values too close to each other. So: spread out the grey level values. This is called histogram stretching.

Histogram stretching
Algorithm
Find maximum:
max=0; //Check each pixel: if f(x,y)>max max=f(x,y);

Find minimum Shift values so that minimum is 0:

//For each pixel: g(x,y)=f(x,y)-min;

Scale values so that maximum is 255 and write into output image g(x,y):
c=255/(max-min); //For each pixel: g(x,y)=round(g(x,y)*c);

Thank you

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