Calculate the circular 2D correlation function using the shift_cumulate method. This is an OriginPro only function.
int shift_2d_correlation_circular( int iRows, int iCols, double * mSig1, double * mSig2, double * mCorrelation )
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)
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 } }
shift_2d_correlation_linear
origin.h