今天来总结一下fspecial()函数用法:
h = fspecial(type)
h = fspecial(type,para)
h = fspecial(type, pare, sigma)
其中type指定算子的类型,pare指定相应的参数,sigmasigma表示滤波器的标准差,单位为像素,默认值为0.5。
1、’average’
为均值滤波,参数为hsize代表模板尺寸,默认值为【3,3】。
H = FSPECIAL(‘average’,HSIZE) returns an averaging filter H of size
HSIZE. HSIZE can be a vector specifying the number of rows and columns in
H or a scalar, in which case H is a square matrix.
The default HSIZE is [3 3].
2、’gaussian’
为高斯低通滤波,有两个参数,hsize表示模板尺寸,默认值为【3 3】,sigma为滤波器的标准值,单位为像素,默认值为0.5.
H = FSPECIAL(‘gaussian’,HSIZE,SIGMA) returns a rotationally
symmetric Gaussian lowpass filter
of size HSIZE with standard
deviation SIGMA (positive). HSIZE can be a vector specifying the
number of rows and columns in H or a scalar, in which cas