Raster to Vector Conversion - PowerPoint PPT Presentation

1 / 32
About This Presentation
Title:

Raster to Vector Conversion

Description:

to preserve connectivity. 1 1 1. 2 2 2. 3 3 3 - What we can say about this pattern? 1 1 1 ... PK ={(xK,1,yK,1),..., (xK,n,yK,nK)} {Q1, Q2, ..., QK} 4. How to ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 33
Provided by: Jus6
Category:

less

Transcript and Presenter's Notes

Title: Raster to Vector Conversion


1
DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF
JOENSUU JOENSUU, FINLAND
  • Raster to Vector Conversion

2
Raster-to-Vector conversion
Raster data
Vectorization
Vector data
Raster map 4400?4100
3
History
? Digitizing with a tablet operator manually
traces all the lines from his hardcopy map
using a pointer device. Very slow
10-20 days for complex map Accuracy
40 DPI ? Heads-up digitizing operator traces
lines on the computer screen using the
scanned raster image as background.
Accuracy gt 200 DPI ? Interactrive tracing
automatic tracing an individual line under
the guidance of the operator ? (Semi?) Automatic
conversion
4
Three steps of raster-to-vector conversion
x





5
Scheme of raster-to-vector conversion
.
Binarization
Thinning
Vectorization (tracingapproximation)
Analysis Interpretation
6
1. Binarization with global threshold
.
a)
b)
7
1. Binarization with local threshold
Image
Global binarization
Locally adaptive binarization
8
1. Partition of input image into blocks
50x50
150x150
9
1. Locally adaptive thresholding
Input image
Binary image
Thr
Histogram
10
1. Block with a small object a
Input image
Binary image
Thr
Histogram
11
1. Block with a small object b
Input image
Binary image
Thr
Filtering
Histogram
12
1. Masking of image for histogram calc.
Input image
13
1. How to detect empty blocks?
Non-empty block
Thr
Empty block
Thr
If ? lt Thr block is empty
14
1. What to do with the empty blocks?
15
1. Local threshold for point (x,y)
Bilinear interpolation from 4 neigbouring blocks
16
2. Vectorization How to do?


1) Thinning-based methods 2) Contour-based
methods 3) Graph-structure based methods 4)
Orthogonal zig-zag methods
17
2. Thinning-based vectorization
skeletonization

Vectorization (tracing approximation)
18
2. Thinning by iterative shrinking
- black pel - black/white pel
- white pel
Thinning is an iterative shrinking process each
contour pixel is analysed. If certain criteria
are satisfied, that pixel is deleted. Pixels
removal continues until no changes.

Number of iterations width_max/2
19
2. Distance Transform-based algorithm 1 run
1st run Detect skeletal points
0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
3 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3
3 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0
3 3 3 4 4 4 3 3 3
- as local maximum
0 1 0 1 1 1 2 2 2
- to preserve connectivity
1 1 1 2 2 2 3 3 3
- What we can say about this pattern?
1 1 1 2 2 2 3 3 3
- The central point is supposed to be the
skeletal one.
20
2. DT-based skeletonization algorithm 1 run
1st run Detect skeletal points
0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
3 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3
3 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0
3 3 3 4 4 4 3 3 3
- as local maximum
0 1 0 1 1 1 2 2 2
- to preserve connectivity
1 1 1 2 2 2 3 3 3
- What we can say about this pattern?
1 1 1 2 2 2 3 3 3
- Central point is supposed to be the skeletal
one.
21
2. DT-based skeletonization algorithm 2 run
2nd run Restore connectivity
0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
3 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3
3 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0
3 3 3 2 2 2 1 1 1
4 4 4 3 3 3 2 2 2
22
2. DT-based skeletonization algorithm 2 run
2nd run Restore connectivity
0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3
3 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3
3 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0
3 3 3 2 2 2 1 1 1
3 3 3 2 2 2 1 1 1
4 4 4 3 3 3 2 2 2
4 4 4 3 3 3 2 2 2
23
2. Distance Transform-based algorithm
1st run top-down, left right
2nd run bottom-up, right-left
Number of runs Iterative shrinking
width_max/2 DT-based skeletonization 2
24
2. DT skeleton for different metrics
a) b)
c) d)


a) Binary image (w9) Skeleton for the metrics
b) Chessboard c) Euclidean d) City-block.
25
3. Presentation of skeletal lines chain code
2
1
3
P
4
0
y1
7
5
6
x1
Chain code C01110111212111210707777767666666
Digitized curve P (x1,y1), (x2,y2),
(x3,y3),..., (xn,yn)
26
3. Tracing of skeletal lines with LUT
Ck1 LUTSCk
S 0000101012 2110 Ck1 LUT211 7 Ck1
LUT213 5
S 0000111002 2810 Ck1 LUT281 0 Ck1
LUT284 5
27
3. Start and End of digitized curve
Start of curve(s)
End
Crossroad
If (Start_of_curve) is detected, Start tracing
the curve. If (Crossroad or End_of_curve) is
detected, Stop the tracing.
28
3. Partition of the skeleton into digitized curves

29
4. Polygonal approximation of digitized curves

P1 (x1,1,y1,1),..., (x1,n,y1,n1) P2
(x2,1,y2,1),..., (x2,n,y2,n2)
PK (xK,1,yK,1),..., (xK,n,yK,nK)
Q1, Q2, , QK
30
4. How to control approximation?
?Error tolerance ? lt width/2
31
Summary
1. Locally adaptive binarization 2. Thinning 3.
Tracing 4. Polygonal approximation (jatkuu)
32
References
1 S.Ablameyko, T.Pridmore, Machine
interpretation of line drawing images,
Springer, 2000. 2 A.Kolesnikov, Efficient
algorithms for vectorization and polygonal
approximation, PhD Thesis, CS Dept, University of
Joensuu, 2003. (list of references)
Write a Comment
User Comments (0)
About PowerShow.com