xGradImg,yGradImg = | sobelGradient2dImg (inImg) |
xGradImg,yGradImg = | sobelGradient2dImg (inImg,kernelType,bNormalize) |
image = | sobelXGradient2dImg (inImg) |
image = | sobelXGradient2dImg (inImg,kernelType,bNormalize) |
image = | sobelYGradient2dImg (inImg) |
image = | sobelYGradient2dImg (inImg,kernelType,bNormalize) |
Compute X and Y gradients of an input image convolving it with 2d Sobel kernels.
2d Sobel kernels are separable, they can be decomposed as the product of a row vector and a column vector. X gradient kernel equals to the product of the smoothing (column) vector with the derivative (row) vector, while Y gradient kernel equals to the product of the derivative (column) vector with the smoothing (row) vector. Depending on the value of parameter (default value: eSKT_SobelHalfKnlSz1), smoothing and derivative vectors equal to:
,
if
equals to eSKT_SobelHalfKnlSz3
has the default value
. When the user sets this parameter to the value
, only the smoothing part of the 2d kernel is normalized.
To handle image borders, a mirror extrapolation is used (see Border policy for more details).
Here is an example of a Sobel gradient applied to an 8-bits grey levels input image with default parameters used: