机器视觉创新实践:边缘检测算子
一、实验目的
使用MATLAB对图像进行roberts,sobel,log边缘检测算子处理
二、实验步骤
1.读取图片并显示到指定位置
image=imread(‘test3.bmp’); %读取图片
subplot(2,2,1); %指定显示图片位置为2乘2矩阵第1个位置
imshow(image),title(‘原图’); %显示所读取的图片并命名为原图
2.使用roberts算子对图片进行处理
image1=edge(image,‘roberts’); %使用roberts算子对图片进行处理
subplot(2,2,2); %指定显示图片位置为2乘2矩阵第2个位置
imshow(image1),title(‘roberts算子’);
3.使用sobel算子对图片进行处理
mage2=edge(image1,‘sobel’); %使用sobel算子对图片进行处理 subplot(2,2,3); %指定显示图片位置为2乘2矩阵第3个位imshow(image2),title(‘sobel算子’);
4.使用log算子对图片进行处理
image3=edge(image,‘log’); %使用log算子对图片进行处理
subplot(2,2,4); %指定显示图片位置为2乘2矩阵第4个位置
imshow(image3),title(‘log算子’);
三、运行结果(效果)