Professional Documents
Culture Documents
Sobel-Erosion-Dilation Examples PDF
Sobel-Erosion-Dilation Examples PDF
1 0 -1 -1 -2 -1
2 0 -2 0 0 0
1 0 -1 1 2 1
1
hx hy
1 0 -1 -1 -2 -1 0 0
2 0 -2 0 0 0 0 0
Gy
1 0 -1 1 2 1 Θ = arctan 0 0
Gx 0 0 2
hx hy
0 0
Sobel filter example
• Compute Gx and Gy, gradients of the image performing the
convolution of Sobel kernels with the image
• Use border values to extend the image 0 0 0 0 0
0 0 0 0 0
0 0 0 0 0 Gx 0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
10 10 10 10 10
0 0 0 0 0
10 10 10 10 10 -40 -40 -40 -40 -40
y Gy -40 -40 -40 -40 -40
10 10 10 10 10
0 0 0 0 0
x 0 0 0 0 0
1 0 -1 -1 -2 -1
2 0 -2 0 0 0
Gy
-π/2 -π/2 -π/2 -π/2 -π/2
Gx 3
hx hy
1 0 -1 -1 -2 -1 -π/4 -0.15π -
0.10π
2 0 -2 0 0 0 -π/4 -π/4 -π/4 -π/4
Gy
1 0 -1 1 2 1 Θ = arctan -π/4 -π/4 -π/4 -π/4
0 0 0 0 10
0 0 10 40 -20
0 0 0 10 10
0 10 30 -30 -10
0 0 10 10 10
10 30 -30 -10 0
0 10 10 10 10
40 -30 10 0 0
y 10 10 10 10 10 y -20 -10 0 0 0
x I
x
1 1 1 Laplacian*I
1 -8 1
1 1 1
5
Laplacian
Erosion example
• Erode the image below using kernels S1 and S2
• Use border values to extend the image
fӨS1
0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 0 1 1 0 0 0 0 0
0 0 1 1 1 0 0 0 0 0
0 1 0 0 1 0 0 0 0 0
y 1 1 1 1 1
0 0 0 0 0
x
0 0 0 0 1
1 1 1 0 1 0 0 0 0 0 1
1 1 1 1 1 1 fӨS2
0 0 0 0 0
1 1 1 0 1 0
0 1 0 0 1
S1 S2 6
Dilation example
• Erode the image below using kernels S1 and S2
• Use border values to extend the image
fӨS1
0 0 1 1 1
0 0 0 0 1 0 1 1 1 1
0 0 0 1 1 1 1 1 1 1
0 0 1 1 1 1 1 1 1 1
0 1 0 0 1 1 1 1 1 1
y 1 1 1 1 1
0 0 0 1 1
x
0 0 1 1 1
1 1 1 0 1 0 0 1 1 1 1
1 1 1 1 1 1 fӨS2
1 1 1 1 1
1 1 1 0 1 0
1 1 1 1 1
S1 S2 7
Dilation-Erosion example
• Dilate then erode the image below using kernels S2
• Use border values to extend the image
fӨS2
0 0 0 1 1
0 0 0 0 1 0 0 1 1 1
0 0 0 1 1 0 1 1 1 1
0 0 1 1 1 1 1 1 1 1
0 1 0 0 1 1 1 1 1 1
y 1 1 1 1 1
0 0 0 0 1
x
0 0 0 1 1
0 1 0 0 0 1 1 1
1 1 1 (fӨS2)ӨS2
0 1 1 1 1
0 1 0
1 1 1 1 1
S2 8