Sobel operator
The Sobel operator is a simple edge detection - filter , in the image processing is often used and there using the folding is used as algorithm ( Sobel algorithm ). This calculates the first derivative of the pixel brightness values, while at the same time smoothing orthogonally to the direction of the derivative.
The algorithm uses a convolution by means of a 3 × 3 matrix ( convolution matrix ), which generates a gradient image from the original image. With this, high frequencies in the image are represented with gray values. The areas of greatest intensity are where the brightness of the original image changes the most and thus shows the largest edges. For this reason, a threshold value function is usually used after the convolution with the Sobel operator . The algorithm can, however, also be applied to other two-dimensional signals.
From the original image, only one section, more precisely the area around the point to be observed, is used for each pixel. Now the folded results and are calculated by means of the Sobel operators and :
and
The computing time can be significantly reduced by utilizing the separability .
Then all components of the matrix are added up to obtain their gray value. Direction-independent information can be obtained by combining both results:
The direction of a gradient is obtained from the formula
- ,
where arctan2 is the "arctangent" with two arguments.
The value describes a vertical edge with a negative gradient in the x direction. Increasing angles describe a counterclockwise rotation .
example Pictures
software
The Sobel operator can be executed with the graphics program GIMP via the menu commands Filter -> Find edges -> Sobel. It is also implemented in the free image processing libraries Scikit-image and OpenCV .
Scharr operator
The Sobel operator does not have perfect rotational symmetry. This is better taken into account with the Scharr operator:
and
See also
- Prewitt operator Operator without weighting the direction
- Roberts operator simpler and older operator
- Canny algorithm using the Sobel operator
- Laplace filter
credentials
- ↑ 7.6. Sobel. In: GNU Image Manipulation Program - User Guide. GIMP, accessed November 29, 2018 .
- ↑ Module: filters - skimage v0.15.dev0 docs. Retrieved November 29, 2018 .
- ^ OpenCV: Sobel Derivatives. Retrieved November 29, 2018 .
- ↑ Scharr, Hanno. Optimal operators in digital image processing. Dissertation: Ruprecht-Karls-Universität Heidelberg, 2000 .