I am new to OpenCV and I am trying to create a n-dimensional array and access each element using CvMatND.
I can access a 2D matrix by data[i*step + j*nchannels + 0], how do I access the elements of a matrix created by
int size[] = { 12, 12, 12 };
CvMatND* matB = cvCreateMatND(3, size, CV_8U);
int *Data = matA->data.i;
Thanks
I’ve reviewed and tested my previous answer, and as you have found out it was not accurate.
This is the working code to iterate on all the elements of a 3D array.