Skip to main content
added details
Source Link
Laurent Duval
  • 32.3k
  • 3
  • 35
  • 105

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth lightsmall variations or noise.

One direction implements the shortest possible centered 1D discrete derivative:

$$\begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ to detect variations across lines, the other the shortest non-trivial Pascal/Gaussian smoothing $$\begin{bmatrix} 1&2&1 \end{bmatrix} $$$$\begin{bmatrix} 1&2&1 \end{bmatrix}^T $$ to smooth along linescolumns, resulting in, for instance: $$ \begin{bmatrix} 1&2&1 \end{bmatrix}^T\cdot \begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ or $$ \begin{bmatrix} -1 &0 &1 \\ -2 &0 &2 \\ -1 &0 &1 \\ \end{bmatrix} $$

As you can see, this only involves dyadic numbers, so it can be implemented with adds and binary shifts.

Of course, the 3-point derivative often has an additional $1/2$ factor: $$\begin{bmatrix} -1/2 &0 &1/2 \end{bmatrix} $$ to get the appropriate scale factor, and the Pascal smoother has a $1/4$ factor to have its coefficients sum to one $$\begin{bmatrix} 1/4&1/2&1/4 \end{bmatrix} $$ but the resulting global scaling of $1/2\times 1/4$ does not change the edge detection power for such linear filters.

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth light variations or noise.

One direction implements the shortest possible centered 1D discrete derivative:

$$\begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ to detect variations across lines, the other the shortest non-trivial Pascal/Gaussian smoothing $$\begin{bmatrix} 1&2&1 \end{bmatrix} $$ to smooth along lines, resulting in, for instance: $$ \begin{bmatrix} -1 &0 &1 \\ -2 &0 &2 \\ -1 &0 &1 \\ \end{bmatrix} $$

As you can see, this only involves dyadic numbers, so it can be implemented with adds and binary shifts.

Of course, the 3-point derivative often has an additional $1/2$ factor: $$\begin{bmatrix} -1/2 &0 &1/2 \end{bmatrix} $$ to get the appropriate scale factor, and the Pascal smoother has a $1/4$ factor to have its coefficients sum to one $$\begin{bmatrix} 1/4&1/2&1/4 \end{bmatrix} $$ but the resulting global scaling of $1/2\times 1/4$ does not change the edge detection power for such linear filters.

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth small variations or noise.

One direction implements the shortest possible centered 1D discrete derivative:

$$\begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ to detect variations across lines, the other the shortest non-trivial Pascal/Gaussian smoothing $$\begin{bmatrix} 1&2&1 \end{bmatrix}^T $$ to smooth along columns, resulting in, for instance: $$ \begin{bmatrix} 1&2&1 \end{bmatrix}^T\cdot \begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ or $$ \begin{bmatrix} -1 &0 &1 \\ -2 &0 &2 \\ -1 &0 &1 \\ \end{bmatrix} $$

As you can see, this only involves dyadic numbers, so it can be implemented with adds and binary shifts.

Of course, the 3-point derivative often has an additional $1/2$ factor: $$\begin{bmatrix} -1/2 &0 &1/2 \end{bmatrix} $$ to get the appropriate scale factor, and the Pascal smoother has a $1/4$ factor to have its coefficients sum to one $$\begin{bmatrix} 1/4&1/2&1/4 \end{bmatrix} $$ but the resulting global scaling of $1/2\times 1/4$ does not change the edge detection power for such linear filters.

added details
Source Link
Laurent Duval
  • 32.3k
  • 3
  • 35
  • 105

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth light variations or noise.

One direction implements the shortest possible centered 1D discrete derivative:

$$\begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ to detect variations across lines, the other the shortest non-trivial Pascal/Gaussian smoothing $$\begin{bmatrix} 1&2&1 \end{bmatrix} $$ to smooth along lines, resulting in, for instance: $$ \begin{bmatrix} -1 &0 &1 \\ -2 &0 &2 \\ -1 &0 &1 \\ \end{bmatrix} $$

As you can see, this only involves dyadic numbers, so it can be implemented with adds and binary shifts.

Of course, the 3-point derivative often has an additional $1/2$ factor: $$\begin{bmatrix} -1/2 &0 &1/2 \end{bmatrix} $$ to get the appropriate scale factor, and the Pascal smoother has a $1/4$ factor to have its coefficients sum to one $$\begin{bmatrix} 1/4&1/2&1/4 \end{bmatrix} $$ but the resulting global scaling of $1/2\times 1/4$ does not change the edge detection power for such linear filters.

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth light variations or noise.

One direction implements the shortest possible centered 1D discrete derivative:

$$\begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ to detect variations across lines, the other the shortest non-trivial Pascal/Gaussian smoothing $$\begin{bmatrix} 1&2&1 \end{bmatrix} $$ to smooth along lines, resulting in, for instance: $$ \begin{bmatrix} -1 &0 &1 \\ -2 &0 &2 \\ -1 &0 &1 \\ \end{bmatrix} $$

As you can see, this only involves dyadic numbers, so it can be implemented with adds and binary shifts.

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth light variations or noise.

One direction implements the shortest possible centered 1D discrete derivative:

$$\begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ to detect variations across lines, the other the shortest non-trivial Pascal/Gaussian smoothing $$\begin{bmatrix} 1&2&1 \end{bmatrix} $$ to smooth along lines, resulting in, for instance: $$ \begin{bmatrix} -1 &0 &1 \\ -2 &0 &2 \\ -1 &0 &1 \\ \end{bmatrix} $$

As you can see, this only involves dyadic numbers, so it can be implemented with adds and binary shifts.

Of course, the 3-point derivative often has an additional $1/2$ factor: $$\begin{bmatrix} -1/2 &0 &1/2 \end{bmatrix} $$ to get the appropriate scale factor, and the Pascal smoother has a $1/4$ factor to have its coefficients sum to one $$\begin{bmatrix} 1/4&1/2&1/4 \end{bmatrix} $$ but the resulting global scaling of $1/2\times 1/4$ does not change the edge detection power for such linear filters.

added details
Source Link
Laurent Duval
  • 32.3k
  • 3
  • 35
  • 105

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth light variations or noise.

One direction implements the shortest possible centered 1D discrete derivative:

$$\begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ to detect variations across lines, the other the shortest non-trivial Pascal/Gaussian smoothing $$\begin{bmatrix} 1&2&1 \end{bmatrix} $$ to smooth along lines, resulting in, for instance: $$ \begin{bmatrix} -1 &0 &1 \\ -2 &0 &2 \\ -1 &0 &1 \\ \end{bmatrix} $$

As you can see, this only involves dyadic numbers, so it can be implemented with adds and binary shifts.

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth light variations or noise.

A first rationale is to be very short, as there was a time when computing on images was expensive. Then, a contour or an edge often present a fast variation in image intensities, that can be enhanced by derivatives. Sobel filters emulate such derivatives in one direction, and slightly average pixels in the complementary direction, to smooth light variations or noise.

One direction implements the shortest possible centered 1D discrete derivative:

$$\begin{bmatrix} -1 &0 &1 \end{bmatrix} $$ to detect variations across lines, the other the shortest non-trivial Pascal/Gaussian smoothing $$\begin{bmatrix} 1&2&1 \end{bmatrix} $$ to smooth along lines, resulting in, for instance: $$ \begin{bmatrix} -1 &0 &1 \\ -2 &0 &2 \\ -1 &0 &1 \\ \end{bmatrix} $$

As you can see, this only involves dyadic numbers, so it can be implemented with adds and binary shifts.

Source Link
Laurent Duval
  • 32.3k
  • 3
  • 35
  • 105
Loading