Gradient Filtering

The gradient filtering operation is an edge detector which computes the magnitude of the image gradient vector in two orthogonal directions. The operation may be defined as:

where Gx and Gy are the horizontal and vertical gradient images generated from the source image by correlating it with the supplied orthogonal (horizontal and vertical) gradient masks (Kx and ky).

Sobel

Kx =
1 0 -1
2 0 -2
1 0 -1
  Ky =
-1 -2 -1
0 0 0
1 2 1

Roberts

Kx =
0 0 -1
0 1 0
0 0 0
  Ky =
-1 0 0
0 1 0
0 0 0

Prewitt

Kx =
1 0 -1
1 0 -1
1 0 -1
  Ky =
-1 -1 -1
0 0 0
1 1 1

Freichen

Kx =
1 0 -1
1.414 0 -1.414
1 0 -1
  Ky =
-1 -1.414 -1
0 0 0
1 1.414 1

 

See also:

Image Factory, Classic Filtering