计算机视觉测量实验报告,计算机视觉实验报告Experiment3样稿.doc

本文档介绍了使用Matlab进行图像边缘检测的实验过程。主要内容包括通过Roberts、Prewitt和Sobel算子在空间域中对灰度图像进行边缘检测,并展示了具体的实现代码。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

文档介绍:

Experiment 3:Edge Detection

Class: 电子1203班 Student ID: Name: 王影

Ⅰ. Aim

The aim of this laboratory session is to learn to deal with image data by Matlab. By the end of this session, you should be able to perform image preprocessing of edge detection in spatial domain and frequency domain.

Ⅱ. Knowledge required in the Experiment

ⅰ.You are supposed to have learned the basic skills of using Matlab;

ⅱ.You need to review Matlab programming language and M-file format.

ⅲ. You should have studied edge detection methods.

Ⅲ. Experiment Contents

Demand: Please show the figure on the left and list the codes on the right respectively bellow each question.(请将运行结果(图片)和程序代码贴在每题下方)

ⅰ.Read “car.jpg” file (to do this by imread function), convert the color image into grayscale image, and then perform edge detection using Roterts, Prewitt, Sobel operator separately in spatial domain and display the results in a Matlab window.

程序:

clear;

im=imread('car.jpg');

I=rgb2gray(im);

subplot(3,2,1);imshow(I);

title('Gray image');

[Y,X]=size(I);

im_edge=zeros(Y,X);

T=30;

for k=2:Y-1

for kk=2:X-1

im_edge(k,kk)=abs(I(k+1,kk+1)-I(k,kk))+abs(I(k,kk+1)-I(k+1,kk));

if (im_edge(k,kk)>T)

im_edge(k,kk)=1;

else

im_edge(k,kk)=0;

end

end

end

subplot(3,2,2)

内容来自淘豆网www.taodocs.com转载请标明出处.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值