corr#

Cross-correlation of two inputs

template<typename In1Type, typename In2Type>
__MATX_INLINE__ auto matx::corr(const In1Type &i1, const In2Type &i2, matxConvCorrMode_t mode, matxConvCorrMethod_t method)#

Correlate two input operators.

Template Parameters:
  • In1Type – Type of first input

  • In2Type – Type of second input

Parameters:
  • i1 – First input operator

  • i2 – Second input operator

  • mode – Mode of correlation

  • method – Method for correlation

template<typename In1Type, typename In2Type>
__MATX_INLINE__ auto matx::corr(const In1Type &i1, const In2Type &i2, const int32_t (&axis)[1], matxConvCorrMode_t mode, matxConvCorrMethod_t method)#

Correlate two input operators.

Template Parameters:
  • In1Type – Type of first input

  • In2Type – Type of second input

Parameters:
  • i1 – First input operator

  • i2 – Second input operator

  • axis – the axis to perform correlation

  • mode – Mode of correlation

  • method – Method for correlation

Convolution/Correlation Mode#

The mode parameter specifies how the output size is determined:

  • MATX_C_MODE_FULL: Keep all elements including ramp-up/down (output size = N + M - 1)

  • MATX_C_MODE_SAME: Keep only elements where entire filter was present (output size = max(N, M))

  • MATX_C_MODE_VALID: Keep only elements with full overlap (output size = max(N, M) - min(N, M) + 1)

Convolution/Correlation Method#

The method parameter specifies the algorithm to use:

  • MATX_C_METHOD_DIRECT: Direct convolution using sliding window approach

  • MATX_C_METHOD_FFT: FFT-based convolution using the convolution theorem (may be faster for large inputs)

Examples#

// Full correlation mode with direct correlation
(this->cv_full_even = corr(this->av, this->bv_even, MATX_C_MODE_FULL, MATX_C_METHOD_DIRECT)).run(this->exec);