
提前致谢.
解决方法 我不知道你为什么会这么想,但它应该是可能的,通过这些功能,你可以做任何你想做的事情:我应该补充一点,以下是C和C的混合(在OpenCV中也是如此)
CreateSeq
CvSeq * cvCreateSeq(int seqFlags,int headerSize,int elemSize,CvMemStorage * storage)
SeqPush
char * cvSeqPush(CvSeq * seq,voID * element = NulL)
这是代码,我还没有尝试过,如果有错误请告诉我,如果有效,我只是试一试…
vector<KeyPoint> myKeypointVector; //Your KeyPoint vector// Do whatever you want with your vectorCvMemStorage* storage = cvCreateMemStorage(0) // By default the flag 0 is 64K // but myKeypointVector.size()*(sizeof(KeyPoint)+sizeof(CvSeq)) should work// it may be more efficIEnt but be careful there may have seg fault // (not sure about the sizeCvSeq* myKeypointSeq = cvCreateSeq(0,sizeof(CvSeq),sizeof(KeyPoint),storage);// Create the seq at the location storagefor (size_t i=0; myKeypointVector.size(); i++) { int* added = (int*)cvSeqPush(myKeypointSeq,&(myKeypointVector[i])); // Should add the KeyPoint in the Seq}cvClearMemStorage( storage ); cvReleaseMemStorage(&storage); 朱利安,
总结以上是内存溢出为你收集整理的将关键点矢量转换为CvSeq全部内容,希望文章能够帮你解决将关键点矢量转换为CvSeq所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)