Professional Documents
Culture Documents
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
fS1
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 fS2
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
fS1
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 fS2
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
fS2
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 (fS2)S2
0 1 1 1 1
0 1 0
1 1 1 1 1
S2 8