c++ - Converting IplImage into 1D vector in OpenCV -


I want to convert an Mxn IplImage to an (M * N) x 1 1D vector. Can it be done with any work in OpenCV?

Any help is greatly appreciated.

<

  cvmat * cvareshape (const cvArr * arr, cvmat * Header, int newcn, int newRows = 0)  

Sizes change without copying the matrix / image.

And the next example converts 3x3 matrix into 1x9 vector:

  CvMat * mat = cvCreateMat (3, 3, CV_32F); Cvmt row_header, * line; Line = CRR snap (mat, and row_header, 0, 1);  

Comments