1.各向同性高斯核函数
一般的高斯滤波模板选择5x5,方差1.0,
模板的(0,0)位置在模板中心。
模板与图像卷积进行图形滤波、平滑。
计算高斯模板的代码如下
import math
import numpy as np
def test(dirt,x,y):
result=1/(2*math.pi*math.pow(dirt,2))*math.exp(-(math.pow(x,2)+math.pow(y,2))/(2*math.pow(dirt,2)))
return result;
def test2():
arr=np.ndarray((5,5),'f')
for i in range(5):
for j in range(5):
arr[i][j]=test(1.0,i-2,j-2)
return arr
参考文章:
http://blog.csdn.net/hhygcy/article/details/4329056
章文川,张智,赵强等.基于各向异性高斯方向导数滤波器的角点检测[J].
计算机视觉特征提取与图像处理(第三版)