SlideShare a Scribd company logo
1 of 37
9/30/2023 1
Lecture 3 (2.5.07)
Image Enhancement in
Spatial Domain
Shahram Ebadollahi
DIP ELEN E4830
9/30/2023 2
Today’s Lecture - Outline
 Review of Lecture 2
 Processing Images in Spatial Domain: Intro
 Image Histogram
 Point Operations
 Using Histogram for Image Enhancement
 Kernel Operations
9/30/2023 3
Today’s Lecture - Outline
 Review of Lecture 2
 Processing Images in Spatial Domain: Intro
 Image Histogram
 Point Operations
 Using Histogram for Image Enhancement
 Kernel Operations
9/30/2023 4
Today’s Lecture - Outline
 Review of Lecture 2
 Processing Images in Spatial Domain: Intro
 Image Histogram
 Point Operations
 Using Histogram for Image Enhancement
 Kernel Operations
9/30/2023 5
Processing Images in Spatial Domain:
Introduction
)
(
(.)
f
T
g
f N
T



 

N
y
M
x
y
x
f 


 1
,
1
,
)
,
( N
y
M
x
y
x
g 


 1
,
1
,
)
,
(
(.)
N
T : Spatial operator defined on a neighborhood N of a given pixel
)
,
(
0 y
x
N )
,
(
4 y
x
N )
,
(
8 y
x
N
point processing mask processing
9/30/2023 6
Mask (filter, kernel, window, template)
processing
x
y
(0,0)
x
y
(0,0)
)
,
( y
x
f )
,
( y
x
g
9/30/2023 7
Today’s Lecture - Outline
 Review of Lecture 2
 Processing Images in Spatial Domain: Intro
 Image Histogram
 Point Operations
 Using Histogram for Image Enhancement
 Kernel Operations
9/30/2023 8
Image Histogram
 
MxN
r
n
m
f
MxN
n
k
h
L
h
k
h
h
h
H
r
r
r
r
n
m
f
f
m n
k
k
L
k
MxN
 




 
)
)
,
(
(
)
(
,
))
1
(
,
),
(
,
),
1
(
),
0
(
(
,
,
,
,
,
)
,
(
, 1
1
0





histogram
histogram
bi-level image
Pixel values linearly
increasing from 0 to
255 with increasing
column index
normalized
256x256
256x256
r
H
r
H
255
255
0
0.5
0
1/256
9/30/2023 9
Image Histogram: example
9/30/2023 10
Today’s Lecture - Outline
 Review of Lecture 2
 Processing Images in Spatial Domain: Intro
 Image Histogram
 Point Operations
 Using Histogram for Image Enhancement
 Kernel Operations
9/30/2023 11
Point Processing:
Thresholding
))
,
(
(
)
,
(
)
,
( y
x
f
T
y
x
g
y
x
f 


)
(

 T



Input gray-level value Output gray-level value

)
(
 T

0

2

9/30/2023 12
Point Processing:
Gamma Correction

cr
s 
9/30/2023 13
Point Processing:
Contrast Stretching

















1
,
)
(
,
)
(
0
,
2
2
2
3
2
1
1
1
2
1
1
L
s
s
s















f g
f
H g
H

)
(
 T

2

1

2

1

0 L-1
1
s
2
s
3
s
L-1
9/30/2023 14
Point Processing:
Clipping & Thresholding
f

)
(
 T

2

1

0 L-1
s

)
(
 T

1

0 L-1
clipping
thresholding
clip
g
thresh
g
9/30/2023 15
Point Processing:
Gray-level Slicing

)
(
 T

2

1

0 L-1

)
(
 T

2

1

0 L-1
9/30/2023 16
Point Processing:
Bit-plane Slicing
0
1
2
2
1
1 2
2
2
2 a
a
a
a
a
f n
B
n
B
B
B
B
B 





 




 

]
[ 0
1
2
1 a
a
a
a
a n
B
B
B 
 


10011101
157 

f
e.g.
1
2 

 n
n
n i
i
a






 n
n
f
i
2
where,
lsb
msb
9/30/2023 17
Point Processing:
Bit-plane Slicing (example)







0
,
0
1
,
n
n
a
a
L
g
f
Point operation for
obtaining n-th bit-plane:
n=7 n=6 n=5 n=4
Bi-level image
9/30/2023 18
Today’s Lecture - Outline
 Review of Lecture 2
 Processing Images in Spatial Domain: Intro
 Image Histogram
 Point Operations
 Using Histogram for Image Enhancement
 Kernel Operations
9/30/2023 19
Histogram Modification
 Apply a transform to an image such that the resulting
image has desired histogram.
 Histogram Equalization (linearization)
 Histogram Specification (matching)
 Non-adaptive vs. Adaptive Histogram Modification
 Global histogram
 Local histogram
9/30/2023 20
Histogram Equalization
Source
image
Equalized
Image
Corresponding
Histograms
9/30/2023 21
Histogram Equalization
 Often images poorly use the full range of the
gray scale
 Solution:
Transform image such that its histogram is spread
out more evenly in gray scale
 Rather than guessing the parameters and the
form of the transformation use original gray-
scale distribution as the cue
9/30/2023 22
Histogram Equalization
Histogram
Equalization
r s
r
p
s
p
(.)
T
ds
dr
r
p
s
p r
s )
(
)
( 



r
r du
u
p
r
T
s
0
)
(
)
(
1
)
( 
s
ps

 




k
j
j
k
j
j
r
k
k
MxN
n
r
p
r
T
s
0
0
)
(
)
(
# pixels with the
j-th gray-level
image size
Point operation for
equalizing histogram
for the example image
(.)
T
9/30/2023 23
Histogram Matching
 Transform image such that resulting image has
specified histogram



r
r du
u
p
r
T
s
0
)
(
)
(
Histogram
Matching
r z
r
p (.)
F z
p
 

z
z s
dt
t
p
z
G
0
)
(
)
(
)]
(
[
)
( 1
1
r
T
G
s
G
z 


 T
G
F 1


9/30/2023 24
Histogram Matching




k
j
j
r
k
k r
p
r
T
s
0
)
(
)
(
k
k
j
j
z
k
k s
z
p
z
G
v 

 
0
)
(
)
(
1
,
,
1
,
0 
 L
k 
9/30/2023 25
Adaptive Histogram Equalization
Note: local
structure revealed
x
y
(0,0)
)
,
( y
x
f
)
,
( y
x
H
Histogram
Equalization
9/30/2023 26
Today’s Lecture - Outline
 Review of Lecture 2
 Processing Images in Spatial Domain: Intro
 Image Histogram
 Point Operations
 Using Histogram for Image Enhancement
 Kernel Operations
9/30/2023 27
Kernel Operator: Intro
Note: need to handle
borders of the image
9/30/2023 28
Kernel Operator: Intro
Spatial
Filtering
f g
(.)
(.) w
TN 
)
1
,
1
(
)
1
,
1
(
)
,
(
)
0
,
0
(
)
,
1
(
)
0
,
1
(
)
1
,
1
(
)
1
,
1
(
)
,
( 












 n
m
f
w
n
m
f
w
n
m
f
w
n
m
f
w
n
m
g 

 

 




a
a
i
b
b
j
j
n
i
m
f
j
i
w
n
m
g )
,
(
)
,
(
)
,
(
1
2 
a
1
2 
b
N
n
M
m




1
1 kernel
9/30/2023 29
FT
FT
Low-pass filter
Smoothing: Image Averaging
* Image edges
are softened
9/30/2023 30
Smoothing: Averaging (example)
3x3
5x5
15x15
9x9
35x35
original
Noise effect is gone,
but image edges are
heavily blurred also
9/30/2023 31
Order Statistics Filter
)}
,
(
{
)
,
(
)
,
(
)
,
(
t
s
f
median
y
x
g
y
x
W
t
s 

)}
,
(
{
max
)
,
(
)
,
(
)
,
(
t
s
f
y
x
g
y
x
W
t
s 

)}
,
(
{
min
)
,
(
)
,
(
)
,
(
t
s
f
y
x
g
y
x
W
t
s 

original
9/30/2023 32
Image Derivative
9/30/2023 33
Image Sharpening: 1-st derivative

























y
f
x
f
G
G
f
y
x
Image gradient: y
x G
G
f 


Robert’s
operator
Sobel’s
operator
Sobel filter in
frequency
domain
9/30/2023 34
Image Sharpening: 2-nd derivative
2
2
2
2
2
y
f
x
f
f







Image Laplacian:
)
,
(
2
)
,
1
(
)
,
1
(
2
2
y
x
f
y
x
f
y
x
f
x
f







)
,
(
2
)
1
,
(
)
1
,
(
2
2
y
x
f
y
x
f
y
x
f
y
f







)
,
(
4
)
1
,
(
)
1
,
(
)
,
1
(
)
,
1
(
2
y
x
f
y
x
f
y
x
f
y
x
f
y
x
f
f










9/30/2023 35
Image Sharpening: 2-nd derivative
* +
Laplacian filter in
frequency
domain
9/30/2023 36
High-boost Filtering
Avg.
+
+
-
)
,
(
)
,
(
)
,
( y
x
f
y
x
Af
y
x
f lp
hb 

Unsharp mask:
high-boost with A=1
9/30/2023 37
Recap
 Point operations vs. Kernel Operations
 Image Histogram
 Image Enhancement using Point Operators
 Contrast Stretching
 Gamma Correction
 Using Image Histogram for Enhancement
 Histogram Equalization
 Histogram Matching
 Image Enhancement using Kernel Operators
 Low-pass filtering (averaging)
 High-pass filtering (sharpening)

More Related Content

Similar to lec3.ppt

SINGLE‐PHASE TO THREE‐PHASE DRIVE SYSTEM USING TWO PARALLEL SINGLE‐PHASE RECT...
SINGLE‐PHASE TO THREE‐PHASE DRIVE SYSTEM USING TWO PARALLEL SINGLE‐PHASE RECT...SINGLE‐PHASE TO THREE‐PHASE DRIVE SYSTEM USING TWO PARALLEL SINGLE‐PHASE RECT...
SINGLE‐PHASE TO THREE‐PHASE DRIVE SYSTEM USING TWO PARALLEL SINGLE‐PHASE RECT...ijiert bestjournal
 
CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureFatmaNewagy1
 
Notes on image processing
Notes on image processingNotes on image processing
Notes on image processingMohammed Kamel
 
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.pdfnagwaAboElenein
 
Image Texture Analysis
Image Texture AnalysisImage Texture Analysis
Image Texture Analysislalitxp
 
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 slidesBHAGYAPRASADBUGGE
 
Reconstructing and Watermarking Stereo Vision Systems-PhD Presentation
Reconstructing and Watermarking Stereo Vision Systems-PhD Presentation Reconstructing and Watermarking Stereo Vision Systems-PhD Presentation
Reconstructing and Watermarking Stereo Vision Systems-PhD Presentation Osama Hosam
 
Iaetsd degraded document image enhancing in
Iaetsd degraded document image enhancing inIaetsd degraded document image enhancing in
Iaetsd degraded document image enhancing inIaetsd Iaetsd
 
Lecture 9 (Digital Image Processing)
Lecture 9 (Digital Image Processing)Lecture 9 (Digital Image Processing)
Lecture 9 (Digital Image Processing)VARUN KUMAR
 
Estimation, Detection & Comparison of Soil Nutrients using Matlab
Estimation, Detection & Comparison of Soil Nutrients using MatlabEstimation, Detection & Comparison of Soil Nutrients using Matlab
Estimation, Detection & Comparison of Soil Nutrients using MatlabIRJET Journal
 
ECE 565 Project1
ECE 565 Project1ECE 565 Project1
ECE 565 Project1?? ?
 

Similar to lec3.ppt (20)

SINGLE‐PHASE TO THREE‐PHASE DRIVE SYSTEM USING TWO PARALLEL SINGLE‐PHASE RECT...
SINGLE‐PHASE TO THREE‐PHASE DRIVE SYSTEM USING TWO PARALLEL SINGLE‐PHASE RECT...SINGLE‐PHASE TO THREE‐PHASE DRIVE SYSTEM USING TWO PARALLEL SINGLE‐PHASE RECT...
SINGLE‐PHASE TO THREE‐PHASE DRIVE SYSTEM USING TWO PARALLEL SINGLE‐PHASE RECT...
 
Presentation 1
Presentation 1Presentation 1
Presentation 1
 
chap3.ppt
chap3.pptchap3.ppt
chap3.ppt
 
Histogram processing
Histogram processingHistogram processing
Histogram processing
 
CSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lectureCSE367 Lecture- image sinal processing lecture
CSE367 Lecture- image sinal processing lecture
 
chap3.ppt
chap3.pptchap3.ppt
chap3.ppt
 
Notes on image processing
Notes on image processingNotes on image processing
Notes on image processing
 
matlab.docx
matlab.docxmatlab.docx
matlab.docx
 
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
 
Image Texture Analysis
Image Texture AnalysisImage Texture Analysis
Image Texture Analysis
 
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
 
Reconstructing and Watermarking Stereo Vision Systems-PhD Presentation
Reconstructing and Watermarking Stereo Vision Systems-PhD Presentation Reconstructing and Watermarking Stereo Vision Systems-PhD Presentation
Reconstructing and Watermarking Stereo Vision Systems-PhD Presentation
 
R04404112115
R04404112115R04404112115
R04404112115
 
Iaetsd degraded document image enhancing in
Iaetsd degraded document image enhancing inIaetsd degraded document image enhancing in
Iaetsd degraded document image enhancing in
 
Lecture 9 (Digital Image Processing)
Lecture 9 (Digital Image Processing)Lecture 9 (Digital Image Processing)
Lecture 9 (Digital Image Processing)
 
Estimation, Detection & Comparison of Soil Nutrients using Matlab
Estimation, Detection & Comparison of Soil Nutrients using MatlabEstimation, Detection & Comparison of Soil Nutrients using Matlab
Estimation, Detection & Comparison of Soil Nutrients using Matlab
 
Image transforms
Image transformsImage transforms
Image transforms
 
Dkd 4 2-sheet_1_annex_a
Dkd 4 2-sheet_1_annex_aDkd 4 2-sheet_1_annex_a
Dkd 4 2-sheet_1_annex_a
 
ECE 565 Project1
ECE 565 Project1ECE 565 Project1
ECE 565 Project1
 
Mask R-CNN
Mask R-CNNMask R-CNN
Mask R-CNN
 

More from SIVA NAGI REDY KALLI

Gate level design, switch logic, pass transistors
Gate level design, switch logic, pass transistorsGate level design, switch logic, pass transistors
Gate level design, switch logic, pass transistorsSIVA NAGI REDY KALLI
 
Electronics introduction and its various devises
Electronics introduction and its various devisesElectronics introduction and its various devises
Electronics introduction and its various devisesSIVA NAGI REDY KALLI
 
Image compression techniques and its applications
Image compression techniques and its applicationsImage compression techniques and its applications
Image compression techniques and its applicationsSIVA NAGI REDY KALLI
 
cmos-fabrication and nmos fabrication.ppt
cmos-fabrication and nmos fabrication.pptcmos-fabrication and nmos fabrication.ppt
cmos-fabrication and nmos fabrication.pptSIVA NAGI REDY KALLI
 
silicon on insulator types and its characterstics
silicon on insulator types and its charactersticssilicon on insulator types and its characterstics
silicon on insulator types and its charactersticsSIVA NAGI REDY KALLI
 

More from SIVA NAGI REDY KALLI (8)

Gate level design, switch logic, pass transistors
Gate level design, switch logic, pass transistorsGate level design, switch logic, pass transistors
Gate level design, switch logic, pass transistors
 
Electronics introduction and its various devises
Electronics introduction and its various devisesElectronics introduction and its various devises
Electronics introduction and its various devises
 
Image compression techniques and its applications
Image compression techniques and its applicationsImage compression techniques and its applications
Image compression techniques and its applications
 
cmos-fabrication and nmos fabrication.ppt
cmos-fabrication and nmos fabrication.pptcmos-fabrication and nmos fabrication.ppt
cmos-fabrication and nmos fabrication.ppt
 
silicon on insulator types and its characterstics
silicon on insulator types and its charactersticssilicon on insulator types and its characterstics
silicon on insulator types and its characterstics
 
chap1.ppt
chap1.pptchap1.ppt
chap1.ppt
 
Clippers_and_Clampers.pptx
Clippers_and_Clampers.pptxClippers_and_Clampers.pptx
Clippers_and_Clampers.pptx
 
Edc-unit-ii.ppt
Edc-unit-ii.pptEdc-unit-ii.ppt
Edc-unit-ii.ppt
 

Recently uploaded

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactisticshameyhk98
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 

Recently uploaded (20)

Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 

lec3.ppt

  • 1. 9/30/2023 1 Lecture 3 (2.5.07) Image Enhancement in Spatial Domain Shahram Ebadollahi DIP ELEN E4830
  • 2. 9/30/2023 2 Today’s Lecture - Outline  Review of Lecture 2  Processing Images in Spatial Domain: Intro  Image Histogram  Point Operations  Using Histogram for Image Enhancement  Kernel Operations
  • 3. 9/30/2023 3 Today’s Lecture - Outline  Review of Lecture 2  Processing Images in Spatial Domain: Intro  Image Histogram  Point Operations  Using Histogram for Image Enhancement  Kernel Operations
  • 4. 9/30/2023 4 Today’s Lecture - Outline  Review of Lecture 2  Processing Images in Spatial Domain: Intro  Image Histogram  Point Operations  Using Histogram for Image Enhancement  Kernel Operations
  • 5. 9/30/2023 5 Processing Images in Spatial Domain: Introduction ) ( (.) f T g f N T       N y M x y x f     1 , 1 , ) , ( N y M x y x g     1 , 1 , ) , ( (.) N T : Spatial operator defined on a neighborhood N of a given pixel ) , ( 0 y x N ) , ( 4 y x N ) , ( 8 y x N point processing mask processing
  • 6. 9/30/2023 6 Mask (filter, kernel, window, template) processing x y (0,0) x y (0,0) ) , ( y x f ) , ( y x g
  • 7. 9/30/2023 7 Today’s Lecture - Outline  Review of Lecture 2  Processing Images in Spatial Domain: Intro  Image Histogram  Point Operations  Using Histogram for Image Enhancement  Kernel Operations
  • 8. 9/30/2023 8 Image Histogram   MxN r n m f MxN n k h L h k h h h H r r r r n m f f m n k k L k MxN         ) ) , ( ( ) ( , )) 1 ( , ), ( , ), 1 ( ), 0 ( ( , , , , , ) , ( , 1 1 0      histogram histogram bi-level image Pixel values linearly increasing from 0 to 255 with increasing column index normalized 256x256 256x256 r H r H 255 255 0 0.5 0 1/256
  • 10. 9/30/2023 10 Today’s Lecture - Outline  Review of Lecture 2  Processing Images in Spatial Domain: Intro  Image Histogram  Point Operations  Using Histogram for Image Enhancement  Kernel Operations
  • 11. 9/30/2023 11 Point Processing: Thresholding )) , ( ( ) , ( ) , ( y x f T y x g y x f    ) (   T    Input gray-level value Output gray-level value  ) (  T  0  2 
  • 12. 9/30/2023 12 Point Processing: Gamma Correction  cr s 
  • 13. 9/30/2023 13 Point Processing: Contrast Stretching                  1 , ) ( , ) ( 0 , 2 2 2 3 2 1 1 1 2 1 1 L s s s                f g f H g H  ) (  T  2  1  2  1  0 L-1 1 s 2 s 3 s L-1
  • 14. 9/30/2023 14 Point Processing: Clipping & Thresholding f  ) (  T  2  1  0 L-1 s  ) (  T  1  0 L-1 clipping thresholding clip g thresh g
  • 15. 9/30/2023 15 Point Processing: Gray-level Slicing  ) (  T  2  1  0 L-1  ) (  T  2  1  0 L-1
  • 16. 9/30/2023 16 Point Processing: Bit-plane Slicing 0 1 2 2 1 1 2 2 2 2 a a a a a f n B n B B B B B                ] [ 0 1 2 1 a a a a a n B B B      10011101 157   f e.g. 1 2    n n n i i a        n n f i 2 where, lsb msb
  • 17. 9/30/2023 17 Point Processing: Bit-plane Slicing (example)        0 , 0 1 , n n a a L g f Point operation for obtaining n-th bit-plane: n=7 n=6 n=5 n=4 Bi-level image
  • 18. 9/30/2023 18 Today’s Lecture - Outline  Review of Lecture 2  Processing Images in Spatial Domain: Intro  Image Histogram  Point Operations  Using Histogram for Image Enhancement  Kernel Operations
  • 19. 9/30/2023 19 Histogram Modification  Apply a transform to an image such that the resulting image has desired histogram.  Histogram Equalization (linearization)  Histogram Specification (matching)  Non-adaptive vs. Adaptive Histogram Modification  Global histogram  Local histogram
  • 21. 9/30/2023 21 Histogram Equalization  Often images poorly use the full range of the gray scale  Solution: Transform image such that its histogram is spread out more evenly in gray scale  Rather than guessing the parameters and the form of the transformation use original gray- scale distribution as the cue
  • 22. 9/30/2023 22 Histogram Equalization Histogram Equalization r s r p s p (.) T ds dr r p s p r s ) ( ) (     r r du u p r T s 0 ) ( ) ( 1 ) (  s ps        k j j k j j r k k MxN n r p r T s 0 0 ) ( ) ( # pixels with the j-th gray-level image size Point operation for equalizing histogram for the example image (.) T
  • 23. 9/30/2023 23 Histogram Matching  Transform image such that resulting image has specified histogram    r r du u p r T s 0 ) ( ) ( Histogram Matching r z r p (.) F z p    z z s dt t p z G 0 ) ( ) ( )] ( [ ) ( 1 1 r T G s G z     T G F 1  
  • 24. 9/30/2023 24 Histogram Matching     k j j r k k r p r T s 0 ) ( ) ( k k j j z k k s z p z G v     0 ) ( ) ( 1 , , 1 , 0   L k 
  • 25. 9/30/2023 25 Adaptive Histogram Equalization Note: local structure revealed x y (0,0) ) , ( y x f ) , ( y x H Histogram Equalization
  • 26. 9/30/2023 26 Today’s Lecture - Outline  Review of Lecture 2  Processing Images in Spatial Domain: Intro  Image Histogram  Point Operations  Using Histogram for Image Enhancement  Kernel Operations
  • 27. 9/30/2023 27 Kernel Operator: Intro Note: need to handle borders of the image
  • 28. 9/30/2023 28 Kernel Operator: Intro Spatial Filtering f g (.) (.) w TN  ) 1 , 1 ( ) 1 , 1 ( ) , ( ) 0 , 0 ( ) , 1 ( ) 0 , 1 ( ) 1 , 1 ( ) 1 , 1 ( ) , (               n m f w n m f w n m f w n m f w n m g            a a i b b j j n i m f j i w n m g ) , ( ) , ( ) , ( 1 2  a 1 2  b N n M m     1 1 kernel
  • 29. 9/30/2023 29 FT FT Low-pass filter Smoothing: Image Averaging * Image edges are softened
  • 30. 9/30/2023 30 Smoothing: Averaging (example) 3x3 5x5 15x15 9x9 35x35 original Noise effect is gone, but image edges are heavily blurred also
  • 31. 9/30/2023 31 Order Statistics Filter )} , ( { ) , ( ) , ( ) , ( t s f median y x g y x W t s   )} , ( { max ) , ( ) , ( ) , ( t s f y x g y x W t s   )} , ( { min ) , ( ) , ( ) , ( t s f y x g y x W t s   original
  • 33. 9/30/2023 33 Image Sharpening: 1-st derivative                          y f x f G G f y x Image gradient: y x G G f    Robert’s operator Sobel’s operator Sobel filter in frequency domain
  • 34. 9/30/2023 34 Image Sharpening: 2-nd derivative 2 2 2 2 2 y f x f f        Image Laplacian: ) , ( 2 ) , 1 ( ) , 1 ( 2 2 y x f y x f y x f x f        ) , ( 2 ) 1 , ( ) 1 , ( 2 2 y x f y x f y x f y f        ) , ( 4 ) 1 , ( ) 1 , ( ) , 1 ( ) , 1 ( 2 y x f y x f y x f y x f y x f f          
  • 35. 9/30/2023 35 Image Sharpening: 2-nd derivative * + Laplacian filter in frequency domain
  • 36. 9/30/2023 36 High-boost Filtering Avg. + + - ) , ( ) , ( ) , ( y x f y x Af y x f lp hb   Unsharp mask: high-boost with A=1
  • 37. 9/30/2023 37 Recap  Point operations vs. Kernel Operations  Image Histogram  Image Enhancement using Point Operators  Contrast Stretching  Gamma Correction  Using Image Histogram for Enhancement  Histogram Equalization  Histogram Matching  Image Enhancement using Kernel Operators  Low-pass filtering (averaging)  High-pass filtering (sharpening)