博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
图像边缘检测
阅读量:4589 次
发布时间:2019-06-09

本文共 1937 字,大约阅读时间需要 6 分钟。

一、实验目的:熟悉边缘检测的基本方法

二、实验内容:chairgray.jpg图像为例,分别采用sobelprewittroberts

log对该图像及其加上噪声后的图像进行边缘检测。用到的matlab函数为edge,imnoise

1 a=imread('D:/picture/ZiXia.jpg'); 2 a=rgb2gray(a); 3 figure('name','图像分割'); 4 subplot(2,5,1) 5 imshow(a); 6 bw1=edge(a,'sobel'); 7 bw2=edge(a,'prewitt'); 8 bw3=edge(a,'roberts'); 9 bw4=edge(a,'log');10 subplot(2,5,2),imshow(bw1);11 xlabel('sobel');12 subplot(2,5,3),imshow(bw2);13 xlabel('prewitt');14 subplot(2,5,4),imshow(bw3);15 xlabel('roberts');16 subplot(2,5,5),imshow(bw4);17 xlabel('log');18 a=imnoise(a,'gaussian',0.02);19 subplot(2,5,6)20 imshow(a);21 bw1=edge(a,'sobel');22 bw2=edge(a,'prewitt');23 bw3=edge(a,'roberts');24 bw4=edge(a,'log');25 subplot(2,5,7),imshow(bw1);26 xlabel('sobel');27 subplot(2,5,8),imshow(bw2);28 xlabel('prewitt');29 subplot(2,5,9),imshow(bw3);30 xlabel('roberts');31 subplot(2,5,10),imshow(bw4);32 xlabel('log');

 

 

可以得知噪声对边缘检测的结果会产生一定的影响

edge函数介绍

BW = edge(I)采用灰度或一个二值化图像I作为它的输入,并返回一个与I相同大小的二值化图像BW,在函数检测到边缘的地方为1,其他地方为0。BW = edge(I,'sobel') 自动选择阈值用Sobel算子进行边缘检测。BW = edge(I,'sobel',thresh) 根据所指定的敏感度阈值thresh,用Sobel算子进行边缘检测,它忽略了所有小于阈值的边缘。当thresh为空时,自动选择阈值。BW = edge(I,'sobel',thresh,direction) 根据所指定的敏感度阈值thresh,在所指定的方向direction上,用Sobel 算子进行边缘检测。Direction可取的字符串值为horizontal(水平方向)、vertical(垂直方向)或both(两个方向)。[BW,thresh] = edge(I,'sobel',...) 返回阈值BW = edge(I,'prewitt') 自动选择阈值用prewitt算子进行边缘检测。BW = edge(I,'prewitt',thresh) 根据所指定的敏感度阈值thresh,用prewitt算子进行边缘检测,它忽略了所有小于阈值的边缘。当thresh为空时,自动选择阈值。BW = edge(I,'prewitt',thresh,direction) 根据所指定的敏感度阈值thresh,在所指定的方向direction上,用prewitt算子进行边缘检测。Direction可取的字符串值为horizontal(水平方向)、vertical(垂直方向)或both(两个方向)默认方向为both。[BW,thresh] = edge(I,'prewitt',...) 返回阈值BW = edge(I,'roberts') 自动选择阈值用roberts算子进行边缘检测。BW = edge(I,'roberts',thresh) 根据所指定的敏感度阈值thresh,用Roberts算子进行边缘检测,它忽略了所有小于阈值的边缘。当thresh为空时,自动选择阈值。 Matlab中文论坛[BW,thresh] = edge(I,'roberts',...) 返回阈值BW = edge(I,'log') 自动选择阈值用LOG算子进行边缘检测。

 

转载于:https://www.cnblogs.com/henuliulei/p/10957227.html

你可能感兴趣的文章
NSDate
查看>>
堆排序
查看>>
java架构《Socket网络编程基础篇》
查看>>
HASH、HASH函数、HASH算法的通俗理解
查看>>
easyui学习日记20141213
查看>>
getopt()函数
查看>>
第八届极客大挑战 Re
查看>>
ZOJ3471--Most Powerful(状压DP)
查看>>
POJ3666-Making the Grade(左偏树 or DP)
查看>>
杭电2084数塔
查看>>
ISE中FPGA的实现流程
查看>>
虚拟机centos笔记整理,持续更新~~
查看>>
Spring MVC访问静态资源
查看>>
jquery实现的个性网站首页 详细信息
查看>>
poj2096 Collecting Bugs
查看>>
【机器学习】关联规则挖掘(二):频繁模式树FP-growth
查看>>
MD5加密
查看>>
关于R软件的安装
查看>>
小程序上传图片
查看>>
1-1000的所有的完数
查看>>