sobel_dirsobel_dirSobelDirsobel_dirSobelDirSobelDir calculates first derivative of an image and is
used as an edge detector. The filter is based on the following
filter masks:
A =
1 2 1
0 0 0
-1 -2 -1
B =
1 0 -1
2 0 -2
1 0 -1
These masks are used differently, according to the selected filter
type. (In the following, a and b denote the results of
convolving an image with A and B for one particular pixel.)
sobel_dir(I,Amp,Dir,FilterType,S)
for Size > 3 is conceptually equivalent to
scale_image(I,F,2,0)
gauss_image(F,G,S-2)
sobel_dir(G,Amp,Dir,FilterType,3)
or to
scale_image(I,F,2,0)
binomial_filter(F,G,S[0]-2,S[1]-2)
sobel_dir(G,Amp,Dir,FilterType,3).
The edge directions are returned in EdgeDirectionEdgeDirectionEdgeDirectionEdgeDirectionEdgeDirectionedgeDirection, and
are stored in 2-degree steps, i.e., an edge direction of x
degrees in mathematically positive sense and with respect to the
horizontal axis is stored as x / 2
in the edge direction image. Furthermore, the direction
of the change of intensity is taken into account. Let
denote the image gradient. Then the
following edge directions are returned as r/2:
Points with edge amplitude 0 are assigned the edge direction 255
(undefined direction).
List of values: 'sum_abs'"sum_abs""sum_abs""sum_abs""sum_abs""sum_abs", 'sum_abs_binomial'"sum_abs_binomial""sum_abs_binomial""sum_abs_binomial""sum_abs_binomial""sum_abs_binomial", 'sum_sqrt'"sum_sqrt""sum_sqrt""sum_sqrt""sum_sqrt""sum_sqrt", 'sum_sqrt_binomial'"sum_sqrt_binomial""sum_sqrt_binomial""sum_sqrt_binomial""sum_sqrt_binomial""sum_sqrt_binomial"
List of values (for compute devices): 'sum_abs'"sum_abs""sum_abs""sum_abs""sum_abs""sum_abs", 'sum_sqrt'"sum_sqrt""sum_sqrt""sum_sqrt""sum_sqrt""sum_sqrt", 'sum_abs_binomial'"sum_abs_binomial""sum_abs_binomial""sum_abs_binomial""sum_abs_binomial""sum_abs_binomial", 'sum_sqrt_binomial'"sum_sqrt_binomial""sum_sqrt_binomial""sum_sqrt_binomial""sum_sqrt_binomial""sum_sqrt_binomial"