menpo.math.log_gabor(image, **kwargs)[source]

Creates a log-gabor filter bank, including smoothing the images via a low-pass filter at the edges.

To create a 2D filter bank, simply specify the number of phi orientations (orientations in the xy-plane).

To create a 3D filter bank, you must specify both the number of phi (azimuth) and theta (elevation) orientations.

This algorithm is directly derived from work by Peter Kovesi.

  • image ((M, N, ...) ndarray) – Image to be convolved
  • num_scales (int, optional) –

    Number of wavelet scales.

    Default 2D 4
    Default 3D 4
  • num_phi_orientations (int, optional) –

    Number of filter orientations in the xy-plane

    Default 2D 6
    Default 3D 6
  • num_theta_orientations (int, optional) –

    Only required for 3D. Number of filter orientations in the z-plane

    Default 2D N/A
    Default 3D 4
  • min_wavelength (int, optional) –

    Wavelength of smallest scale filter.

    Default 2D 3
    Default 3D 3
  • scaling_constant (int, optional) –

    Scaling factor between successive filters.

    Default 2D 2
    Default 3D 2
  • center_sigma (float, optional) –

    Ratio of the standard deviation of the Gaussian describing the Log Gabor filter’s transfer function in the frequency domain to the filter centre frequency.

    Default 2D 0.65
    Default 3D 0.65
  • d_phi_sigma (float, optional) –

    Angular bandwidth in xy-plane

    Default 2D 1.3
    Default 3D 1.5
  • d_theta_sigma (float, optional) –

    Only required for 3D. Angular bandwidth in z-plane

    Default 2D N/A
    Default 3D 1.5

  • complex_conv ((num_scales, num_orientations, image.shape) ndarray) – Complex valued convolution results. The real part is the result of convolving with the even symmetric filter, the imaginary part is the result from convolution with the odd symmetric filter.
  • bandpass ((num_scales, image.shape) ndarray) – Bandpass images corresponding to each scale s
  • S ((image.shape,) ndarray) – Convolved image


Return the magnitude of the convolution over the image at scale s and orientation o

np.abs(complex_conv[s, o, :, :])

Return the phase angles

np.angle(complex_conv[s, o, :, :])


[1]D. J. Field, “Relations Between the Statistics of Natural Images and the Response Properties of Cortical Cells”, Journal of The Optical Society of America A, Vol 4, No. 12, December 1987. pp 2379-2394