2012-08-22 10:10:41 -0600 | received badge | ● Editor (source) |
2012-08-22 08:35:53 -0600 | asked a question | How to convert new cv::Mat to older CvSeq* Hi All, I upgraded from 2.1 to the newer 2.4.x version of OpenCV because I liked the idea of having the functionality to easily switch between different feature detectors and extractors. However, I discovered that this was not an easy task. My biggest problem is that the new feature extractor stores the descriptors in a cv::Mat structure. However, my matching and fundamental matrix routines are using CvSeq*Descriptor as an input. void MatchFeatures(CvMat *points1, CvMat *points2, CvSeq *kp1, CvSeq *desc1, CvSeq *kp2, CvSeq *desc2) I spend hours on Google trying to find an answer.. but could not find anything. I have got to convert from CvSeq* to cv::Mat... but do not know how to do this the other way around.. Here the code from CvSeq* to cv::Mat: cv::Mat FromCvSeqToCvMat(CvSeq* Descriptors ) { int length = (int)(Descriptors->elem_size/sizeof(float)); cv::Mat m_object(Descriptors->total, length, CV_32F); } Anyone an idea how to do this in the opposite direction? Greetings, Floris. |