Canny edge detector.
function call:
[out_img1,out_img2]=vsg('Canny',in_img1,std,thresh1,thresh2);
Arguments:
in_img1
input image, 3 channel RGB, 1 channel greyscale or binary image, or
DICOM image.
std – scale (standard deviation of the Gaussian).
thresh1
– lower magnitude threshold.
thresh2
– upper magnitude threshold.
Description:
Canny edge detection involves convolving the input image with a Gaussian
of scale std. Spurious response can be reduced by thresholding applied
with hysteresis (two threshold are defined). If gradient magnitude of
the contour is greater than the higher threshold than it is considered a
valid edge point. Any candidate edge pixels that are connected to valid
edge points and are above the lower threshold are also considered as
edge point. The out_img1 - An image which has dimensions the same
as the input image. The output image contains the magnitude of the edges
detected.
out_img2 - An image which
has dimensions the same as the input image. The output image contains
the orientation of the edges detected.
Example:
img = openimage('lake.jpg');
h=figure;image(img); set(h,'Name','Input');
[out_img1,out_img2]=vsg('Canny',img,1.0,5,200);
h=figure; image(uint8(out_img1));set(h,'Name','Canny-Magnitude');