Operator with its derivatives
We stress that it is preferable to apply the derivatives to the gaussin operator ,then ,we can convolute the image with it!
The left pic is the Gaussian function and the right one is the gaussian function with its dericatives.
How we set the size of the Gaussian
图片.png 图片.pngsmaller sigma to get finer features
larger sigma to get the obvious edges and to smooth the minor edges
So let's conclude the process with the nether pic:
Canny edge detector!(非极大值抑制来thin the edge)
图片.pngdo the derivatives
图片.pngwe threshold the gradient
图片.pngdo the nms(非极大值抑制)
图片.pngmatlab code are listed below
% For Your Eyes Only
pkg load image;
frizzy = imread('frizzy.png');
froomer = imread('froomer.png');
imshow(frizzy);
imshow(froomer);
% TODO: Find edges in frizzy and froomer images
frizzyg=rgb2gray(frizzy);
froomerg=rgb2gray(froomer);
a1=edge(frizzyg,'canny');
a2=edge(froomerg,'canny');
% TODO: Display common edge pixels
imshow(a1&a2);
The 2D filter
图片.pngApplying this to your imgae ,we take the 0 crossing and we will get the deges.
网友评论