Undefined function 'conv2' for input arguments of type 'double' and attributes 'full 3d real'.

来源:互联网 发布:j罗 皇马 数据 编辑:程序博客网 时间:2024/04/30 08:54

Matlab出现的问题

图像的差的绝对值运算:首先读取一幅图像,然后对这幅图像进行高斯滤波,再将原图像和高斯滤波后的图像进行相减。

Undefined function 'conv2' for input arguments of type 'double' and attributes 'full 3d real'

源码:

I=imread('4.tif');
>> subplot(1,3,1);imshow(I,[]);
>> j=uint8(filter2(fspecial('gaussian'),I));

Undefined function 'conv2' for input arguments of type 'double' and attributes 'full 3d real'.
Error in filter2 (line 60)
        y = conv2(hcol, hrow, x, shape);

修改后:
 
>> i=imread('4.tif');
>> j=rgb2gray(i);
>>  k=uint8(filter2(fspecial('gaussian'),j));
>> subplot(1,3,2);
>> imshow(k,[]);
>> h=imabsdiff(j,k);
>> subplot(1,3,3);
>> imshow(k,[]);


0 0