MATLAB 進行五種邊緣檢測


自定義函數:
function []=edge_detect(image_name)
a=imread(image_name);
I=rgb2gray(a);

BW1=edge(I,'Roberts',0.16);
BW2=edge(I,'Sobel',0.16);
BW3=edge(I,'Prewitt',0.06);
BW4=edge(I,'LOG',0.012); 
BW5=edge(I,'Canny',0.12);

figure('Name','進行五種邊緣檢測');
subplot(2,3,1);imshow(I);title('原圖');
subplot(2,3,2);imshow(BW1);title('Robert算子邊緣檢測')
subplot(2,3,3);imshow(BW2);title('Sobel算子邊緣檢測')
subplot(2,3,4);imshow(BW3);title('Prewitt算子邊緣檢測');
subplot(2,3,5);imshow(BW4);title('LOG算子邊緣檢測');
subplot(2,3,6);imshow(BW5);title('Canny邊緣檢測');

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM