How to apply Gaussian filter on images in MATLAB?

 Accepted Answer

You can use imgaussfilt function for 2-D gaussian filtering as below:
I = imread('mypic.jpg');
Iblur = imgaussfilt(I, 1);
where the second input of imgaussfilt is standard deviation sigma.

6 Comments

Hi, Thanks for your reply. But I am getting this error when I am running above commands.
??? Undefined function or method 'imgaussfilt' for input arguments of type 'single'.
How to fix this ?
BTW, to use imgaussfilt, Image processing toolbox is required. The error message seems state that image processing toolbox is not installed.
Alternatively, try conv2().
How do you rotate the gaussian filter/kernel for different orientations? for example, for rotating the kernel in 12 different directions from -pi/2 to pi/2? Please help

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!