Escolar Documentos
Profissional Documentos
Cultura Documentos
Unit I -V
TM
Syllabus- Unit 1
• Introduction
• Steps in Image Processing
• Image Acquisition
• Representation
• Sampling & Quantization
• Relationship between pixels
• Color Models
• Basics of Color Image Processing
1 pixel
Digital Image
Origin
y
Image “After snow storm” f(x,y)
An image: a multidimensional function of spatial coordinates.
Spatial coordinate: (x,y) for 2D case such as photograph,
(x,y,z) for 3D case such as CT scan images
(x,y,t) for movies
The function f may represent intensity (for monochrome images)
or color (for color images) or other associated values
Acquisition Process
Image Representation
Image Quantization
Image quantization:
discretize continuous pixel values into discrete numbers
Nc 2 b
Neighbors of a Pixel
Neighborhood relation is used to tell adjacent pixels. It is
useful for analyzing regions.
(x,y-1) 4-neighbors of p:
(x1,y)
(x-1,y) p (x+1,y)
(x+1,y)
(x,y1)
N4(p) = (x,y+1)
(x,y+1)
(x1,y1)
(x-1,y) p (x+1,y)
(x,y1)
(x+1,y1)
(x1,y)
(x-1,y+1) (x,y+1) (x+1,y+1) (x+1,y)
N8(p) = (x1,y+1)
(x,y+1)
(x+1,y+1)
Connectivity
mixed-connectivity (m-connectivity):
p and q are m-connected if q N4(p) or
q ND(p) and N4(p) N4(q) =
• RGB model
• CYM model
• CYMK model
• HSI model
Pixel depth: the number of bits used to represent each pixel in RGB space
Full-color image: 24-bit RGB color image
(R, G, B) = (8 bits, 8 bits, 8 bits)
Color Fundamentals
Radiance: the total amount of energy that flows from the light
source (measured in watts)
Syllabus : Unit 2
• Histogram Processing
Image Enhancement
Spatial Domain
Spatial Domain Methods (Image Plane) Techniques are based on
direct manipulation of pixels in an image
Spatial domain refers to the aggregate of pixels composing an image.
Spatial domain methods are procedures that operate directly on
these pixels. Spatial domain processes will be denoted by the
expression:
g(x,y) = T [f(x,y)]
Image Enhancement
(Spatial Domain)
The simplest form of T, is when the
neighborhood of size 1X1 (that is a single
pixel). In this case, g depends only on the
value of f at (x,y), and T becomes a gray-
level (also called intensity or mapping)
transformation function of the form:
s = T (r)
Examples of Enhancement
Techniques- Contrast
Streching
Contrast Stretching
A simple image enhancement technique that
improves the contrast in an image by „stretching‟
the range of intensity values it contains to span
a desired range of values.
Examples of Enhancement
Techniques- Thresholding
Thresholding
Is a limited case of contrast stretching, it
produces a two-level (binary) image.
Histogram Processing
Histogram based Enhancement
3000
2500
2000
1500
1000
500
0
0 50 100 150 200
Why Histogram?
4
x 10
3.5
2.5
Histogram information
2 reveals that image is
1.5
1 under-exposed
0.5
7000
6000
5000
4000
3000
Over-exposed
2000
image
1000
Histogram Equalization
before after
3000 3000
2500 2500
2000 2000
1500 1500
1000
1000
500
500
0
0 50 100 150 200 0
0 50 100 150 200 250 300
before after
equalization equalization
PSD2B- Digital Image Processing 27
TM
Spatial Filtering
The Spatial Filtering Process
a b c j k l
d e f m n o
g h i p q r
Original Image Filter (w)
Pixels
eprocessed = n*e +
j*a + k*b + l*c +
m*d + o*f +
p*g + q*h + r*i
The above is repeated for every pixel in the original image to generate the
filtered image
PSD2B- Digital Image Processing 28
TM
a b
g ( x, y ) w(s, t ) f ( x s, y t )
s at b
Smoothing
Image smoothing is used for two primary purposes:
To give an image a softer or special effect
To eliminate noise
1/ 1/ 1/
9 9 9
1/ 1/ 1/
9 9 9
1/ 1/ 1/ Simple averaging filter
9 9 9
1/ 2/ 1/
16 16 16 Weighted averaging
2/ 4/ 2/ filter
16 16 16
1/ 2/ 1/
16 16 16
PSD2B- Digital Image Processing 30
TM
• Very effective for removing “salt and pepper” noise (i.e., random
occurrences of black and white pixels).
median
averaging filtering
Syllabus: Unit 3
• Image Enhancement in Frequency Domain
Fourier Transform
Any function that periodically repeats itself can be
expressed as the sum of sines and/or cosines of different
frequencies, each multiplied by a different coefficient
(Fourier series).
1D Fourier Transform
2D Fourier Transform
Lowpass filter
Highpass filter
• The simplest lowpass filter is a filter that “cuts off” all high-
frequency components of the Fourier transform that are at a
distance greater than a specified distance D0 from the origin of
the transform.
• The transfer function of an ideal lowpass filter
1 if D(u, v) D0
H (u, v)
0 if D(u, v) D0
where D(u,v) : the distance from point (u,v) to the center of
ther frequency rectangle
1
D(u , v) (u M / 2) (v N / 2)
2 2 2
0 if D(u, v) D0
H (u, v)
1 if D(u, v) D0
D2 (u ,v ) / 2 D02
H (u, v) 1 e
Syllabus – Unit 4
• Image restoration
• Model of degradation and restoration
process
• noise models
• restoration in the presence of noise
• periodic noise reduction
•Image segmentation
•Thresholding
• Region based segmentation.
Image Restoration
• Goal of image restoration
• Features
g(x,y)=f(x,y)*h(x,y)+h(x,y)
G(u,v)=F(u,v)H(u,v)+N(u,v)
PSD2B- Digital Image Processing 48
TM
Noise Models
• Source of noise
– Image acquisition (digitization)
– Image transmission
• Spatial properties of noise
– Statistical behavior of the gray-level values of pixels
– Noise parameters, correlation with the image
• Frequency properties of noise
– Fourier spectrum
– Ex. white noise (a constant Fourier spectrum)
Noise probability
density functions
Noises are taken as random variables
Random variables
Probability density function (PDF)
Gaussian Noise
• Math. tractability in spatial and frequency domain
• Electronic circuit noise and sensor noise
1
p( z ) e ( z ) / 2
2 2
2
mean
variance
Note:
p ( z )dz 1
of Noise
Mean Filters
ˆf ( x, y ) 1
Arithmetic Mean
g ( s, t )
mn ( s ,t )S xy
Geometric Mean
1/ mn
ˆf ( x, y) g (s, t )
( s ,t )S xy
Mean Filters
g ( s ,
( s ,t )S xy
t ) Q 1
Q=-1, harmonic
fˆ ( x, y )
g ( s, t ) Q Q=0, airth. mean
( s ,t )S xy Q=+, ?
PSD2B- Digital Image Processing 53
TM
Pepper Salt
Noise Noise
Contra-
Contra- harmonic
harmonic Q=-1.5
Q=1.5
PSD2B- Digital Image Processing 54
TM
5x5
5x5 Geometric
Arith. Mean mean
filter
5x5
5x5
Median Alpha-trim.
Filter
filter
d=5
PSD2B- Digital Image Processing 55
TM
f ( x, y ) A sin( u0 x v0 y )
A u0 v0 u0 v0
F (u, v) j (u , v ) (u , v )
2 2 2 2 2
TM
Bandreject filters
* Reject an isotropic frequency
noisy spectrum
filtered
bandreject
PSD2B- Digital Image Processing 58
TM
Image Segmentation
Thresholding
2. Clustering
Syllabus- Unit 5
Image Compression
• The goal of image compression is to reduce the amount of data
required to represent a digital image.
• Lossy
– Not information preserving
– High compression ratios
Trade-off: information loss vs compression ratio
compression
Compression ratio:
Compression Ratio
Example:
Types of Redundancy
Coding Definitions
Coding Redundancy
• Case 1: l(rk) = constant length
Example:
Interpixel redundancy
• Interpixel redundancy implies that pixel values are
correlated (i.e., a pixel value can be reasonably predicted
by its neighbors).
f ( x) o g ( x) f ( x) g ( x a)da
auto-correlation: f(x)=g(x)
PSD2B- Digital Image Processing 70
TM
Lossy Compression
• Transform the image into some other domain
to reduce interpixel redundancy.
~ (N/n)2 subimages
JPEG Compression
Entropy
encoder
Accepted as
an
international
image
compression
standard in
1992.
JPEG - Steps
1. Divide image into 8x8 subimages.
For each subimage do:
2. Shift the gray-levels in the range [-128, 127]
3. Apply DCT 64 coefficients
1 DC coefficient: F(0,0)
63 AC coefficients: F(u,v)