openpiv.pyprocess.correlate_windows

openpiv.pyprocess.correlate_windows(window_a, window_b, correlation_method='fft', convolve2d=<function convolve2d>, rfft2=<function rfft2>, irfft2=<function irfft2>)[source]

Compute correlation function between two interrogation windows. The correlation function can be computed by using the correlation theorem to speed up the computation. :param window_a: a two dimensions array for the first interrogation window :type window_a: 2d np.ndarray :param window_b: a two dimensions array for the second interrogation window :type window_b: 2d np.ndarray :param correlation_method: ‘circular’ - FFT based without zero-padding

‘linear’ - FFT based with zero-padding ‘direct’ - linear convolution based Default is ‘fft’, which is much faster.
Parameters:
  • convolve2d (function) – function used for 2d convolutions
  • rfft2 (function) – function used for rfft2
  • irfft2 (function) – function used for irfft2
Returns:

  • corr (2d np.ndarray) – a two dimensions array for the correlation function.
  • Note that due to the wish to use 2^N windows for faster FFT
  • we use a slightly different convention for the size of the
  • correlation map. The theory says it is M+N-1, and the
  • ’direct’ method gets this size out
  • the FFT-based method returns M+N size out, where M is the window_size
  • and N is the search_area_size
  • It leads to inconsistency of the output