回 帖 发 新 帖 刷新版面

主题:求助:大家帮我看一下这程序是什么错误(图像处理),谢谢啦

我毕设是做图像去噪方面的,在matlab里面找着书打入下面程序总说错误,大家帮忙指教下哈


>> clear
>> imread('h.tif');
>> clear
>> I=imread('h.tif');
>> J=imnoise(I,'salt & pepper',0.02);
>> figure,imshow(J)
>> K=filter2(fspecial('average',3),J)/255;
??? Function 'conv2' is not defined for values of class 'double' and attributes 'full 3d 

real'.

Error in ==> filter2 at 73
        y = conv2(hcol, hrow, x, shape);


我是把彩色图像用rgb2gray函数变为灰度图像进行处理的。小弟刚刚接触matlab图像处理方面,还请大家指教啊!!![em2][em18]

回复列表 (共3个回复)

沙发


可能那个函数有问题哦,filter2

板凳

应该不会吧
这都是我照着书打上去的啊
还是感谢一下

3 楼


Error in ==> filter2 at 73
        y = conv2(hcol, hrow, x, shape);
它告诉你了格式不对啊

我来回复

您尚未登录,请登录后再回复。点此登录或注册