我正在尝试在一个循环中创建多个高斯滤波器,如下所示:
for sigma:3:0.4:15
filter = fspecial('gaussian', 6*sigma, sigma);
end
它不喜欢我将浮点数传递给 size 参数,并给我以下错误:
Expected input number 2, N, to be integer-valued.
但是当我将代码行更改为:
filter = fspecial('gaussian', uint8(6*sigma), sigma);
我收到此错误:
Expected input number 2, N, to be one of these types:
double
Instead its type was uint8.
我完全困惑,任何建议将不胜感激。