This is the rules:
A simple edge detector using gradient magnitude
1. Compute gradient vector at each pixel by convolving image with horizontal and vertical derivative filters
2. Compute gradient magnitude at each pixel
3. If magnitude at a pixel exceeds a threshold, report a possible edge point.
But I don't know how to apply threshold manually in matlab (step 3.). Can anyone help me?
im1 = rgb2gray(imread('dog.jpg')); [gx,gy] = imgradientxy(im1); [gmag,gdir] = imgradient(gx,gy); imshow(gmag,[]);
Best Answer