欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

利用Matlab实现图像的边缘提取

程序员文章站 2022-07-01 15:25:52
...
clear;clc;
close all;
I=imread('lena.bmp');
I=rgb2gray(I);
imshow(I,[]);
title('Original Image');

sobelBW=edge(I,'sobel');
figure;
imshow(sobelBW);
title('Sobel Edge');

robertsBW=edge(I,'roberts');
figure;
imshow(robertsBW);
title('Roberts Edge');

prewittBW=edge(I,'prewitt');
figure;
imshow(prewittBW);
title('Prewitt Edge');

logBW=edge(I,'log');
figure;
imshow(logBW);
title('Laplasian of Gaussian Edge');

cannyBW=edge(I,'canny');
figure;
imshow(cannyBW);
title('Canny Edge');


相关标签: Image