cvExtractSurf: parameter useProvidedKeyPts

asked 2014-03-05 14:14:21 -0600

Catoz gravatar image

Hi, I'm trying to reuse previously computed key-points with "cvExtractSurf", setting useProvidedKeyPts = 1. This short snipped can show the issue.

CvSeq *imageKeypoints = 0;
CvSeq *imageDescriptors = 0;
CvMemStorage* storage = cvCreateMemStorage(0);
CvSURFParams params = cvSURFParams(400, extended);

//working version (KP+descriptors)    
//cvExtractSURF( image, 0, &imageKeypoints, &imageDescriptors, storage, params, 0 );

//not working version           
cvExtractSURF( image, 0, &imageKeypoints, NULL, storage, params, 0 );
cvExtractSURF( image, 0, &imageKeypoints, &imageDescriptors, storage, params, 1 );

Actually before the last call to cvExtractSurf, the values are: imageKeypoints->total : 27411. imageDescriptors : NULL

After the call to cvExtractSurf, the values are such that every KPs seem to be erased. imageKeypoints->total : 0 imageDescriptors->total : 0

The same behavior is shown with 2.4.5 and 2.4.8 version. (in OpenCV 2.1 it was working correctly)

I need to keep KPs and descriptors computations separated. In case I'm doing wrong, anyone can please suggest me the correct way to do that? Thanks.

edit retag flag offensive close merge delete

Comments

oh, please stop using the outdated c-api

berak gravatar imageberak ( 2014-03-05 14:22:02 -0600 )edit