Hello OpenCV'ers,
I am using the OpenCV function: cvExtractSURF but I am finding a major memory leak. Has anyone successfully implemented this call? My code is as follows:
IplImage *cvImage = [self CreateIplImageFromUIImage:image grayscale:YES];
CvMemStorage* storage = cvCreateMemStorage(0);
CvSeq *objectKeypoints = 0;
//CvSeq *objectDescriptors = 0;
CvSURFParams params = cvSURFParams(self.hessianThreshold, 0);
double tt = (double)cvGetTickCount();
//Extract the features
cvExtractSURF( cvImage, 0, &objectKeypoints, NULL, storage, params, 0);
tt = (double)cvGetTickCount() - tt;
//NSLog(@"%d features found in %gms seconds\n", objectKeypoints->total, tt/(cvGetTickFrequency()*1000.));
cvReleaseImage(&cvImage);
cvReleaseMemStorage(&storage);
Any ideas where this could be leaking? When I comment out the line:
cvExtractSURF( cvImage, 0, &objectKeypoints, NULL, storage, params, 0);
no leak occurs.
Many many thanks, Brett