필터 지우기
필터 지우기

Relationship between Sigma and grid size in imgaussfilt3

조회 수: 2 (최근 30일)
saipb
saipb 2019년 9월 15일
댓글: Walter Roberson 2019년 9월 15일
Hello,
I am using the imgaussfilt3 function to smooth out my velocity fields in three dimensions. I understand that there are two variables to manipulate, i.e., Sigma and Filterwidth. I am manipulating only Sigma and leaving Filterwidth untouched (By default, the filter width is 4*Sigma + 1). What I am unable to find the documentation is the precise relationship between Sigma and the number of grid cells. My guess is that 1 Sigma is equal to 1 grid cell, but this most certainly need not be the case. Can a person with access to the source code please tell me the precise relationship between Sigma or Filterwidth to the grid dimensions?
Thank you!

답변 (1개)

Walter Roberson
Walter Roberson 2019년 9월 15일
If "number of grid cells" refers to the size of the filter, then according to the documentation,
% 'FilterSize' - Scalar or 3-element vector, of positive, odd
% integers that specifies the size of the Gaussian
% filter. If a scalar Q is specified, then a square
% Gaussian filter of size [Q Q Q] is used.
%
% Default value is 2*ceil(2*SIGMA)+1.
  댓글 수: 2
saipb
saipb 2019년 9월 15일
Dear Walter,
Thank you for the response. The response does not completely answer my question though. It is true that if I specify Q, then the scalar Q refers to a filter width of QxQxQ grid cells. However, if I am using the default value, then the filter size is merely a function of Sigma. Now, theoretically, it is possible to have many number of grid cells for the same value of Sigma. This is why, I guess that Matlab must assume some correlation between Sigma and number of grid cells. I think it is 1 Sigma = 1 grid-cell. Could you please confirm if this is the case?
Walter Roberson
Walter Roberson 2019년 9월 15일
No. The default is 2*ceil(2*SIGMA)+1 .
One possible interpretation of that is 2*Sigma relative to the center of the filter. But the choice could have been arbitrary. If you want to know why they choose 2*ceil(2*SIGMA)+1 then you will need to open a support case and ask for their reasoning.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by