Sobel Operator - Technical Details

Technical Details

As a consequence of its definition, the Sobel operator can be implemented by simple means in both hardware and software: only eight image points around a point are needed to compute the corresponding result and only integer arithmetic is needed to compute the gradient vector approximation. Furthermore, the two discrete filters described above are both separable:

\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 \\
1
\end{bmatrix} * \begin{bmatrix}
1 \\
1
\end{bmatrix} \begin{bmatrix}
-1 & 1
\end{bmatrix} * \begin{bmatrix}
1 & 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} = \begin{bmatrix}
1 \\
1
\end{bmatrix} * \begin{bmatrix}
-1 \\
\ \ 1
\end{bmatrix} \begin{bmatrix}
1 & 1
\end{bmatrix} * \begin{bmatrix}
1 & 1
\end{bmatrix}

and the two derivatives Gx and Gy can therefore be computed as


\mathbf{G}_x = \begin{bmatrix}
1 \\
2 \\
1
\end{bmatrix} * \left ( \begin{bmatrix}
-1 & 0 & 1
\end{bmatrix} * \mathbf{A} \right )
\quad \mbox{and} \quad
\mathbf{G}_y = \begin{bmatrix}
-1 \\
\ \ 0 \\
\ \ 1
\end{bmatrix} * \left ( \begin{bmatrix}
1 & 2 & 1
\end{bmatrix} * \mathbf{A} \right )

In certain implementations, this separable computation may be advantageous since it implies fewer arithmetic computations for each image point.

Applying convolution K to pixel group P can be represented in pseudocode as:

N(x,y) = Sum of { K(i,j).P(x-i,y-j)}, for i,j running from -1 to 1. N(x,y) represents the new matrix resulted after applying the Convolution K to P. where P is pixel matrix.

Read more about this topic:  Sobel Operator

Famous quotes containing the words technical and/or details:

    The best work of artists in any age is the work of innocence liberated by technical knowledge. The laboratory experiments that led to the theory of pure color equipped the impressionists to paint nature as if it had only just been created.
    Nancy Hale (b. 1908)

    If my sons are to become the kind of men our daughters would be pleased to live among, attention to domestic details is critical. The hostilities that arise over housework...are crushing the daughters of my generation....Change takes time, but men’s continued obliviousness to home responsibilities is causing women everywhere to expire of trivialities.
    Mary Kay Blakely (20th century)