0% found this document useful (0 votes)
46 views27 pages

L15 - HISTOGRAM PROCESSING - I - New

The document discusses histogram processing techniques for image enhancement. It describes how a histogram represents the distribution of pixel intensities in an image. Histogram equalization stretches the dynamic range of intensities by redistributing pixel values uniformly. Local histogram equalization applies this locally within a neighborhood to enhance details. Histogram matching maps an image to have a specified target histogram distribution.

Uploaded by

ramadevi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views27 pages

L15 - HISTOGRAM PROCESSING - I - New

The document discusses histogram processing techniques for image enhancement. It describes how a histogram represents the distribution of pixel intensities in an image. Histogram equalization stretches the dynamic range of intensities by redistributing pixel values uniformly. Local histogram equalization applies this locally within a neighborhood to enhance details. Histogram matching maps an image to have a specified target histogram distribution.

Uploaded by

ramadevi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 27

HISTOGRAM PROCESSING

Histogram of an Image
 The histogram of a digital image with gray levels in the range
[0, L-1] is a discrete function h(rk) = nk, where rk is the kth gray
level and nk is the number of pixels in the image having gray
level rk. Or 255
 h(r )  Total Number of
k 0
k pixel in the image.

 We can also define a normalized histogram by dividing each


of its values by the total number of pixels in the image. Thus
we can directly approximate it as the probability density
function of an image.
 A normalized histogram is defined as
 p(rk) = nk/NM k = 0,1,……L-1
 p(rk) = nk/N2 for an NxN image
Histogram - Example
Histogram - Example
 Histogram of high
contrast image cover a
broad range of the gray
scale and the distribution
of pixels will be almost
uniform.
 This gives an image an
appearance of high
contrast with a great deal
of gray level detail and
high dynamic range.
 Thus the plot of
histogram of an image
provides a global
description of the
appearance of an image.
Histogram equalization
 It is a transformation that stretches the contrast by
redistributing the gray-level values uniformly.
 To find the transformation:
 Let the variable r represents the normalized gray levels in
the image, where 0 < r < 1.
 We apply the transformation function,
r
s  T (r )   pr ( w) dw 0  r 1
0
 If pr(r) and ps(s) are the pdf’s of r and s,
 Pr(r, r+dr) ≈ pr(r) dr and Ps(s, s+ds) ≈ ps(s) ds.
Histogram equalization Cont..
Histogram equalization
Discrete Case
 For the discrete case the probability of occurrence
of gray level rk in the image can be approximated
by
 Pr(rk) = nk/n. k = 0,1,2,……L-1.
 The discrete version of the transformation
function is given by
k k n
sk  T (rk )   pr (rj )  
j
k  0,1,......., L  1
j 0 j 0 n
Histogram equalization - Advantages
 The method of histogram equalization is fully
automatic compared to other contrast stretching
techniques.
 The process consists of simply calculating the
cumulative distribution of the gray levels in an
image and that can be directly extracted from the
image, without the need for further parameter
specification.
 Simplicity of computation.
Transformation Functions
Histogram Matching / Specification
 This is the method used to generate a processed
image which has a specified histogram.
 Formulation:
 Let pz(z) be the desired probability density function and
pr(r) the original probability density function.
 Suppose histogram equalization is applied to both r and
z to get the transformations
r
s  T (r )   pr ( w) dw 0  r 1
0
z
v  G ( z )   p z ( w) dw 0  z 1
0
Histogram Matching / Specification
 Ps(s) and pv(v) are both uniform densities and they
can be considered as identical.
 So z can be obtained as G-1(s) = G-1(T(r)).
 For the discrete case;
k k nj
sk  T (rk )   pr (rj )   k  0,1,......., L  1
j 0 j 0 n
k
vk  G ( zk )   p z ( zi )  sk k  0,1,......., L  1
i 0

 So zk = G-1[T(rk)] = G-1(sk)
Histogram Matching - Implementation
 1. Obtain the histogram of the given image
k
 2.Compute T (rk )   pr (r j ) k  0,1,......., L  1
j 0
k
 3.Compute G ( z k )   p z ( zi ) k  0,1,......., L  1
i 0

 Compute zk = z’ for each value of k or sk where z’ is the


smallest integer in the interval [0,L-1] such that
(G(z’) – sk) ≥ 0 k = 0,1,2,……L-1.
 For each pixel in the original image, if the value of the pixel
is rk, map this value to its corresponding level sk, then map
level sk into the final level zk.
Histogram Matching & Equalization
Comparison
Histogram Matching & Equalization
Comparison
Histogram Matching & Equalization
Comparison
Example
Local Enhancement
 To enhance details over small areas in the
image.

 The number of pixels in these areas may


have negligible influence on the
computation of a global transformation.
Local histogram processing
 Define a square or rectangular neighborhood and
move the centre of this area from pixel to pixel.

 At each location the histogram of the points in the


neighborhood is computed and either histogram
equalization or specification transformation function
is obtained.

 This function is used to map the gray level of the


pixel centered in the neighborhood
Example
Histogram Statistics for Image
Enhancement
 Use the statistical parameters obtainable
from the histogram.
 r - input gray levels [0,L-1]
 p(rk) – probability of occurrence of gray level rk.

 The nth moment of r about its mean is


defined as L 1 n

 n (r )    rk  m  p (rk )
k 0
Histogram Statistics
 m is the mean value of r
L 1
m   rk p (rk )
k 0

 The second moment is given by


L 1
 2 (r )   (rk  m) 2 p(rk )
k 0
Local Enhancement: Example
Local Enhancement: Example
Local Enhancement: Example

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy