fast algorithms for binary morphological operations using
TRANSCRIPT
Fast algorithms for binary morphologicaloperations using run-length encoding
Gregor Ehrensperger
Universitat Innsbruck :: Datacon Technology
Workshop Bad Herrenalb15 02 13
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 1
1 Examples
2 Definitions
3 ErosionVariant 1Variant 2
4 Dilation
5 Run-time Analysis
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 2
example 1/4 - barcode
image source: Datacon [email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 3
example 1/4 - barcode
image source: Datacon [email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 3
example 2/4 - bump inspection
image source: Datacon [email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 4
example 3/4 - glue
image source: Datacon [email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 5
example 4/4
image source: http://www.imageprocessingplace.com/[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 6
1 Examples
2 Definitions
3 ErosionVariant 1Variant 2
4 Dilation
5 Run-time Analysis
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 7
binary images
raster graphic:{(0, 0), (0, 1), (0, 2), (1, 2), (1, 3), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 1), (4, 2), (4, 3)}
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 8
binary images
raster graphic:{(0, 0), (0, 1), (0, 2), (1, 2), (1, 3), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 1), (4, 2), (4, 3)}
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 8
erosion and dilation
erosion and dilation
εB(X ) ={p ∈ Z2 | Bp ⊆ X
}
B
XεB(X )
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 9
erosion and dilation
erosion and dilation
εB(X ) ={p ∈ Z2 | Bp ⊆ X
}and δB(X ) =
{p ∈ Z2 | (B t)p ∩ X 6= ∅
}
B
X
δB(X )
εB(X )
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 9
binary images
raster graphic: {(0, 0), (0, 1), (0, 2), (1, 2), (1, 3), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 1), (4, 2), (4, 3)}
run-length encoding:〈0, 2, 0〉 ∪ 〈2, 3, 1〉 ∪ 〈0, 1, 3〉 ∪ 〈3, 4, 3〉 ∪ 〈1, 3, 4〉
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 10
binary images
raster graphic: {(0, 0), (0, 1), (0, 2), (1, 2), (1, 3), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 1), (4, 2), (4, 3)}
run-length encoding:〈0, 2, 0〉 ∪ 〈2, 3, 1〉 ∪ 〈0, 1, 3〉 ∪ 〈3, 4, 3〉 ∪ 〈1, 3, 4〉
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 10
binary images
raster graphic: {(0, 0), (0, 1), (0, 2), (1, 2), (1, 3), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 1), (4, 2), (4, 3)}
run-length encoding:〈0, 2, 0〉 ∪ 〈2, 3, 1〉 ∪ 〈0, 1, 3〉 ∪ 〈3, 4, 3〉 ∪ 〈1, 3, 4〉
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 10
binary images
raster graphic: {(0, 0), (0, 1), (0, 2), (1, 2), (1, 3), (3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (4, 1), (4, 2), (4, 3)}
run-length encoding:〈0, 2, 0〉 ∪ 〈2, 3, 1〉 ∪ 〈0, 1, 3〉 ∪ 〈3, 4, 3〉 ∪ 〈1, 3, 4〉
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 10
1 Examples
2 Definitions
3 ErosionVariant 1Variant 2
4 Dilation
5 Run-time Analysis
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 11
1 Examples
2 Definitions
3 ErosionVariant 1Variant 2
4 Dilation
5 Run-time Analysis
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 12
erosion variant 1 (compare Machado and Hashimoto [2009])
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 13
erosion variant 1 (compare Machado and Hashimoto [2009])
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 13
erosion variant 1 (compare Machado and Hashimoto [2009])
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 13
erosion variant 1 (compare Machado and Hashimoto [2009])
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 13
erosion variant 1 (compare Machado and Hashimoto [2009])
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 13
erosion variant 1 (compare Machado and Hashimoto [2009])
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 13
1 Examples
2 Definitions
3 ErosionVariant 1Variant 2
4 Dilation
5 Run-time Analysis
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 14
erosion variant 2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 15
erosion variant 2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 15
erosion variant 2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 15
erosion variant 2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 15
erosion variant 2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 15
erosion variant 2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 15
erosion variant 2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 15
1 Examples
2 Definitions
3 ErosionVariant 1Variant 2
4 Dilation
5 Run-time Analysis
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 16
dilation
δB(X ) =(
(εBt (X c))c
B
X
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 17
dilation
δB(X ) =(
(εBt (X c))c
B
X
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 17
dilation
δB(X ) =(
(εBt (X c))c
B
X
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 17
dilation
δB(X ) =(
(εBt (X c))c
B
X
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 17
1 Examples
2 Definitions
3 ErosionVariant 1Variant 2
4 Dilation
5 Run-time Analysis
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 18
run-time analysis (1/5)
image source: http://www.imageprocessingplace.com/[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 19
run-time analysis (2/5) - erosion
0 50 100 150 200 250 300
0
500
1000
1500
size of the square-shaped structuring element
run
-tim
e[m
s]
MachadoOpenCVEhren2
0 50 100 150 200 250 300
0
500
1000
1500
size of the diamond-shaped structuring element
run
-tim
e[m
s]
MachadoOpenCVEhren2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 20
run-time analysis (2/5) - erosion
0 50 100 150 200 250 300
0
500
1000
1500
size of the square-shaped structuring element
run
-tim
e[m
s]
MachadoOpenCVEhren2
0 50 100 150 200 250 300
0
500
1000
1500
size of the diamond-shaped structuring element
run
-tim
e[m
s]
MachadoOpenCVEhren2
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 20
run-time analysis (3/5) - dilation
0 50 100 150 200 250 300
0
200
400
600
800
size of the square-shaped structuring element
run
-tim
e[m
s]
dOpenCVdEhren
0 50 100 150 200 250 300
0
500
1000
1500
2000
size of the diamond-shaped structuring element
run
-tim
e[m
s]
dOpenCVdEhren
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 21
run-time analysis (3/5) - dilation
0 50 100 150 200 250 300
0
200
400
600
800
size of the square-shaped structuring element
run
-tim
e[m
s]
dOpenCVdEhren
0 50 100 150 200 250 300
0
500
1000
1500
2000
size of the diamond-shaped structuring element
run
-tim
e[m
s]
dOpenCVdEhren
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 21
run-time analysis (4/5) - circle-shaped SE
0 50 100 150 200 250 3000
2000
4000
6000
size of the circle-shaped structuring element
run
-tim
e[m
s]
OpenCVdOpenCVEhren2dEhren
0 100 200 3000
200
400
size of the circle-shaped structuring element
run
-tim
e[m
s]
Ehren2dEhren
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 22
run-time analysis (4/5) - circle-shaped SE
0 50 100 150 200 250 3000
2000
4000
6000
size of the circle-shaped structuring element
run
-tim
e[m
s]
OpenCVdOpenCVEhren2dEhren
0 100 200 3000
200
400
size of the circle-shaped structuring element
run
-tim
e[m
s]Ehren2dEhren
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 22
run-time analysis (5/5) - circle-shaped SE
0 100 200 300
50
100
150
size of the circle-shaped structuring element
run
-tim
e[m
s]
dist. transf.erode v2
0 100 200 300
100
200
300
size of the circle-shaped structuring element
run
-tim
e[m
s]
dist. transf.dilate
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 23
run-time analysis (5/5) - circle-shaped SE
0 100 200 300
50
100
150
size of the circle-shaped structuring element
run
-tim
e[m
s]
dist. transf.erode v2
0 100 200 300
100
200
300
size of the circle-shaped structuring element
run
-tim
e[m
s]
dist. transf.dilate
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 23
Gregor Ehrensperger. Schnelle Algorithmen zur Berechnung von Erosionund Dilatation auf lauflangenkodierten Binarbildern. Master’s thesis,University of Innsbruck, 2012.
Wook-Joong Kim, Seong-Dae Kim, and Kyuheon Kim. Fast algorithmsfor binary dilation and erosion using run-length encoding. Electronicsand Telecommunications Research Institute Journal, 27(6):814–817,2005. URL http://dx.doi.org/10.4218/etrij.05.0205.0013.
Anderson Fraiha Machado and Ronaldo Fumio Hashimoto. Jump-missbinary erosion algorithm. In SIBGRAPI 2009, Proceedings of the XXIIBrazilian Symposium on Computer Graphics and Image Processing,Rio de Janeiro, Brazil, 11-15 October 2009, pages 149–155. IEEEComputer Society, 2009.
[email protected] G. Ehrensperger Fast algorithms for morphological operations using RLE 24