Histogram Processing : 1
HistogramsHistograms
Histogram
Discrete function h(rk) showing the number of occurrences nk for
the kth
gray level rk
Normalized Histogram
Gives estimate of probability of occurrence of gray level rk
(probability distribution function)
( )k kh r n=
1
0
( ) / , ( ) 1
L
k k kp r n n p r
−
= =∑
Histogram Processing : 2
Histograms: ExampleHistograms: Example
Histogram Processing : 3
Histogram EqualizationHistogram Equalization
High-contrast images are often desirable from a visual perspective
High-contrast images have histograms where the components
cover a wide dynamic range
Distribution of pixels are close to a uniform distribution
Intuitively, low-contrast images can be enhanced by transforming
its pixel distribution into a uniform distribution to achieve high
contrast
Histogram Processing : 4
Histogram EqualizationHistogram Equalization
Let p(r) and p(s) denote the probability density functions of r and s
For s=T(r), p(s) can be expressed as,
Since we want to transform the input image such that the pixel
distribution is uniform,
( ) ( )
dr
p s p r
ds
=
( ) 1 , 0 1p s s= ≤ ≤
Histogram Processing : 5
Histogram EqualizationHistogram Equalization
What transformation will give you a uniform distribution for s?
Cumulative distribution function (CDF)
Why?
0
( ) ( )
r
s T r p w dw= = ∫
0
( )
( )
r
d p w dw
ds
p r
dr dr
 
  = =
∫
1
( ) ( ) 1
( )
p s p r
p r
= =
Histogram Processing : 6
Histogram EqualizationHistogram Equalization
Histogram Processing : 7
Histogram EqualizationHistogram Equalization
For discrete case,
1
0
( ) / , ( ) 1
L
k k k
k
p r n n p r
−
=
= =∑
( ) ( )
k
k k j
j o
s T r p r
=
= = ∑
Histogram Processing : 8
Histogram Equalization: ExampleHistogram Equalization: Example
Histogram Processing : 9
Local Histogram EqualizationLocal Histogram Equalization
Global approach good for overall contrast enhancement
However, there may be cases where it is necessary to enhance
details over small areas in image
Solution: perform histogram equalization over a small neighborhood
Histogram Processing : 10
Local Histogram Equalization:Local Histogram Equalization:
ExampleExample
Histogram Processing : 11
Enhancement Using Arithmetic/LogicEnhancement Using Arithmetic/Logic
OperationsOperations
Performed on a pixel-by-pixel basis between two or more images
( , ) ( , ) ( , )g x y f x y h x y= ⊕
Histogram Processing : 12
Enhancement Using AND Operation:Enhancement Using AND Operation:
ExampleExample
Histogram Processing : 13
Enhancement Using OR Operation:Enhancement Using OR Operation:
ExampleExample
Histogram Processing : 14
Enhancement Using SubtractionEnhancement Using Subtraction
Operation: ExampleOperation: Example
Histogram Processing : 15
Enhancement Using SubtractionEnhancement Using Subtraction
Operation: ExampleOperation: Example
Histogram Processing : 16
Noise reduction by Image AveragingNoise reduction by Image Averaging

05 histogram processing DIP

  • 1.
    Histogram Processing :1 HistogramsHistograms Histogram Discrete function h(rk) showing the number of occurrences nk for the kth gray level rk Normalized Histogram Gives estimate of probability of occurrence of gray level rk (probability distribution function) ( )k kh r n= 1 0 ( ) / , ( ) 1 L k k kp r n n p r − = =∑
  • 2.
    Histogram Processing :2 Histograms: ExampleHistograms: Example
  • 3.
    Histogram Processing :3 Histogram EqualizationHistogram Equalization High-contrast images are often desirable from a visual perspective High-contrast images have histograms where the components cover a wide dynamic range Distribution of pixels are close to a uniform distribution Intuitively, low-contrast images can be enhanced by transforming its pixel distribution into a uniform distribution to achieve high contrast
  • 4.
    Histogram Processing :4 Histogram EqualizationHistogram Equalization Let p(r) and p(s) denote the probability density functions of r and s For s=T(r), p(s) can be expressed as, Since we want to transform the input image such that the pixel distribution is uniform, ( ) ( ) dr p s p r ds = ( ) 1 , 0 1p s s= ≤ ≤
  • 5.
    Histogram Processing :5 Histogram EqualizationHistogram Equalization What transformation will give you a uniform distribution for s? Cumulative distribution function (CDF) Why? 0 ( ) ( ) r s T r p w dw= = ∫ 0 ( ) ( ) r d p w dw ds p r dr dr     = = ∫ 1 ( ) ( ) 1 ( ) p s p r p r = =
  • 6.
    Histogram Processing :6 Histogram EqualizationHistogram Equalization
  • 7.
    Histogram Processing :7 Histogram EqualizationHistogram Equalization For discrete case, 1 0 ( ) / , ( ) 1 L k k k k p r n n p r − = = =∑ ( ) ( ) k k k j j o s T r p r = = = ∑
  • 8.
    Histogram Processing :8 Histogram Equalization: ExampleHistogram Equalization: Example
  • 9.
    Histogram Processing :9 Local Histogram EqualizationLocal Histogram Equalization Global approach good for overall contrast enhancement However, there may be cases where it is necessary to enhance details over small areas in image Solution: perform histogram equalization over a small neighborhood
  • 10.
    Histogram Processing :10 Local Histogram Equalization:Local Histogram Equalization: ExampleExample
  • 11.
    Histogram Processing :11 Enhancement Using Arithmetic/LogicEnhancement Using Arithmetic/Logic OperationsOperations Performed on a pixel-by-pixel basis between two or more images ( , ) ( , ) ( , )g x y f x y h x y= ⊕
  • 12.
    Histogram Processing :12 Enhancement Using AND Operation:Enhancement Using AND Operation: ExampleExample
  • 13.
    Histogram Processing :13 Enhancement Using OR Operation:Enhancement Using OR Operation: ExampleExample
  • 14.
    Histogram Processing :14 Enhancement Using SubtractionEnhancement Using Subtraction Operation: ExampleOperation: Example
  • 15.
    Histogram Processing :15 Enhancement Using SubtractionEnhancement Using Subtraction Operation: ExampleOperation: Example
  • 16.
    Histogram Processing :16 Noise reduction by Image AveragingNoise reduction by Image Averaging