Title: Today:
1EE545 Image Processing
- Today
- Image Formation Physics, image tesselation
- Binary Image Processing
- Transformations on image coordinates
2EE545 Image Processing
- 2D Image I (r,c) size N x M
- Digital Image Processing Improving and
transforming pictorial information - Computer Vision Processing of Images to extract
information about the world
c
I
r
3Examples of Image Processing
4Examples of Image Processing
5Image formation
- How is the image obtained ?
- A simple (but unrealistic) model
- Orthographic (parallel) projection
6Image formation
- A more realistic model
- Perspective projection (using pinhole model)
7Perspective Images of Renaissance Painters
The Scholar of Athens, Raffaello Sanzio
(Rafael), 1518
8Pinhole
9Image formation Brightness
10Image formation Lenses
11Image formation Sampling Image Space
- The Image pixels can be tiled with three regular
polygons
Rectangular
Triangular
Hexagonal
12Binary Image Processing(Two levels for pixel
values)
- Gray Level Image (8 bit/pixel) Histogram
of pixels
0 (white)
255 (black)
TThreshold if I(r,c)gtT I(r,c)255 else
I(r,c)0
13Adjacency in rectangular sampling
4-adjacent pixels
8-adjacent pixels
p
p
8 path
4 path
14Foreground/Background paradoxes for binary images
8-8 connectivity for fg-bg
4-4 connectivity for fg-bg
Foreground Closed loop Background No hole
(problem)
Foreground No closed loop Background Hole
(problem)
Solution Use 8-4 or 4-8 connectivity for fg-bg
No such problems for hexagonal tessellation !
15Distance
D r
D c
Euclidian distance Manhattan distance Chess-boar
d distance
16First Binary Image Processing Algorithm
Connected Component (CC) Labeing
- 8 connected component Maximal set of 1's for
which all pairs of 1's in S are 8 connected by an
8 path in S. - Connected component labeling (Iterative
algorithm) - P gets its label from one of its neighbors
- Top/down Bottom/up passes
p
p
17Binary Image Processing
- Connected component labeling (using memory)
- Examples
N
j
a
b
c
abcd0 then L(p)iNj
p
d
i
M
1
0
1
1
0
1
0
1
0
0
1
0
0
1
1
1
1
1
1
0
L(p)L(a) L(c)L(a)
L(p)L(a) L(d)L(c)L(a)
L(d)L(b)
Assignments
L(p)L(b) L(d)L(b)
Equivalences
18Representation of Binary Images
- Matrices I(r,c)
- Chains
- Run length coding
7
5
6
p
0
4
2
3
1
021244567
Boundary following algorithm Start from the
first pixel in the scan order
Look for a border pixel at box 0,1,2,3
Do the same for the new pixel until
the first pixel is reached
0 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 0 1
The code is ((11144)(214)(52355))
19Representation of Binary Images
- Hierarchical data structures
- Pyramids
- Quadtrees
Level 0
Level 1
Level 2
Pixel at Level k Average of pixels at Level
(k1)
11
10
0
0
2
3
13
10
11
13
2
3
120
121
122
123
20Binary Image ProcessingRegion Properties of
CCs
- Area
- Centroid
- Eulers number (genus)
,
C of connected components H of holes
21Binary Image ProcessingRegion Properties of
CCs
- Perimeter (P) of boundary pixels
- Compactness (A circle is the
most compact figure) - Moments
- Central moments
Where the centroid can be found as
,
22Binary Image ProcessingRegion Properties of CCs
- Direction
- Rectangularity Area of bounding rectangle
Area of the object
23Binary Image Processing
- Objects (or their parts) are represented by
isolated connected components - Main applications Document processing, Character
recognition, Cell counting, - Several descriptors of an object can be extracted
from an image (size, centroid position, of
holes, perimeter, compactness, dominant
direction, horizontal/vertical/diagonal
projections )
241D Projections on Binary Images
Vertical
Horizontal
Diagonal
25Binary Image Processing
- In practice binary
- images (obtained by
- thresholding) need
- conditioning
- The tools necessary
- for conditioning are
- provided by
- Mathematical Morphology
Noisy
Conditioned
26Mathematical Morphology
- mathematical framework used for
- pre-processing
- noise filtering, shape simplification, ...
- enhancing object structure
- skeletonization, convex hull...
- segmentation
- watershed,
- quantitative description
- area, perimeter, ...
27Structuring element (SE)
- small set to probe the image under study
- for each SE, define origo
- SE in point p origo coincides with p
- shape and size must be adapted to geometric
properties for the objects
28Basic idea
- in parallel for each pixel in binary image
- check if SE is satisfied
- output pixel is set to 0 or 1 depending on used
operation
pixels in output image if check is SE fits
29Basic morphological operations
shrink
- erosion
- dilation
- combine to
- opening
- closening
grow
- keep general shape but smooth with respect to
- object
- background
30Mathematical Morphology
- An algebraic system of operators
- Complex shapes can be decomposed into meaningful
parts - Set theory notation (AImage points
BOperator points) - Dilation where
- Erosion
- Opening Closing
31Mathematical MorphologyDilation
32Dilation (example 3)
SE
33Dilation (example 4)
SE
34Mathematical MorphologyErosion
35Erosion
SE
36Erosion
SE
37(No Transcript)
38Mathematical MorphologyDilation and Erosion
Dilation and Erosion by
39- Erosion is useful for
- removal of structures of certain shape and size,
given by SE - Dilation is useful for
- filling of holes of certain shape and size,
- given by SE
Combining erosion and dilation
WANTED remove structures / fill holes without
affecting remaining parts
SOLUTION combine erosion and dilation (using
same SE)
40Mathematical MorphologyOpening and Closing
Opening and Closing by Opening Closing
41Opening roll ball(SE) inside object
see B as a rolling ball
boundary of AB points in B that reaches
farthest into A when B is rolled inside A
42Closing roll ball(SE) outside object
see B as a rolling ball
boundary of A?B points in B that reaches
farthest into A when B is rolled outside A
43(No Transcript)
44Mathematical MorphologyApplication (An example)
- Computing the genus ( of CCs - of holes)
45An application example (of MM) Isolating IC pins
46MM ApplicationConditioning fingerprint images
2. dilate (A?B)?B AB
4. erode ((AB)?B)?B (AB)?B
3. dilate (AB)?B
47Imaging Geometry
- The motion of a camera can be modeled by
geometric transformations
?
Affine Transformations
Perspective Tr.
(Orthographic camera model)
(Perspective camera model)
48Projective models for Camera Motion
Where and are old
and new coordinates
of a pixel
49Affine Transformation
- is the translation component
- A?
Scale Rotation
Vertical Shear
Horizontal Shear
Altered Aspect Ratio
50Affine and Perspective Transformations in matrix
form (in Homogenous Coordinates)
- Affine Transformation
- Perspective Transformation
51Perspective Transformations
- Another form Homographies
Note 6 unknowns for affine transformations
8 unknowns for perspective transformations
52Forward vs Backward mapping
Scan the input image, find new coordinates,
assign pixel value
Scan the output image, find old coordinates,
assign pixel value
53Interpolation (in gray level images)
- Forward mapping produces holes
- Backward mapping of a pixel produces
1
- Nearest Neighbor Interpolation
- p gets its value from the nearest pixel
- Bilinear Interpolation
- p gets its value from the plane on top of 4
- neighboring pixels
u
220
150
v
1
p
220
150
p
100
60
100
NNI p150 BI pp1(1-v)p2(v)
where p1 220(1-u)150(u)
p2100(1-u)60(u)
60