# 结合Gabor滤波器定义解读Python中函数filters.gabor_filter

https://blog.csdn.net/jorg_zhao/article/details/47153115

### 一、Gabor滤波器

Gabor滤波器，最主要使用优势体现在对物体纹理特征的提取上。

### 二、Gabor函数结合代码分析

σ 的值不能直接设置，它仅随着带宽b变化。带宽值必须是正实数，通常为1，此时，标准差和波长的关系为：σ=0.56λ。

##### Python自带函数
gabor_filter(image, frequency, theta=0, bandwidth=1, sigma_x=None,  sigma_y=None, n_stds=3, offset=0, mode='reflect', cval=0)

'''
Parameters
----------
image : 2-D array 输入图像
Input image.
frequency : float 谐波函数的空间频率，以像素位指定单位
Spatial frequency of the harmonic function. Specified in pixels.
theta : float, optional 这个参数指定了Gabor函数并行条纹的方向，它的取值为0到2π
Orientation in radians. If 0, the harmonic is in the x-direction.
bandwidth : float, optional 滤波器捕获带宽
The bandwidth captured by the filter. For fixed bandwidth, sigma_x
and sigma_y will decrease with increasing frequency. This value is
ignored if sigma_x and sigma_y are set by the user.
sigma_x, sigma_y : float, optional X和Y方向的标准差，决定了滤波器作用区域的大小
Standard deviation in x- and y-directions. These directions apply to
the kernel *before* rotation. If theta = pi/2, then the kernel is
rotated 90 degrees so that sigma_x controls the *vertical* direction.
n_stds : scalar, optional
The linear size of the kernel is n_stds (3 by default) standard
deviations.
offset : float, optional 相位偏移
Phase offset of harmonic function in radians.
mode : {'constant', 'nearest', 'reflect', 'mirror', 'wrap'}, optional
Mode used to convolve image with a kernel, passed to ndi.convolve
cval : scalar, optional
Value to fill past edges of input if mode of convolution is
'constant'. The parameter is passed to ndi.convolve.

Returns
-------
real, imag : arrays
Filtered images using the real and imaginary parts of the Gabor filter
kernel. Images are of the same dimensions as the input one.
'''


©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客