how can i apply the sobel operator in horizontal direction?
54 vues (au cours des 30 derniers jours)
Anand le 4 Nov 2014
If you want the edge detected image, you can use the edge function as follows:
BW = edge(I,'sobel','vertical');
If you want just the filtered output image, you can use imfilter with a filter kernel generated by the fspecial function like so:
% generate horizontal edge emphasis kernel
h = fspecial('sobel');
% invert kernel to detect vertical edges
h = h';
J = imfilter(I,h);
Image Analyst le 4 Nov 2014
What does that mean? The filter is applied in both directions - over the whole image. You can align the kernel in whatever orientation you want - not sure which orientation you call horizontal.