Post on 22-Mar-2018
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
1
Digital Image Processing
Digital Image Fundamental
• Digital Image Fundamentals:
– Elements of Visual Perception
– Light and the Electromagnetic Spectrum
– Image Sensing and Acquisition
– Image Sampling and Quantization
– Some Basic Relationships between Pixels
– An Introduction to the Mathematical Tools Used in Digital Image Processing
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
2
Digital Image Processing
Digital Image Fundamental
• Eye Physiology:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
3
Digital Image Processing
Digital Image Fundamental
• Optical Sensors in retina: – Cones: Highly Sensitive to Color (6-7)×106
– Rods: Highly Sensitive to Low Levels of Illumination (75-150) ×106
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
4
Digital Image Processing
Digital Image Fundamental
• Image Formation in the Eye:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
5
Digital Image Processing
Digital Image Fundamental
• Brightness Adaptation:
– Eyes can adapts a large dynamic ranges of intensity (1010) But NOT Simultaneously.
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
6
Digital Image Processing
Digital Image Fundamental
• Brightness Discrimination:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
7
Digital Image Processing
Digital Image Fundamental
• Weber Ratio:
CΔI =Increment of illumination discriminable 50% times
Rods
Cons
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
8
Digital Image Processing
Digital Image Fundamental
• Match Band Effect:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
9
Digital Image Processing
Digital Image Fundamental
• Simultaneous Contrast:
Appear Darker
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
10
Digital Image Processing
Digital Image Fundamental
• Eye illusions:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
11
Digital Image Processing
Digital Image Fundamental
• 2.2: Light and the Electromagnetic Spectrum
• 2.3: Image Sensing and Acquisition
• Ignored!
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
12
Digital Image Processing
Digital Image Fundamental
• A Simple Image Formation:
• Gray Level :Intensity of monochrome images.
, , ,
0 , : Illumination
0 , 1: Reflection
f x y i x y r x y
i x y
r x y
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
13
Digital Image Processing
Digital Image Fundamental
• Image Sampling and Quantization (1):
Scan Line
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
14
Digital Image Processing
Digital Image Fundamental
• Image Sampling and Quantization (2):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
15
Digital Image Processing
Digital Image Fundamental
• Image Sampling and Quantization:
– Spatial and Gray Level Resolution
– How to determine the sampling rate?
– Nyquist sampling theorem • If input is a band-limited signal with maximum frequency ΩN
• The input can be uniquely determined if sampling rate ΩS > 2ΩN
– Nyquist frequency : ΩN
– Nyquist rate : ΩS
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
16
Digital Image Processing
Digital Image Fundamental
• Digital Image Representation:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
17
Digital Image Processing
Digital Image Fundamental
• Digital Image, Mathematical Definition:
– I = f(x,y)
– I: intensity (or color)
– (x,y): Position or Coordination
– When (x,y) and I are finite and discrete quantities -→ digital image
– pixels, picture elements, image elements
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
18
Digital Image Processing
Digital Image Fundamental
• Mathematical Representation:
bits to store the image = M x N x k gray level = L = 2k
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
19
Digital Image Processing
Digital Image Fundamental
• L- level digital image of size M×N
– Means: A digital image having: • A spatial resolution M×N pixels
• A gray-level resolution of L levels (0 … L-1)
• Spatial resolution in real-world space
line width=W cm space width=W cm
Resolution = 1/2W (line/cm)
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
20
Digital Image Processing
Digital Image Fundamental
• L = 2k gray levels, gray scales [0,…,L-1]
• The dynamic range of an image
– [min(image) max(image)]
– If the dynamic range of an image spans a significant portion of the gray scale → high contrast
– Otherwise, low dynamic range results in a washed out gray look.
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
21
Digital Image Processing
Digital Image Fundamental
• Saturation and Noise:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
22
Digital Image Processing
Digital Image Fundamental
• Number of Storage bits (M=N):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
23
Digital Image Processing
Digital Image Fundamental
• Spatial and Intensity Resolution:
1250 dpi 300 dpi 150 dpi 75 dpi
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
24
Digital Image Processing
Digital Image Fundamental
• Bits Reduction (More Quantization):
– 8 bits to 1 bits (Left to Right-Top to Down)
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
25
Digital Image Processing
Digital Image Fundamental
• Three types of image (Low/Medium/High Details):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
26
Digital Image Processing
Digital Image Fundamental
• Sampling-Quantization Tradeoff:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
27
Digital Image Processing
Digital Image Fundamental
• Image Interpolation: – Nearest Neighbor (NN)
– Bilinear (BL) using 4 nearest neighbor:
– Bicubic (BC) using 16 nearest neighbor:
– …
,f x y ax by cxy d
3 3
0 0
, i j
ij
i j
f x y a x y
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
28
Digital Image Processing
Digital Image Fundamental
• Image Interpolation (Example): – Reduced to 72 dpi
– NN, BL, BC
– Reduced to 150 dpi
– NN, BL, BC
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
29
Digital Image Processing
Digital Image Fundamental
• Basic Relationships Between Pixels:
– 4-Neighbors
– Diagonal Neighbors
– 8-Neighbors:
4 : 1, , 1, , , 1 , , 1N p x y x y x y x y
: 1, 1 , 1, 1 , 1, 1 , 1, 1DN p x y x y x y x y
8 4: DN p N p N p
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
30
Digital Image Processing
Digital Image Fundamental
• Basic Relationships Between Pixels:
4 8
1 1 1 1 1 1
1 1 1 1
1 1 1
1
0 0 0
0 0
0
1
0 0
1
1 1 1
DN N N
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
31
Digital Image Processing
Digital Image Fundamental
• Adjacency:
– p and q are 4-adjacent:
– p and q are 8-adjacent:
– p and q are m-adjacent:
4q N p
8q N p
4 4 4Dq N p or q N p and N p N q
8 m
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
32
Digital Image Processing
Digital Image Fundamental
• Distance Measure:
• Examples:
– Euclidean:
– D4 (City Block or Manhattan):
– D8 (Chessboard):
a. D p,q 0 D p,q 0 iff
b. D p,q D q,p
b. D p,q D p,r D r,q
p q
2 2
,eD p q x s y t
4 ,D p q x s y t
8 , ,D p q Max x s y t
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
33
Digital Image Processing
Digital Image Fundamental
• Constant Distance Contour:
– D4 (Left)
– D8 (Right)
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
34
Digital Image Processing
Digital Image Fundamental
Mathematical Tools:
– Array and Matrix Operations
– Linear and nonlinear Operation • Fourier Filtering, Ordered Statistics Filtering, …
– Arithmetic Operation (+, -, *, /) • Averaging, Subtraction, …
– Set and Logical Operations • Fuzzy or Crisp Sets
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
35
Digital Image Processing
Digital Image Fundamental
• Image Averaging: – Consider an additive noise condition:
g(x,y)=f(x,y)+η(x,y)
– Conditions: • Noise, η(x,y):
– Uncorrelated
– i.i.d
– Zero Mean
• Subject, f(x,y): – Physical Stationary
– Repeatable Experiments
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
36
Digital Image Processing
Digital Image Fundamental
• Image Averaging:
2 2
1, ,
, ,1
, , 1
N
i
ig x y x y
E g x y f x y
g x y g x yN
N
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
37
Digital Image Processing
Digital Image Fundamental
• Example:
– 5, 10,20, 50, and 100 averaging.
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
38
Digital Image Processing
Digital Image Fundamental
• Image Subtraction:
– Original (Left), LSB set to zero (Center), Difference (Right)
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
39
Digital Image Processing
Digital Image Fundamental
• Digital Subtraction Radiography (DSA):
– Pre and Post Imaging
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
40
Digital Image Processing
Digital Image Fundamental
• Image Multiplication/Division:
– Shading Correction
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
41
Digital Image Processing
Digital Image Fundamental
• Image Multiplication/Division:
– ROI Masking
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
42
Digital Image Processing
Digital Image Fundamental
• Set and Logical Operation:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
43
Digital Image Processing
Digital Image Fundamental
• Example – Original (Left), Negative (Center), Right (union with Constant)
𝐴𝑈𝐵 = 𝑚𝑎𝑥 𝐴, 𝐵
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
44
Digital Image Processing
Digital Image Fundamental
• Logical Operation:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
45
Digital Image Processing
Digital Image Fundamental
Mathematical Tools:
• Spatial Operations
– Single pixel
– Neighborhood
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
46
Digital Image Processing
Digital Image Fundamental
• Single Pixel: 𝑠 = 𝑇 𝑧
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
47
Digital Image Processing
Digital Image Fundamental
• Neighborhood Operation:
,
1, ,
xyr c S
g x y f r cmn
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
48
Digital Image Processing
Digital Image Fundamental
• Geometric Spatial Transform
– General Formulation:
– Example (Affine Transform)
, ,x y T u v
1 0 0 1 1
x a b c u
y d e f v
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
49
Digital Image Processing
Digital Image Fundamental
• Geometric Transform (1):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
50
Digital Image Processing
Digital Image Fundamental
• Geometric Transform (2):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
51
Digital Image Processing
Digital Image Fundamental
• Image Rotation:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
52
Digital Image Processing
Digital Image Fundamental
Image Registration
• General Formulation:
• Example (Bilinear Transform)
, ,x y T u v
1 1 1 1
2 2 2 2
x a u b v c uv d
y a u b v c uv d
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
53
Digital Image Processing
Digital Image Fundamental
• Image Registration (Example):
– Using tie points
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
54
Digital Image Processing
Digital Image Fundamental
• Vector and Matrix Operation:
– Multispectral Image Processing
– Image Transform (Fourier and etc.)
– Probabilistic Methods
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
55
Digital Image Processing
Digital Image Fundamental
• Multispectral Image Processing:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
56
Digital Image Processing
Digital Image Fundamental
• Image Transform (Fourier and etc.):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
57
Digital Image Processing
Digital Image Fundamental
• Fourier Filtration:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
58
Digital Image Processing
Digital Image Fundamental
2 2 2
14.3, 31.6, 49.2
204.3, 997.8, 22424.9
L M H
L M H
m m m
• Probabilistic Approaches:
– Low-Medium-High contrast (From Left to Right)
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
59
Digital Image Processing
Digital Image Fundamental
• Paradigm of image processing: – Low-level processing
• Inputs and outputs are images • Primitive operations: de-noise, enhancement,
sharpening, …
– Mid-level processing • Inputs are images, outputs are attributes extracted from
images • Segmentation, classification,…
– High-level processing • “Make sense” of an ensemble of recognized objects by
machines
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
60
Digital Image Processing
Digital Image Fundamental
• Matlab Image Processing Read/Write:
– imformats
– imfinfo, imread, imwrite
– dicominfo, dicomread, dicomwrite
– analyze75info, analyze75read (Mayo Clinic)
– interfileinfo, interfileread
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
61
Digital Image Processing
Digital Image Fundamental
• Matlab Image Processing Display:
– image, imagesc, imshow, imtool, subimage
– colorbar, montage
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2011
62
Digital Image Processing
Digital Image Fundamental
• Matlab Image Processing Type Conversion:
– double, ind2gray, im2double
– uint16, uint8, gray2ind