Parent Topic: Filter

Prewitt 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 Prewitt gradient value as shown below:

Templates:

 -1  0  1      
 -1  0  1    X
 -1  0  1

  1  1  1
  0  0  0    Y
 -1 -1 -1

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 - 1*a4 + 1*a6 - 1*a7 + 1*a9

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

Prewitt 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