MATLAB數值濾波處理方法有:
首先關於fspecial函數的定義,fspecial函數用於建立預定義的濾波算子。
其語法格式為:
h = fspecial(type)
h = fspecial(type,para)
其中type指定算子的類型,para指定相應的參數;
函數type的類型有:
1、'average'averaging filter為均值濾波,參數為hsize代表模板尺寸,默認值為[3,3]。
函數格式:H = fspecial('average',hsize)
2、 'disk'circular averaging filter為圓形區域均值濾波,參數為radius代表區域半徑,默認值為5。
函數格式:H = fspecial('disk',radius)
3、'gaussian'Gaussian lowpass filter為高斯低通濾波,有兩個參數,hsize表示模板尺寸,默認值為[3 3],sigma為濾波器的標準值,單位為像素,默認值為0.5。
函數格式:H = fspecial('gaussian',hsize,sigma)
4、'laplacian' filter approximating the 2-D Laplacian operatorlaplacian filter為拉普拉斯算子,參數alpha用於控制算子形狀,取值範圍為[0,1],默認值為0.2.
函數格式:H = fspecial('laplacian',alpha)
5、'log'Laplacian of Gaussian filter為拉普拉斯高斯算子,有兩個參數,hsize表示模板尺寸,默認值為[3 3],sigma為濾波器的標準差,單位為像素,默認值為0.5。
函數格式:H = fspecial('log',hsize,sigma)
6、'motion'motion filter運動模糊算子,有兩個參數,表示攝像物體逆時針方向以theta角度運動了len個像素,len的默認值為9,theta的默認值為0。
函數格式:H = fspecial('motion',len,theta)
7、'prewitt'Prewitt horizontal edge-emphasizing filter用於邊緣增強,大小為[3 3],無參數。
函數格式:H = fspecial('prewitt')
8、'sobel'Sobel horizontal edge-emphasizing filter用於邊緣提取,無參數
函數格式:H = fspecial('sobel')the filter H: H'.9、'unsharp'unsharp contrast enhancement filter為對比度增強濾波器。參數alpha用於控制濾波器的形狀,範圍為[0,1],默認值為0.2.函數格式:H = fspecial('unsharp',alpha)