matlab的这个错误怎么解决?
???Errorusing==>runErrorusing==>images\private\checkinput>check_attributesFunctionORD...
??? Error using ==> run
Error using ==> images\private\checkinput>check_attributes
Function ORDFILT2 expected its first input argument, A,
to be two-dimensional.
源程序
I=imread('tatanic.jpg');
I1=imnoise(I,'gaussian');
I2=imnoise(I,'salt & pepper',0.02);
I3=imnoise(I,'speckle');
J1=medfilt2(I1,[3,3]);
J2=medfilt2(I2,[3,3]);
J3=medfilt2(I3,[3,3]);
figure,imshow(J1);
title('tatanic高斯噪声—3*3中值滤波')
figure,imshow(J2);
title('tatanic椒盐噪声—3*3中值滤波')
figure,imshow(J3);
title('tatanic乘性噪声—3*3中值滤波') 展开
Error using ==> images\private\checkinput>check_attributes
Function ORDFILT2 expected its first input argument, A,
to be two-dimensional.
源程序
I=imread('tatanic.jpg');
I1=imnoise(I,'gaussian');
I2=imnoise(I,'salt & pepper',0.02);
I3=imnoise(I,'speckle');
J1=medfilt2(I1,[3,3]);
J2=medfilt2(I2,[3,3]);
J3=medfilt2(I3,[3,3]);
figure,imshow(J1);
title('tatanic高斯噪声—3*3中值滤波')
figure,imshow(J2);
title('tatanic椒盐噪声—3*3中值滤波')
figure,imshow(J3);
title('tatanic乘性噪声—3*3中值滤波') 展开
1个回答
展开全部
medfilt2()只能处理二维的图像,你可以考虑将三维的jpg图像转为二维的grayscale图像,如下:
I=imread('tatanic.jpg');
I = .2989*I(:,:,1)...
+.5870*I(:,:,2)...
+.1140*I(:,:,3);
I1=imnoise(I,'gaussian');
I2=imnoise(I,'salt & pepper',0.02);
I3=imnoise(I,'speckle');
J1=medfilt2(I1,[3,3]);
J2=medfilt2(I2,[3,3]);
J3=medfilt2(I3,[3,3]);
figure,imshow(J1);
title('tatanic高斯噪声—3*3中值滤波')
figure,imshow(J2);
title('tatanic椒盐噪声—3*3中值滤波')
figure,imshow(J3);
title('tatanic乘性噪声—3*3中值滤波')
I=imread('tatanic.jpg');
I = .2989*I(:,:,1)...
+.5870*I(:,:,2)...
+.1140*I(:,:,3);
I1=imnoise(I,'gaussian');
I2=imnoise(I,'salt & pepper',0.02);
I3=imnoise(I,'speckle');
J1=medfilt2(I1,[3,3]);
J2=medfilt2(I2,[3,3]);
J3=medfilt2(I3,[3,3]);
figure,imshow(J1);
title('tatanic高斯噪声—3*3中值滤波')
figure,imshow(J2);
title('tatanic椒盐噪声—3*3中值滤波')
figure,imshow(J3);
title('tatanic乘性噪声—3*3中值滤波')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |