Title: Chapter 2: Digital Image Fundamentals
1Chapter 2 Digital Image Fundamentals
University of Joensuu Image Processing and
Analysis Lecture 1 Digital Image
Fundamentals Alexander Kolesnikov 29.10.2009
2Image formation in the eye
3Chapter 2 Digital Image Fundamentals
4Image formation in the eye
- A sensor detects energy radiated by a band of
the - electro-magnetic spectrum and converts it into
electrical - signal.
- Sensor has a material that is responsive to the
particular - type of energy being detected.
5Image sensing and acquisition
6Image sensing and acquisition
- Image is generated by energy of the illumination
- source reflected (natural scenes) or transmitted
through objects (X-ray).
7Image sensing and acquisition
8Image sensing and acquisition
9Spatial Sampling and Quantiization
10Sampling and Quantization
- Image f(x,y) must be digitized both spatially
- and in amplitude.
- Digitization in spatial coordinates sampling
- Digitization in amplitude quantization
- The number of gray levels G2k
- k1 binary image
- k8 grayscale image
- k10-16 medical images (X-ray, CT, MRI,etc.)
11Quantization
12Sampling and Quantization
13Chapter 2 Digital Image Fundamentals
f(x,y)
14Effects of reducing spatial resolution
15Effects of reducing spatial resolution
16Effects of reducing gray levels
G12827
G256 28
G6426
G3225
17Effects of reducing gray levels
G823
G1624
G221 (binary image)
G422
18Level of details
Spatial frequency, image spectrum (more later
...)
19Zooming of 1-D signal
20Zooming by pixel replication
- Pixel replication (zero-order interpolation)
- Interpolated pixel in the enlarged image is
set to - the gray level of its nearest in the original
image. -
21 and by bilinear interpolation
- Interpolated pixel in the enlarged image is
set to the weighted sum of its four nearest
pixels in the original image.
22Bilinear interpolation
23Example of interpolation
Pixel repetition
Bilinear interpolation
24Shrinkage
- Shrinking an image by skipping pixels
- Shrinkage by an integer number can be done by
- deleting some of the rows and columns of the
image - Shrinkage by a non-integer number also can be
done - by deleting some of the rows and columns of the
image. - Moire effect, what is it?
- How to supress the Moire effect?
25Moire effect
Subsampling of sine signal by samples skipping
Result of the subsampling.
Aliasing - leakage of high frequency component of
the signal into low freqency domain.
26Anti-aliasing filter
- Shrinking an image with smoothing
- Apply anti-aliasing filter before the shrinking
to - suppress the high frequency component and
reduce - the effect.
- In simple words, smooth (blur) the image before
pixels - skipping.
27Image difference measure
MSE PSNR SNR MAE
28Image difference measure
MSE Mean Squared Error for images f and g
29Image difference measure
PSNR Pulse-Signal-Noise-Ratio
fpeak is the maximum possible pixel value of the
image (fpeak255).
and
30Image difference measure
SNR Signal-Noise-Ratio
Variance of f
Mean value of f
MSE
31Image difference measure
MAE Mean Absolute Error for images f and g
32Relationship between pixels
Neighborhood Adjacency Connectivity
Region Boundary Distance
33Neighborhood
A pixel P at coordinates (x,y) has four
horizontal and vertical neighbors N4(P)
(x1,y), (x-1,y),(x,y1),(x,y-1) ND(P)
(x1,y1), (x-1,y-1),(x-1,y1),(x1,y-1) N8(P)
N4(P) U ND(P)
34Connectivity
4-connectivity Pixels are connected if their
edges touch. This means that a pair of adjoining
pixels are part of the same object only if they
are both on and are connected along the
horizontal or vertical direction. 8-connectivity
Pixels are connected if their edges or corners
touch. This means that if two adjoining pixels
are on, they are part of the same object,
regardless of whether they are connected along
the horizontal, vertical, or diagonal direction.
35Adjacency
36Adjacency
37M-adjacency
38Region Boundary
(4- or 8-connected?)
39Distance measure
40Distance measure
- L1, D4 , City-block distance
- D(p1,p2)x1 - x2 y1 - y2
- L?, D8, Chessboard, Chebyshev distance
- D(p1,p2)maxx1 - x2, y1 - y2
-
- L2, De, Euclidean distance
- D(p1,p2)((x1 - x2)2 (y1 -
y2)2)1/2
41Distance measure
2 1 2 1 0 1 2 1 2
- L1, City-block, or D4 distance
- L?, Chessboard, Chebyshev, or D8 distance
- L2, or Euclidean distance
1 1 1 1 0 1 1 1 1
?2 1 ?2 1 0 1 ?2 1 ?2
42Distance Transform
43Distance Transform
(more later)
44Relationship between pixels
45Adjacency
46Adjacency for binary images
How many objects? One or four? How many holes?
47Adjacency for binary images
Connectivity for object and background pixels
should be different! Otherwise we have
topological paradox. See more in the book of
Sonka, Hlavac and Boyle.
48Adjacency for multi-level images
49Connectivity for multi-valued images
a b
c
How many objects? How many holes?
50Connectivity
a b c
d e
How many objects?