How to I apply Gaussian filter on images in MATLAB?

57 ビュー (過去 30 日間)
Chidiebere Ike
Chidiebere Ike 2018 年 11 月 15 日
コメント済み: Rawand Alkhdour 2020 年 8 月 7 日
How to I apply a 7 x 7 Gaussian blurr operator with standard deviation of 1.6 and downscaled by a factor of 3 ?
I tried to write this code but got error.
K = imread('baboon.png');
h = fspecial(K, 'gaussian',[7 7],1.6);
downSample = imresize(h, 0.33); % downSample by factor of 3
imshow(downSample);
How do i achieve this ?
Thanks

採用された回答

Image Analyst
Image Analyst 2018 年 11 月 15 日
You need to look at the documentation when the error say "too many arguments". Several of your arguments were wrong. Here is the fixed code:
rgbImage = imread('peppers.png');
kernel = fspecial('gaussian', [7 7], 1.6);
blurredImage = imfilter(rgbImage, kernel);
downSample = imresize(blurredImage, 1/3); % downSample by factor of 3
imshow(downSample);
  2 件のコメント
Chidiebere Ike
Chidiebere Ike 2018 年 11 月 18 日
Thanks for the correction. I appreciate

サインインしてコメントする。

その他の回答 (1 件)

Rawand Alkhdour
Rawand Alkhdour 2020 年 8 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by