I am trying to create a CvMat data structure using cvMat() in OpenCV.
The last parameter of cvMat() expects a void* to the data.
My data is stored in the following data structure
vector<vector<CvPoint2D32f>> data;
I expected
data.at(0)
to work as the last parameter, but the compiler says that it can not convert to void*.
What path should I be taking now ?
Create an array from vectors ? That would waste a lot of time/memory.
data.at(0) has
vector<CvPoint2D32f>type, but you need pointer to the first element of that vector. Try:Also keep in mind, that
vector<vector<CvPoint2D32f>>is not a two dimensional array of CvPoint2D32f. It is more like “vector of references” to one dimensional arrays.