Calculate the linear 2D correlation function using the shift_cumulate method. This is an OriginPro only function.
int shift_2d_correlation_linear( 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_linear_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(2*nRows-1, 2*nCols-1); int nRet = shift_2d_correlation_linear(nRows, nCols, mat1, mat2, matDest); if (nRet != OE_NOERROR) { printf("Error occurs when calling ocmath function!\n"); return } }
origin.h