Image blurring using gaussian low pass filter

丶灬走出姿态 提交于 2019-12-08 08:45:04

问题


I'm trying to blur a grayscale image using Gaussian low pass filter( 5*5 kernal).I tried the following code.

I = imread('Lena.png');
G = fspecial('gaussian',[5 5],2);
Ig = imfilter(I,G,'same');
imshow(Ig);

But I'm getting an error in file 'meshgrid.m' as follows.

Error: File: meshgrid.m Line: 1 Column: 5
The input character is not valid in MATLAB statements or expressions.
Error in fspecial (line 145)
[x,y] = meshgrid(-siz(2):siz(2),-siz(1):siz(1));
Error in Untitled2 (line 2)
G = fspecial('gaussian',[5 5],2);

I'm not understanding what the error is.Can anyone help me please.The input image that I used is uploaded below('Lena.png').Thanks in advance

来源:https://stackoverflow.com/questions/27985769/image-blurring-using-gaussian-low-pass-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!