SlideShare a Scribd company logo
Digital Image
Processing
Contents
Histogram Processing
Histogram Equalization
Histogram Matching
Local Histogram processing
Using histogram statistics for image enhancement
Histograms
Histograms plots show many times (frequency) each
intensity value in image occurs
Example:
Image (left) has 256 distinct gray-levels (8bits)
Histogram (right) shows frequency (how many times)each
gray-level occurs
Histograms
Many cameras display real time histograms of scene
Helps avoid taking over-exposed pictures
Also easier to detect types of processing previously applied
to image
Histograms
E.g. L = 16, 10 pixels have intensity value = 2
Histograms: only statistical information
No indication of location of pixels
Histograms
Draw the histogram of following images. Consider each
image of size 64x64 (2-levels).
Histograms
Different images can have same histogram
3 images below have same histogram
Half of pixels are gray, half are white
Same histogram = same statistics
Distribution of intensities could be different
Can we reconstruct image from histogram?
Histograms
A histogram for a grayscale image with intensity values in
range I(x, y) [0, L—1] would contain exactly L entries
E.g. 8-bit grayscale image, L = 2^8 = 256
Each histogram entry is defined as:
h(i) = number of pixels with intensity i for all 0 <= i< L.
E.g: h(255) = number of pixels with intensity = 255
Image Contrast
The contrast of a grayscale image indicates how easily
objects in the image can be distinguished
High contrast image: many distinct intensity values
Low contrast: image uses few intensity values
Histogram and Image Contrast
Histogram Processing
Uses for Histogram Processing
Image enhancements
Image statistics
Image compression
Image segmentation
Simple to calculate in software
Economic hardware implementations
Popular tool in real-time image processing
A plot of this function for all values of k provides a global
description of the appearance of the image (gives useful
information for contrast enhancement)
Uses for Histogram Processing
Four basic image types and their corresponding
histograms
– Dark
– Light
– Low contrast
– High contrast
Histograms commonly
viewed in plots as
2/16/2018 14
Histogram Equalization
2/16/2018 15
Dynamic Range
2/16/2018 16
• Dynamic Range: Number of distinct pixels in
image
• High dynamic range means very bright and very
dark parts in a single image (many distinct values)
Dynamic Range
2/16/2018 17
Histogram Equalization
2/16/2018 18
The intensity levels in an image may be viewed as
random variables in the interval [0, L-1].
Let ( ) and ( ) denote the probability density
function (PDF) of random variables and .
r sp r p s
r s
2/16/2018 19
Histogram Equalization
( ) 0 1s T r r L   
. T(r) is a strictly monotonically increasing function
in the interval 0 -1;
. 0 ( ) -1 for 0 -1.
a
r L
b T r L r L
 
   
2/16/2018 20
Histogram Equalization
. T(r) is a strictly monotonically increasing function
in the interval 0 -1;
. 0 ( ) -1 for 0 -1.
a
r L
b T r L r L
 
   
( ) 0 1s T r r L   
( ) is continuous and differentiable.T r
( ) ( )s rp s ds p r dr
Histogram Equalization
0
( ) ( 1) ( )
r
rs T r L p w dw   
2/16/2018 21
0
( )
( 1) ( )
r
r
ds dT r d
L p w dw
dr dr dr
   
  
( 1) ( )rL p r 
 
( ) 1( ) ( )
( )
( 1) ( ) 1
r r r
s
r
p r dr p r p r
p s
L p rdsds L
dr
   
  
 
 
2/16/2018 22
Example
2
Suppose that the (continuous) intensity values
in an image have the PDF
2
, for 0 r L-1
( 1)( )
0, otherwise
Find the transformation function for equalizing
the image histogra
r
r
Lp r

 
 


m.
2/16/2018 23
Example
0
( ) ( 1) ( )
r
rs T r L p w dw   
20
2
( 1)
( 1)
r w
L dw
L
 

2
1
r
L


2/16/2018 24
Histogram Equalization
0
Continuous case:
( ) ( 1) ( )
r
rs T r L p w dw   
0
Discrete values:
( ) ( 1) ( )
k
k k r j
j
s T r L p r

   
0 0
1
( 1) k=0,1,..., L-1
k k
j
j
j j
n L
L n
MN MN 

   
2/16/2018 25
Example: Histogram Equalization
Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the
intensity distribution shown in following table.
Get the histogram equalization transformation function and give the ps(sk)
for each sk.
2/16/2018 26
Example: Histogram Equalization
0
0 0
0
( ) 7 ( ) 7 0.19 1.33r j
j
s T r p r

     1
1
1 1
0
( ) 7 ( ) 7 (0.19 0.25) 3.08r j
j
s T r p r

      3
2 3
4 5
6 7
4.55 5 5.67 6
6.23 6 6.65 7
6.86 7 7.00 7
s s
s s
s s
   
   
   
2/16/2018 27
Example: Histogram Equalization
2/16/2018 28
2/16/2018 29
2/16/2018 30
Question
Is histogram equalization always good?
2/16/2018 31
Histogram Matching
Histogram matching (histogram specification)
— generate a processed image that has a specified histogram
Let ( ) and ( ) denote the continous probability
density functions of the variables and . ( ) is the
specified probability density function.
Let be the random variable with the prob
r z
z
p r p z
r z p z
s
0
0
ability
( ) ( 1) ( )
Define a random variable with the probability
( ) ( 1) ( )
r
r
z
z
s T r L p w dw
z
G z L p t dt s
  
  


2/16/2018 32
Histogram Matching
0
0
( ) ( 1) ( )
( ) ( 1) ( )
r
r
z
z
s T r L p w dw
G z L p t dt s
  
  


 1 1
( ) ( )z G s G T r 
 
2/16/2018 33
Histogram Matching: Procedure
• Obtain pr(r) from the input image and then obtain the values of s
• Use the specified PDF and obtain the transformation function G(z)
• Mapping from s to z
0
( 1) ( )
r
rs L p w dw  
0
( ) ( 1) ( )
z
zG z L p t dt s  
1
( )z G s

2/16/2018 34
Histogram Matching: Example
Assuming continuous intensity values, suppose that an image has the
intensity PDF
Find the transformation function that will produce an image whose
intensity PDF is
2
2
, for 0 -1
( 1)( )
0 , otherwise
r
r
r L
Lp r

 
 


2
3
3
, for 0 ( -1)
( ) ( 1)
0, otherwise
z
z
z L
p z L

 
 


Histogram Matching: Example
Find the histogram equalization transformation for the input image
Find the histogram equalization transformation for the specified histogram
The transformation function
20 0
2
( ) ( 1) ( ) ( 1)
( 1)
r r
r
w
s T r L p w dw L dw
L
    
 
2/16/2018 35
2 3
3 20 0
3
( ) ( 1) ( ) ( 1)
( 1) ( 1)
z z
z
t z
G z L p t dt L dt s
L L
     
  
2
1
r
L


1/32
1/3 1/32 2 2
( 1) ( 1) ( 1)
1
r
z L s L L r
L
 
             
2/16/2018 36
Histogram Matching: Discrete Cases
• Obtain pr(rj) from the input image and then obtain the values of sk,
round the value to the integer range [0, L-1].
• Use the specified PDF and obtain the transformation function G(zq),
round the value to the integer range [0, L-1].
• Mapping from sk to zq
0 0
( 1)
( ) ( 1) ( )
k k
k k r j j
j j
L
s T r L p r n
MN 

    
0
( ) ( 1) ( )
q
q z i k
i
G z L p z s

  
1
( )q kz G s

2/16/2018 37
Example: Histogram Matching
Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the
intensity distribution shown in the following table (on the left). Get the
histogram transformation function and make the output image with the
specified histogram, listed in the table on the right.
2/16/2018
Example: Histogram Matching
Obtain the scaled histogram-equalized values,
Compute all the values of the transformation function G,
0 1 2 3 4
5 6 7
1, 3, 5, 6, 7,
7, 7, 7.
s s s s s
s s s
    
  
0
0
0
( ) 7 ( ) 0.00z j
j
G z p z

 
1 2
3 4
5 6
7
( ) 0.00 ( ) 0.00
( ) 1.05 ( ) 2.45
( ) 4.55 ( ) 5.95
( ) 7.00
G z G z
G z G z
G z G z
G z
 
 
 

0
0 0
1 2
65
7
2/16/2018 39
Example: Histogram Matching
2/16/2018 40
Example: Histogram Matching
Obtain the scaled histogram-equalized values,
Compute all the values of the transformation function G,
0 1 2 3 4
5 6 7
1, 3, 5, 6, 7,
7, 7, 7.
s s s s s
s s s
    
  
0
0
0
( ) 7 ( ) 0.00z j
j
G z p z

 
1 2
3 4
5 6
7
( ) 0.00 ( ) 0.00
( ) 1.05 ( ) 2.45
( ) 4.55 ( ) 5.95
( ) 7.00
G z G z
G z G z
G z G z
G z
 
 
 

0
0 0
1 2
65
7
s0
s2 s3
s5 s6 s7
s1
s4
2/16/2018 41
Example: Histogram Matching
0 1 2 3 4
5 6 7
1, 3, 5, 6, 7,
7, 7, 7.
s s s s s
s s s
    
  
0
1
2
3
4
5
6
7
kr
2/16/2018 42
Example: Histogram Matching
0 3
1 4
2 5
3 6
4 7
5 7
6 7
7 7
k qr z








2/16/2018 43
Example: Histogram Matching
2/16/2018 44
Example: Histogram Matching
2/16/2018 45
Example: Histogram Matching
2/16/2018 46
Local Histogram Processing
Define a neighborhood and move its center from pixel to pixel
At each location, the histogram of the points in the neighborhood
is computed. Either histogram equalization or histogram
specification transformation function is obtained
Map the intensity of the pixel centered in the neighborhood
Move to the next location and repeat the procedure
2/16/2018 47
Local Histogram Processing
• The two histogram processing methods discussed:
• Global
• pixels are modified by a transformation
function based on the gray-level content of an
entire image.
• Global approach is suitable for overall enhancement
• there are cases in which it is necessary to
enhance details over small areas in an image
2/16/2018 48
Local Histogram Processing: Example
2/16/2018 49
Using Histogram Statistics for Image
Enhancement
1
0
( )
L
i i
i
m r p r


 
1
0
( ) ( ) ( )
L
n
n i i
i
u r r m p r


 
1
2 2
2
0
( ) ( ) ( )
L
i i
i
u r r m p r


  
1 1
0 0
1
( , )
M N
x y
f x y
MN
 
 
 
 
1 1
2
0 0
1
( , )
M N
x y
f x y m
MN
 
 
 
Average Intensity
Variance
2/16/2018 50
Using Histogram Statistics for Image
Enhancement
1
0
Local average intensity
( )
denotes a neighborhood
xy xy
L
s i s i
i
xy
m r p r
s


 
1
2 2
0
Local variance
( ) ( )xy xy xy
L
s i s s i
i
r m p r


 
2/16/2018 51
Using Histogram Statistics for Image
Enhancement: Example
0 1 2
0 1 2
( , ), if and
( , )
( , ), otherwise
:global mean; :global standard deviation
0.4; 0.02; 0.4; 4
xy xys G G s G
G G
E f x y m k m k k
g x y
f x y
m
k k k E
  

  
 

   
g
Enhancement Using Arithmetic/Logic
Operations
Arithmetic/logic operations involving images
are performed on a pixel-by-pixel basis
between two or more images (this excludes
the logic operation NOT, which is performed
on a single image).
The difference between two images f(x, y) and
h(x, y), expressed as
G(x,y)=f(x,y)-h(x,y)
Basics of Spatial Filtering
The subimage is called a filter, mask,
kernel, template, or window.
The values in a filter subimage are referred to
as coefficients , rather than pixels.
Smoothing spatial filters

More Related Content

What's hot

Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
A B Shinde
 
Log Transformation in Image Processing with Example
Log Transformation in Image Processing with ExampleLog Transformation in Image Processing with Example
Log Transformation in Image Processing with Example
Mustak Ahmmed
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
DEEPASHRI HK
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
Karthika Ramachandran
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesDiwaker Pant
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
A B Shinde
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image Processing
Pallavi Agarwal
 
Noise Models
Noise ModelsNoise Models
Noise Models
Sardar Alam
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
Abinaya B
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
Dr INBAMALAR T M
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
Madhu Bala
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
Md Shabir Alam
 
DIGITAL IMAGE PROCESSING - LECTURE NOTES
DIGITAL IMAGE PROCESSING - LECTURE NOTESDIGITAL IMAGE PROCESSING - LECTURE NOTES
DIGITAL IMAGE PROCESSING - LECTURE NOTES
Ezhilya venkat
 
Histogram Equalization
Histogram EqualizationHistogram Equalization
Histogram Equalization
Kalyan Acharjya
 
Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color Images
Cristina Pérez Benito
 
Image compression standards
Image compression standardsImage compression standards
Image compression standards
kirupasuchi1996
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
kiruthiammu
 
Fundamentals steps in Digital Image processing
Fundamentals steps in Digital Image processingFundamentals steps in Digital Image processing
Fundamentals steps in Digital Image processing
KarthicaMarasamy
 

What's hot (20)

Digital Image Fundamentals
Digital Image FundamentalsDigital Image Fundamentals
Digital Image Fundamentals
 
Log Transformation in Image Processing with Example
Log Transformation in Image Processing with ExampleLog Transformation in Image Processing with Example
Log Transformation in Image Processing with Example
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
Frequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement TechniquesFrequency Domain Image Enhancement Techniques
Frequency Domain Image Enhancement Techniques
 
image compression ppt
image compression pptimage compression ppt
image compression ppt
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Smoothing in Digital Image Processing
Smoothing in Digital Image ProcessingSmoothing in Digital Image Processing
Smoothing in Digital Image Processing
 
Noise Models
Noise ModelsNoise Models
Noise Models
 
Image filtering in Digital image processing
Image filtering in Digital image processingImage filtering in Digital image processing
Image filtering in Digital image processing
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Histogram processing
Histogram processingHistogram processing
Histogram processing
 
DIGITAL IMAGE PROCESSING - LECTURE NOTES
DIGITAL IMAGE PROCESSING - LECTURE NOTESDIGITAL IMAGE PROCESSING - LECTURE NOTES
DIGITAL IMAGE PROCESSING - LECTURE NOTES
 
Histogram Equalization
Histogram EqualizationHistogram Equalization
Histogram Equalization
 
Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color Images
 
Image compression standards
Image compression standardsImage compression standards
Image compression standards
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
 
Fundamentals steps in Digital Image processing
Fundamentals steps in Digital Image processingFundamentals steps in Digital Image processing
Fundamentals steps in Digital Image processing
 

Similar to Histogram Processing

Lect02.ppt
Lect02.pptLect02.ppt
Lect02.ppt
RaniaAzad
 
G Intensity transformation and spatial filtering(1).ppt
G Intensity transformation and spatial filtering(1).pptG Intensity transformation and spatial filtering(1).ppt
G Intensity transformation and spatial filtering(1).ppt
deekshithadasari26
 
annotated-chap-3-gw.ppt
annotated-chap-3-gw.pptannotated-chap-3-gw.ppt
annotated-chap-3-gw.ppt
TharshninipriyaRajas
 
Computer vision 3 4
Computer vision 3 4Computer vision 3 4
Computer vision 3 4
sachinmore76
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdf
nagwaAboElenein
 
chap3.ppt
chap3.pptchap3.ppt
chap3.ppt
AhmedAlAfandi5
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portion
Moe Moe Myint
 
lec3.ppt
lec3.pptlec3.ppt
chap3.ppt
chap3.pptchap3.ppt
Histogram based enhancement
Histogram based enhancementHistogram based enhancement
Histogram based enhancement
liba manopriya.J
 
Histogram based Enhancement
Histogram based Enhancement Histogram based Enhancement
Histogram based Enhancement
Vivek V
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
SKILL2021
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
AkashVerma916093
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
nishashreyan1
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
aravindangc
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
BHAGYAPRASADBUGGE
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformationsYahya Alkhaldi
 
Dip3
Dip3Dip3
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
ssuser0bf6a8
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
AAKANKSHA JAIN
 

Similar to Histogram Processing (20)

Lect02.ppt
Lect02.pptLect02.ppt
Lect02.ppt
 
G Intensity transformation and spatial filtering(1).ppt
G Intensity transformation and spatial filtering(1).pptG Intensity transformation and spatial filtering(1).ppt
G Intensity transformation and spatial filtering(1).ppt
 
annotated-chap-3-gw.ppt
annotated-chap-3-gw.pptannotated-chap-3-gw.ppt
annotated-chap-3-gw.ppt
 
Computer vision 3 4
Computer vision 3 4Computer vision 3 4
Computer vision 3 4
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdf
 
chap3.ppt
chap3.pptchap3.ppt
chap3.ppt
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portion
 
lec3.ppt
lec3.pptlec3.ppt
lec3.ppt
 
chap3.ppt
chap3.pptchap3.ppt
chap3.ppt
 
Histogram based enhancement
Histogram based enhancementHistogram based enhancement
Histogram based enhancement
 
Histogram based Enhancement
Histogram based Enhancement Histogram based Enhancement
Histogram based Enhancement
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
ModuleII.ppt
ModuleII.pptModuleII.ppt
ModuleII.ppt
 
Computer Graphics Unit 1
Computer Graphics Unit 1Computer Graphics Unit 1
Computer Graphics Unit 1
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformations
 
Dip3
Dip3Dip3
Dip3
 
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 

More from Amnaakhaan

Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
Amnaakhaan
 
Intensity Transformation
Intensity TransformationIntensity Transformation
Intensity Transformation
Amnaakhaan
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
Amnaakhaan
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
Amnaakhaan
 
Image Restoration And Reconstruction
Image Restoration And ReconstructionImage Restoration And Reconstruction
Image Restoration And Reconstruction
Amnaakhaan
 
Watershed
WatershedWatershed
Watershed
Amnaakhaan
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
Amnaakhaan
 

More from Amnaakhaan (7)

Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
 
Intensity Transformation
Intensity TransformationIntensity Transformation
Intensity Transformation
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
 
Adaptive Median Filters
Adaptive Median FiltersAdaptive Median Filters
Adaptive Median Filters
 
Image Restoration And Reconstruction
Image Restoration And ReconstructionImage Restoration And Reconstruction
Image Restoration And Reconstruction
 
Watershed
WatershedWatershed
Watershed
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 

Recently uploaded

power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 

Histogram Processing

  • 2. Contents Histogram Processing Histogram Equalization Histogram Matching Local Histogram processing Using histogram statistics for image enhancement
  • 3. Histograms Histograms plots show many times (frequency) each intensity value in image occurs Example: Image (left) has 256 distinct gray-levels (8bits) Histogram (right) shows frequency (how many times)each gray-level occurs
  • 4. Histograms Many cameras display real time histograms of scene Helps avoid taking over-exposed pictures Also easier to detect types of processing previously applied to image
  • 5. Histograms E.g. L = 16, 10 pixels have intensity value = 2 Histograms: only statistical information No indication of location of pixels
  • 6. Histograms Draw the histogram of following images. Consider each image of size 64x64 (2-levels).
  • 7. Histograms Different images can have same histogram 3 images below have same histogram Half of pixels are gray, half are white Same histogram = same statistics Distribution of intensities could be different Can we reconstruct image from histogram?
  • 8. Histograms A histogram for a grayscale image with intensity values in range I(x, y) [0, L—1] would contain exactly L entries E.g. 8-bit grayscale image, L = 2^8 = 256 Each histogram entry is defined as: h(i) = number of pixels with intensity i for all 0 <= i< L. E.g: h(255) = number of pixels with intensity = 255
  • 9. Image Contrast The contrast of a grayscale image indicates how easily objects in the image can be distinguished High contrast image: many distinct intensity values Low contrast: image uses few intensity values
  • 12. Uses for Histogram Processing Image enhancements Image statistics Image compression Image segmentation Simple to calculate in software Economic hardware implementations Popular tool in real-time image processing A plot of this function for all values of k provides a global description of the appearance of the image (gives useful information for contrast enhancement)
  • 13. Uses for Histogram Processing Four basic image types and their corresponding histograms – Dark – Light – Low contrast – High contrast Histograms commonly viewed in plots as
  • 16. Dynamic Range 2/16/2018 16 • Dynamic Range: Number of distinct pixels in image • High dynamic range means very bright and very dark parts in a single image (many distinct values)
  • 18. Histogram Equalization 2/16/2018 18 The intensity levels in an image may be viewed as random variables in the interval [0, L-1]. Let ( ) and ( ) denote the probability density function (PDF) of random variables and . r sp r p s r s
  • 19. 2/16/2018 19 Histogram Equalization ( ) 0 1s T r r L    . T(r) is a strictly monotonically increasing function in the interval 0 -1; . 0 ( ) -1 for 0 -1. a r L b T r L r L      
  • 20. 2/16/2018 20 Histogram Equalization . T(r) is a strictly monotonically increasing function in the interval 0 -1; . 0 ( ) -1 for 0 -1. a r L b T r L r L       ( ) 0 1s T r r L    ( ) is continuous and differentiable.T r ( ) ( )s rp s ds p r dr
  • 21. Histogram Equalization 0 ( ) ( 1) ( ) r rs T r L p w dw    2/16/2018 21 0 ( ) ( 1) ( ) r r ds dT r d L p w dw dr dr dr        ( 1) ( )rL p r    ( ) 1( ) ( ) ( ) ( 1) ( ) 1 r r r s r p r dr p r p r p s L p rdsds L dr           
  • 22. 2/16/2018 22 Example 2 Suppose that the (continuous) intensity values in an image have the PDF 2 , for 0 r L-1 ( 1)( ) 0, otherwise Find the transformation function for equalizing the image histogra r r Lp r        m.
  • 23. 2/16/2018 23 Example 0 ( ) ( 1) ( ) r rs T r L p w dw    20 2 ( 1) ( 1) r w L dw L    2 1 r L  
  • 24. 2/16/2018 24 Histogram Equalization 0 Continuous case: ( ) ( 1) ( ) r rs T r L p w dw    0 Discrete values: ( ) ( 1) ( ) k k k r j j s T r L p r      0 0 1 ( 1) k=0,1,..., L-1 k k j j j j n L L n MN MN      
  • 25. 2/16/2018 25 Example: Histogram Equalization Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the intensity distribution shown in following table. Get the histogram equalization transformation function and give the ps(sk) for each sk.
  • 26. 2/16/2018 26 Example: Histogram Equalization 0 0 0 0 ( ) 7 ( ) 7 0.19 1.33r j j s T r p r       1 1 1 1 0 ( ) 7 ( ) 7 (0.19 0.25) 3.08r j j s T r p r        3 2 3 4 5 6 7 4.55 5 5.67 6 6.23 6 6.65 7 6.86 7 7.00 7 s s s s s s            
  • 30. 2/16/2018 30 Question Is histogram equalization always good?
  • 31. 2/16/2018 31 Histogram Matching Histogram matching (histogram specification) — generate a processed image that has a specified histogram Let ( ) and ( ) denote the continous probability density functions of the variables and . ( ) is the specified probability density function. Let be the random variable with the prob r z z p r p z r z p z s 0 0 ability ( ) ( 1) ( ) Define a random variable with the probability ( ) ( 1) ( ) r r z z s T r L p w dw z G z L p t dt s        
  • 32. 2/16/2018 32 Histogram Matching 0 0 ( ) ( 1) ( ) ( ) ( 1) ( ) r r z z s T r L p w dw G z L p t dt s          1 1 ( ) ( )z G s G T r   
  • 33. 2/16/2018 33 Histogram Matching: Procedure • Obtain pr(r) from the input image and then obtain the values of s • Use the specified PDF and obtain the transformation function G(z) • Mapping from s to z 0 ( 1) ( ) r rs L p w dw   0 ( ) ( 1) ( ) z zG z L p t dt s   1 ( )z G s 
  • 34. 2/16/2018 34 Histogram Matching: Example Assuming continuous intensity values, suppose that an image has the intensity PDF Find the transformation function that will produce an image whose intensity PDF is 2 2 , for 0 -1 ( 1)( ) 0 , otherwise r r r L Lp r        2 3 3 , for 0 ( -1) ( ) ( 1) 0, otherwise z z z L p z L       
  • 35. Histogram Matching: Example Find the histogram equalization transformation for the input image Find the histogram equalization transformation for the specified histogram The transformation function 20 0 2 ( ) ( 1) ( ) ( 1) ( 1) r r r w s T r L p w dw L dw L        2/16/2018 35 2 3 3 20 0 3 ( ) ( 1) ( ) ( 1) ( 1) ( 1) z z z t z G z L p t dt L dt s L L          2 1 r L   1/32 1/3 1/32 2 2 ( 1) ( 1) ( 1) 1 r z L s L L r L                
  • 36. 2/16/2018 36 Histogram Matching: Discrete Cases • Obtain pr(rj) from the input image and then obtain the values of sk, round the value to the integer range [0, L-1]. • Use the specified PDF and obtain the transformation function G(zq), round the value to the integer range [0, L-1]. • Mapping from sk to zq 0 0 ( 1) ( ) ( 1) ( ) k k k k r j j j j L s T r L p r n MN        0 ( ) ( 1) ( ) q q z i k i G z L p z s     1 ( )q kz G s 
  • 37. 2/16/2018 37 Example: Histogram Matching Suppose that a 3-bit image (L=8) of size 64 × 64 pixels (MN = 4096) has the intensity distribution shown in the following table (on the left). Get the histogram transformation function and make the output image with the specified histogram, listed in the table on the right.
  • 38. 2/16/2018 Example: Histogram Matching Obtain the scaled histogram-equalized values, Compute all the values of the transformation function G, 0 1 2 3 4 5 6 7 1, 3, 5, 6, 7, 7, 7, 7. s s s s s s s s         0 0 0 ( ) 7 ( ) 0.00z j j G z p z    1 2 3 4 5 6 7 ( ) 0.00 ( ) 0.00 ( ) 1.05 ( ) 2.45 ( ) 4.55 ( ) 5.95 ( ) 7.00 G z G z G z G z G z G z G z        0 0 0 1 2 65 7
  • 40. 2/16/2018 40 Example: Histogram Matching Obtain the scaled histogram-equalized values, Compute all the values of the transformation function G, 0 1 2 3 4 5 6 7 1, 3, 5, 6, 7, 7, 7, 7. s s s s s s s s         0 0 0 ( ) 7 ( ) 0.00z j j G z p z    1 2 3 4 5 6 7 ( ) 0.00 ( ) 0.00 ( ) 1.05 ( ) 2.45 ( ) 4.55 ( ) 5.95 ( ) 7.00 G z G z G z G z G z G z G z        0 0 0 1 2 65 7 s0 s2 s3 s5 s6 s7 s1 s4
  • 41. 2/16/2018 41 Example: Histogram Matching 0 1 2 3 4 5 6 7 1, 3, 5, 6, 7, 7, 7, 7. s s s s s s s s         0 1 2 3 4 5 6 7 kr
  • 42. 2/16/2018 42 Example: Histogram Matching 0 3 1 4 2 5 3 6 4 7 5 7 6 7 7 7 k qr z        
  • 46. 2/16/2018 46 Local Histogram Processing Define a neighborhood and move its center from pixel to pixel At each location, the histogram of the points in the neighborhood is computed. Either histogram equalization or histogram specification transformation function is obtained Map the intensity of the pixel centered in the neighborhood Move to the next location and repeat the procedure
  • 47. 2/16/2018 47 Local Histogram Processing • The two histogram processing methods discussed: • Global • pixels are modified by a transformation function based on the gray-level content of an entire image. • Global approach is suitable for overall enhancement • there are cases in which it is necessary to enhance details over small areas in an image
  • 48. 2/16/2018 48 Local Histogram Processing: Example
  • 49. 2/16/2018 49 Using Histogram Statistics for Image Enhancement 1 0 ( ) L i i i m r p r     1 0 ( ) ( ) ( ) L n n i i i u r r m p r     1 2 2 2 0 ( ) ( ) ( ) L i i i u r r m p r      1 1 0 0 1 ( , ) M N x y f x y MN         1 1 2 0 0 1 ( , ) M N x y f x y m MN       Average Intensity Variance
  • 50. 2/16/2018 50 Using Histogram Statistics for Image Enhancement 1 0 Local average intensity ( ) denotes a neighborhood xy xy L s i s i i xy m r p r s     1 2 2 0 Local variance ( ) ( )xy xy xy L s i s s i i r m p r    
  • 51. 2/16/2018 51 Using Histogram Statistics for Image Enhancement: Example 0 1 2 0 1 2 ( , ), if and ( , ) ( , ), otherwise :global mean; :global standard deviation 0.4; 0.02; 0.4; 4 xy xys G G s G G G E f x y m k m k k g x y f x y m k k k E               g
  • 52. Enhancement Using Arithmetic/Logic Operations Arithmetic/logic operations involving images are performed on a pixel-by-pixel basis between two or more images (this excludes the logic operation NOT, which is performed on a single image). The difference between two images f(x, y) and h(x, y), expressed as G(x,y)=f(x,y)-h(x,y)
  • 53. Basics of Spatial Filtering The subimage is called a filter, mask, kernel, template, or window. The values in a filter subimage are referred to as coefficients , rather than pixels. Smoothing spatial filters