Parent Topic: Filter

Sobel Edge Detector Filter

This filter creates an image where edges (sharp changes in grey level values) are shown. Only a 3x3 filter size can be used with this filter.

This filter uses two 3x3 templates to calculate the Sobel gradient value as shown below:

Templates:

-1  0  1       1  2  1
-2  0  2       0  0  0
-1  0  1      -1 -2 -1

    X             Y

Apply the templates to a 3x3 filter window.

        a1 a2 a3
        a4 a5 a6        3x3 filter window
        a7 a8 a9
where a1 .. a9 are grey levels of each pixel in the filter window.

X = -1*a1 + 1*a3 - 2*a4 + 2*a6 - 1*a7 + 1*a9

Y = 1*a1 + 2*a2 + 1*a3 - 1*a7 - 2*a8 - 1*a9

Sobel Gradient = sqrt(X*X + Y*Y)

NOTE: In order to filter pixels located near the edges of the image, edge pixel values are replicated to give sufficient data.


Parent Topic: Filter
About PCI Help Gateway