PreviousNext

Theory of Operation

This filter tool processes an input region by replacing each pixel with a function of its neighbors. The typical neighborhood is a 9-pixel neighborhood labeled:

a b c

d e f

g h i

The gradients along the x- and y- coordinates:

  • GradientX = ((c + 2f + i) - (a + 2d + g)) / variable

Where variable can be 1, 2, 4, or 8.

  • GradientY = ((g + 2h + i) - (a + 2b + c)) / variable

Where variable can be 1, 2, 4, or 8.

The various combinations of the magnitude and angle of the gradients:

  • Magnitude = sqrt(sqr(GradX) + sqr(GradY))
  • Angle = arctan(GradY/GradX) scaled from 0 to 360 into 0 to 255
  • Qualified Angle - Is the Angle divided by 2 (right-shifted by 1). If, at a pixel point, the Magnitude is greater than a specified threshold, noted as Magnitude Qualification, then the highest bit of the Qualified Angle is set to 1. Therefore, a qualified angle at a qualified point is a value between 128 and 255. For non-qualified points, the qualified angle value is below 128.
  • Absolute Gradient-X - Absolute value of the GradientX.
  • Absolute Gradient-Y - Absolute value of the GradientY.
  • 3-Bit Mag & 5-bit Ang - Is a combination of 3-bit magnitude and 5-bit angle. The placement of these bits are shown in Figure 13-12.

FIGURE 13-12. 

Magnitude and Angle Bit Placement

  • 4-Bit GradX & 4-Bit GradY - Is a combination of 4-bit Grad-X and 4-bit Grad-Y. The placement of these bits are shown in Figure 13-13.

FIGURE 13-13. 

4 Bit Grad-X and 4 Bit Grad-Y


PreviousNext