Sobel edge detector.
function call:
[out_img1]=vsg('Sobel',in_img1);
Arguments:
in_img1
input image, 3 channel RGB, 1 channel greyscale or binary image, or
DICOM image.
Description:
The Sobel edge detector uses a 3×3 mask to determine the gradient. The
derivatives are calculated using the two convolution masks which are
than summed. These have an inherent smoothing effect, which makes the
very effective in the presence of noise.
out_img1 - An image which
has dimensions the same as the input image. The output image displays
the Sobel filtered input image, which highlights edges.
Example:
img = openimage('lake.jpg');
h=figure;image(img); set(h,'Name','Input');
[out_img1]=vsg('Sobel',img);
h=figure; image(uint8(out_img1));set(h,'Name','Sobel Edge
Detection');
Notes:
For DICOM and RGB images, the function operates on each channel/slice
separately.