How to apply Gaussian filter on images in MATLAB?

 Akzeptierte Antwort

Wanbin Song
Wanbin Song am 17 Feb. 2016
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 Kommentare

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().
anastasia
anastasia am 3 Mär. 2017
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
You can use the rotation matrix https://en.wikipedia.org/wiki/Rotation_matrix

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by