Purpose of ceil in fspecial
2 ビュー (過去 30 日間)
古いコメントを表示
These are few lines from a code:
s=3;
M=imread('I.jpg');
I=rgb2gray(M);
%filter
h=fspecial('gaussian',ceil(4*s),s);
I need to know that what is the purpose of ceil in fspecial? What is it going to do?
0 件のコメント
採用された回答
Image Analyst
2012 年 8 月 30 日
編集済み: Image Analyst
2012 年 8 月 30 日
They wanted to specify s, and the second arg must be an integer. They could have done int32(4*s) or floor(4*s) but for whatever reason they chose ceil. They wanted it to be at least as wide as 4 std dev's with the requirement that it be an integer because it's a window size in pixels. As you can find in the help for ceil(), it rounds up to the next highest integer value.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で NaNs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!