% importing the image
I = imread(‘graytestimg\11.bmp’);
% subplot(2, 4, 1),
% imshow(I);
% title(‘Gray Scale Image’);
% % Sobel Edge Detection
% J = edge(I, ‘Sobel’);
% subplot(2, 4, 2),
% imshow(J);
% title(‘Sobel’);
%
% % Prewitt Edge detection
% K = edge(I, ‘Prewitt’);
% subplot(2, 4, 3),
% imshow(K);
% title(‘Prewitt’);
%
% % Robert Edge Detection
% L = edge(I, ‘Roberts’);
% subplot(2, 4, 4),
% imshow(L);
% title(‘Robert’);
%
% % Log Edge Detection
% M = edge(I, ‘log’);
% subplot(2, 4, 5),
% imshow(M);
% title(‘Log’);
%
% % Zerocross Edge Detection
% M = edge(I, ‘zerocross’);
% subplot(2, 4, 6),
% imshow(M);
% title(‘Zerocross’);
% Canny Edge Detection
% N = edge(I, ‘canny_old’);
N=edge(I,‘canny_old’,[0,0.25],1.5);
% subplot(2, 4, 7),
imshow(N);
imwrite(N,‘edgemap.jpg’);
% title(‘Canny’);
该博客展示了多种图像边缘检测技术,包括Sobel、Prewitt、Robert、Log、Zerocross以及Canny算法的实现。通过MATLAB代码,作者详细演示了如何对灰度图像进行边缘检测,并以Canny算法为例,调整阈值以优化结果,最后将边缘映射保存为'edgemap.jpg'。
626

被折叠的 条评论
为什么被折叠?



