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:

    Woman is the future of man. That means that the world which was once formed in man’s image will now be transformed to the image of woman. The more technical and mechanical, cold and metallic it becomes, the more it will need the kind of warmth that only the woman can give it. If we want to save the world, we must adapt to the woman, let ourselves be led by the woman, let ourselves be penetrated by the Ewigweiblich, the eternally feminine!
    Milan Kundera (b. 1929)

    There was a time when the average reader read a novel simply for the moral he could get out of it, and however naïve that may have been, it was a good deal less naïve than some of the limited objectives he has now. Today novels are considered to be entirely concerned with the social or economic or psychological forces that they will by necessity exhibit, or with those details of daily life that are for the good novelist only means to some deeper end.
    Flannery O’Connor (1925–1964)