The code is divided as:
1. Smooth the input image with a Gaussian filter.
2. Compute the gradient magnitude and angle images.
3. Apply nonmaxima suppression to the gradient magnitude
4. Use double thresholding and connectivity analysis to detect
the link edges.
Running the code:
Amarjot (2020). Canny Edge Detector (https://www.mathworks.com/matlabcentral/fileexchange/40737-canny-edge-detector), MATLAB Central File Exchange. Retrieved .
Hi, Thx for sharing your work. It is pretty well implemented.
But, there is a couple of errors and some minor things to improve.
1) You misunderstood the edge direction and gradient direction and using gradient direction than edge direction.
Because edge direction is perpendicular to gradient direction, the result is very weird finally.
2) when you calculated the angles using atan, you apply +90 degree for making the negative ones to positive one.
this is another mistakes, you should add 180 degree for this purpose.
Some minior comments
1. gradingedges functions in fact simply removes the edge less than Tl. So you donot need to if > Th elseif Tl and Th
2. your filter is not a Gaussian filter, so make the results is different from the original result of Matlab edge('Canny')
3. too many for loop, you could use vectorization.
Thanks. I could send you a upgraded one if you want it.
is it compatible with matlab R2017a
how to read the image in this function?