注册 登录
编程论坛 Matlab

如何用sobel算子对图像进行边沿检测

wwh2j 发布于 2006-05-13 10:25, 2446 次点击

本人刚刚学matlab,希望高人指教一下小弟.
题目:要对某一幅图像I进行sobel算子进行边沿检测,其sobel算子为3*3的矩阵:
[-1 -2 -1;0 0 0;1 2 1]

是不是要用到edge函数.
如:
sobel=[-1 -2 -1;0 0 0;1 2 1];
W=edge(I,'sobel');
subplot(1,2,1),imshow(I);
subplot(1,2,2),imshow(W);

2 回复
#2
menghao19832006-05-19 10:42
用预滤波函数fspecial也行
#3
nuoya11292006-05-29 10:49
就是用搂主说的那个函数
1