OpenCV: How to copy CvSeq data into CvMat?
- by Can Bal
I have a CvSeq structure at hand, which is the output of an available OpenCV function. This holds 128 bytes of data in each of the sequence elements. I want to copy each of these 128-byte elements into rows of a CvMat structure to form a N-by-128 of type CV_32FC1. What would be the most efficient way to do this?
I thought of using memcpy but I couldn't come up with a working solution.
For the details, I want to calculate the SURF features in an image by cvExtractSURF() function, and copy the SURF descriptors into a matrix for passing it to the cvKMeans2().