Fundamentals-Lect-2
Fundamentals-Lect-2
Week-02
1
Contents
• Image Resolution
• Relationship between pixels
• Connectivity
• Connected Component Analysis
• Image Enhancement
Spatial & Gray Level Resolution
Spatial Resolution
4
Spatial Resolution
5
Intensity Level Resolution
Intensity level resolution refers to the number of intensity levels used to represent the
image
◼ The more intensity levels used, the finer the level of detail in
an image
◼ Intensity level resolution is usually given in terms of the
number of bits used to store each intensity level
6
Intensity Level Resolution
Number of Intensity
Number of Bits Examples
Levels
1 2 0, 1
2 4 00, 01, 10, 11
4 16 0000, 0101, 1111
8 256 00110011, 01010101
16 65,536 1010101010101010
7
Intensity Level Resolution
8
Intensity Level Resolution
256 grey levels (8 bits per pixel) 128 grey levels (7 bpp) 64 grey levels (6 bpp) 32 grey levels (5 bpp)
16 grey levels (4 bpp) 8 grey levels (3 bpp) 4 grey levels (2 bpp) 2 grey levels (1 bpp)
9
Resolution: How much is enough?
10
Resolution: How much is enough?
11
Relationships between pixels
y-1 y y+1
x-1
x
x+1
12
4- Neighbors of a Pixel –N4(p)
x
x+1
13
Diagonal Neighbors of a Pixel –ND(p)
y-1 y y+1
x-1
x
x+1
14
8- Neighbors of a Pixel –N8(p)
y-1 y y+1
x-1
x
x-1
N8 ( p ) = N 4 ( p ) N D ( p )
(x-1,y), (x+1,y), (x, y-1), (x, y+1)
(x-1,y-1), (x+1,y-1), (x-1, y+1), (x+1, y+1)
15
Determine different regions in the
image
16
Connectivity
Establishing boundaries of objects and components in an image
Group the same region by assumption that the pixels being the same
color or equal intensity
Two pixels p & q are connected if
◼ They are adjacent in some sense
◼ If their gray levels satisfy a specified criterion of
similarity
17
Connectivity
V: Set of gray levels used to define the criterion of similarity
4-connectivity
18
Connectivity
V: Set of gray levels used to define the criterion of similarity
8-connectivity
19
Connectivity
V: Set of gray levels used to define the criterion of similarity
If gray level
20
Example: m – Connectivity
Note: Mixed connectivity can eliminate the multiple path connections that often
occurs in 8-connectivity
21
Paths
Path: Let coordinates of pixel p: (x, y), and of pixel q: (s, t)
22
Test Yourself
Distance Metrics
24
City block distance (D4 distance)
D4 ( p, q) = x − s + y − t
25
Chessboard distance (D8 distance)
D8 ( p, q) = max( x − s , y − t )
26
Euclidean Distance
De ( p, q) = ( x − s)2 + ( y − t )2
q(s,t)
p(x,y)
30
CC labeling – 4 Connectivity
31
CC labeling – 4 Connectivity
32
CC labeling – 8 Connectivity
33
CC labeling – 8 Connectivity
Background pixel
Background pixel
Unlabeled Pixel
Unlabeled Pixel
Label 1
34
CC labeling – 8 Connectivity
Label 3
35
CC labeling – 8 Connectivity
36
CC labeling – 8 Connectivity
Label 1 Label 1
Label 2 Label 2
Label 3 Label 3
37
CC labeling – 8 Connectivity
38
Image Enhancement
39
Image Enhancement
40
Image Enhancement
Process an image so that the result is more suitable than the original image for a
specific application
41
Types of image enhancement
operations
Point/Pixel operations
Output value at specific coordinates
(x,y) is dependent only on the input
value at (x,y)
Local operations
The output value at (x,y) is dependent
on the input values in the
neighborhood of (x,y)
Global operations
The output value at (x,y) is dependent
on all the values in the input image
42
Basic Concepts
Most spatial domain enhancement
operations can be generalized as:
g ( x, y) = T f ( x, y)
43
Point Processing
s = T (r )
◼ r = gray level of f at (x,y)
◼ s = gray level of g at (x,y)
45
Point Processing using Look-up Tables
A look-up table (LUT)
implements a functional
mapping.
255
101 64
102 68
127
103 69
104 70
105 70
106 71
0
46
Point Processing using Look-up Tables
input output
...0 ... 0
cell index
contents
64
a pixel with ... ...32 is mapped to
this value this value
128 128
... ...
192 224
... ...
255 255
47
POINT PROCESSING
48
Point Processing Example:
Thresholding
49
Point Processing Example:
Thresholding
Segmentation of an object of interest from a
background
50
Point Processing Example:
Intensity Scaling
s = T (r ) = a.r
51
Point Processing Transformations
There are many different kinds of grey level
transformations
Three of the most
common are shown
here
◼ Linear
⚫ Negative/Identity
◼ Logarithmic
⚫ Log/Inverse log
◼ Power law
52
Point Processing Example:
Negative Images
Reverses the gray level order
For L gray levels, the transformation has the
form:
s = ( L − 1) − r
Negative images are useful for enhancing white or grey detail embedded in
dark regions of an image
53
Point Processing Example:
Negative Images
54
Today’s Learning Outcomes
• Image resolution is purely dependent on the
type of application and available resources
• Relationship between pixels is important
• Connected component analysis is one of the
fundamental concept in image analysis
• Basic transformations functions can be used for
image enhancement
What's Next
• Mathematical Transformation
• Histograms
Readings from Book (4th Edn.)
• Chapter – 2
• Chapter 3.1
Acknowledgements
Statistical Pattern Recognition: A Review – A.K Jain et al., PAMI (22) 2000
Pattern Recognition and Analysis Course – A.K. Jain, MSU
Material in these slides has been taken from, the following resources
58