2.1.24.4.56 shift_2d_correlation_circular


Description

Calculate the circular 2D correlation function using the shift_cumulate method. This is an OriginPro only function.

Syntax

int shift_2d_correlation_circular( int iRows, int iCols, double * mSig1, double * mSig2, double * mCorrelation )

Parameters

iRows
[Input] the number of rows in the input matrices.
iCols
[Input] the number of columns in the input matrices.
mSig1
[Input] the input matrix of size iRows*iCols.
mSig2
[Input] the input matrix of size iRows*iCols.
mCorrelation
[Output] the correlation matrix of size iRows*iCols.

Return

0 on success or INVALID_SIZE for invalid matrix size or DATA_SIZE_ERROR for invalid matrices pointers.

(The definition of error codes is according to those in FFT.h)

Examples

EX1

void shift_2d_correlation_circular_ex1()
{
    MatrixLayer ml = Project.ActiveLayer();
    MatrixObject mo = ml.MatrixObjects(0);
    matrixbase& matbase = mo.GetDataObject();
    matrix mat1 = matbase;
    
    matrix mat2;
    mat2 = mat1; 
    int nRows = mat1.GetNumRows();
    int nCols = mat1.GetNumRows();
    
    matrix matDest(nRows, nCols);
    int nRet = shift_2d_correlation_circular(nRows, nCols, mat1, mat2, matDest);
    if (nRet != OE_NOERROR)
    {
        printf("Error occurs when calling ocmath function!\n");
        return
    }
}

Remark

See Also

shift_2d_correlation_linear

Header to Include

origin.h

Reference