电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

实验四图像分割与边缘检测

实验四图像分割与边缘检测_第1页
1/7
实验四图像分割与边缘检测_第2页
2/7
实验四图像分割与边缘检测_第3页
3/7
实验 四 图像分割与边缘检测 一.实验目的及要求 1.利用MATLAB 研究图像分割与边缘检测的常用算法原理; 2.掌握MATLAB 图像域值分割与边缘检测函数的使用方法; 3.了解边缘检测的算法和用途,比较Sobel、Prewitt、Canny等算子边缘检测的差异。 二、实验内容 (一)研究以下程序,分析程序功能;输入执行各命令行,认真观察命令执行的结果。熟悉程序中所使用函数的调用方法,改变有关参数,观察试验结果。 1 .图像阈值分割 clear all, close all; I = imread('cameraman.tif'); figure (1),imshow(I) figure(2); imhist(I) T=120/255; Ibw1 = im2bw(I,T); figure(3); subplot(1,2,1), imshow(Ibw1); T=graythresh(I); L = uint8(T*255) Ibw2 = im2bw(I,T); subplot(1,2,2), imshow(Ibw2); help im2bw; help graythresh; clear all, close all; I = imread('cameraman.tif'); figure (1),imshow(I) figure(2); imhist(I) T=240/255; Ibw1 = im2bw(I,T); figure(3); subplot(1,2,1), imshow(Ibw1); T=graythresh(I); L = uint8(T*255) Ibw2 = im2bw(I,T); subplot(1,2,2), imshow(Ibw2); help im2bw; help graythresh; clear all, close all; I = imread('cameraman.tif'); figure (1),imshow(I) figure(2); imhist(I) T=120/255; Ibw1 = im2bw(I,T); figure(3); subplot(1,2,1), imshow(Ibw1); T=graythresh(I); L = uint8(T*255) Ibw2 = im2bw(I,T); subplot(1,2,2), imshow(Ibw2); help im2bw; help graythresh; 2 .边缘检测 clear all, close all; I = imread('moon.tif'); BW1 = edge(I,'sobel'); BW2 = edge(I,'canny'); BW3 = edge(I,'prewitt'); BW4 = edge(I,'roberts'); BW5 = edge(I,'log'); figure(1), imshow(I), title('Original Image'); figure(2), imshow(BW1), title('sobel'); figure(3), imshow(BW2), title('canny'); figure(4), imshow(BW3), title('prewitt'); figure(5), imshow(BW4), title('roberts'); figure(6), imshow(BW5), title('log'); help edge edgedemo (二)利用 MATLAB 熟悉并验证其它图像分割方法 灰度阈值分割: I=imread('C:\Users\Administrator\Desktop\rice.jpg'); I=rgb2gray(I); I2=im2bw(I); figure,imshow(I2); I2=im2bw(...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

实验四图像分割与边缘检测

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部