2.1.4. Technical Details

As follows from the definition, the Sobel operator can be implemented by simple hardware and software. Approximating the vector gradient requires only eight pixels around point *x* of the image and integer arithmetic. Moreover, both discrete filters described above can be separated:

$$
\begin{bmatrix} 1 & 0 & -1 \\ 2 & 0 & -2 \\ 1 & 0 & -1 \end{bmatrix} = \begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & -1 \end{bmatrix}
$$

$$
\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ -1 & -2 & -1 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix} \begin{bmatrix} 1 & 2 & 1 \end{bmatrix}
$$

and two derivatives, Gx and Gy, can now be calculated as

$$\mathbf{G}\_{\mathbf{x}} = \begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix} \cdot \begin{bmatrix} 1 & 0 & -1 \end{bmatrix} \cdot A ; \; \mathbf{G}\_{\mathbf{y}} = \begin{bmatrix} 1 \\ 0 \\ -1 \end{bmatrix} \cdot \left( \begin{bmatrix} 1 & 2 & 1 \end{bmatrix} \cdot A \right)$$

The resolution of these calculations can reduce the arithmetic operations with each pixel.
