各种算法实现边缘的提取
%调入与显示RGB图像
RGB = imread('123.jpg');
isrgb(RGB);
figure(1);
imshow(RGB);
%RGB图转换为灰度图像
I = rgb2gray(RGB);
figure(2);
imshow(I);
%边缘检测
ED = edge(I,'sobel',0.08);
figure(3)
imshow(ED);
%sobel边界探测器
BW1 = edge(I,'sobel');
%canny边界探测器
BW2 = edge(I,'canny');
figure(4)
imshow(BW1)
figure, imshow(BW2)
2021-11-05 10:16:28
344B
matlab
1