Vous êtes sur la page 1sur 8

Sobel filter example

Compute Gx and Gy, gradients of the image performing the


convolution of Sobel kernels with the image
Use zero-padding to extend the image
0
30 30 0
-30

10

10

10

10

10

10

10

10

10

10

10

10

10

10

10

Gx

Gy

x
1

-1

-1

-2

-1

-2

-1

hx

hy

40

40

-40

40

40

-40

40

40

-40

30

30

-10 -30 -40 -30

-30

10

30

40

30

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 40 40 0 0

10

10

10

10

10

10

10

10

10

10

10

10

10

10

10

Gx

Gy

x
1

40

40

40

40

40

40

40

40

0
0

-1

-1

-2

-1

-2

-1

hx

hy

Gy
arctan

G
x

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

10

10

10

10

10

10

10

10

10

10

10

10

10

10

10

Gx

-40 -40 -40 -40 -40

Gy

-40 -40 -40 -40 -40


0

x
1

0
0

-1

-1

-2

-1

-2

-1

hx

hy

Gy
arctan

G
x

-/2

-/2

-/2

-/2

-/2
-/2

-/2

-/2

-/2

-/2

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 10 40 30

10

10

10

10

10

10

10

10

10

10

10

10

10

10

10

Gx

10

30

30

10

10

30

30

10

20

30

10

10

10

-10 -20 -10

-10 -30 -30 -10

-40 -30 -10


-30 -10 0
0

-1

-1

-2

-1

-2

-1

hx

hy

-/4

Gy
arctan

G
x

-10 -30 -30 -10 0

Gy

x
1

0
0
-0.15

-/4

-/4

-/4

-/4

-/4

-/4

-/4

-0.35

-/4

-/4

-0.40

-/4

0
0
-0.10
-/4

Laplacian example
Compute the convolution of image I with the Laplacian
kernel
Use border values to extend the image

10

10

10

10

10

10

10

10

10

10

10

10

10

10

10

I
1

-8

Laplacian

10

40

-20

10

30

-30 -10

10

30

-30 -10

40

-30

10

-20 -10

x
Laplacian*I

Erosion example
Erode the image below using kernels S1 and S2
Use border values to extend the image
fS1

x
1

S1

S2

fS2

Dilation example
Erode the image below using kernels S1 and S2
Use border values to extend the image
fS1

x
1

S1

S2

fS2

Dilation-Erosion example
Dilate then erode the image below using kernels S2
Use border values to extend the image
fS2

x
0

S2

(fS2)S2

Vous aimerez peut-être aussi