The sobel operator is used to obtain a first order gradient image of a digital image and a common application is edge detection. The algorithm is based on the weighted difference of the gray values of the four fields of each pixel in the image, up, down, left and right, to reach the extreme values at the edges thus detecting the edges.
| Input Image | Parameter | Output Image |
|---|---|---|
![]() | ![]() |
The 3X3 convolution kernel is shown below, which is only applicable to gradient computation in one direction. The first convolution kernel applies to the convolution in the X direction, when the difference between the pixel values to the left and to the right of the pixel point is large, the convolution results in a larger target pixel value, i.e., a convex outline. The second convolution kernel is used for convolution in the Y direction, and the principle is the same.
For detailed interface information, please refer to hbVPSobel.