How to determine the radius of gaussian smoothing?

9 次查看(过去 30 天)
Hi everyone, can anyone explain how I would like to determine the radius smoothing by using imgaussfilt function matlab.
Let say, in my coding, I try imgaussfilt function with 6 sigma. Since the default filter size is 2*ceil(2*sigma)+1.
Thus, the filter size for 6sigma is 2*2*6+1 = 25 . So, would the smoothing radius is half of the filter size? correct me I'm wrong. Below is my coding. Thank you.
clc;clear all; close all;
file = 'Example.txt';
name = 'Testing Smoothing';
Data = textread(file);
y = Data(:,1);
x = Data(:,2);
z = Data(:,3);
ymin = 0.5 ; ymax = 3.5;
xmin = 96 ; xmax = 123;
xlim = [xmin xmax];
ylim = [ymin ymax];
m2 = 0.033333333333;
dx =xmin:m2:xmax; % set the min,max y and interval
dy = ymin:m2:ymax; % set the min,max x and interval
[Xi,Yi] = meshgrid(dx,dy);
[Zi] = griddata(x,y,z,Xi,Yi,'cubic');
Zi = imgaussfilt(Zi,6,'FilterDomain','spatial');
GrdXYZ = [Yi(:) Xi(:) Zi(:)];
nGrd = sortrows(GrdXYZ,1);
  2 个评论
Steve Eddins
Steve Eddins 2020-12-4
What is your definition of smoothing radius for a Gaussian filter? Theoretically speaking, the Gaussian function has infinite extent. Practically, it decays to zero quickly so that a finite-extent window is sufficient. But it's not clear to me whether smoothing radius is clearly defined for it.
hanif hamden
hanif hamden 2020-12-4
Hi sir, I think smoothing radius is most likely same as filter length.

请先登录,再进行评论。

回答(0 个)

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by