opencv2.1 cvGoodFeaturesToTrack is faster using debug dll than release dll (Bug #1838)
Description
If I use these dll the function cvGoodFeaturesToTrack is slower#pragma comment(lib,"cv210.lib")
#pragma comment(lib,"cxcore210.lib")
#pragma comment(lib,"highgui210.lib")
I replace these dll by #pragma comment(lib,"cv210d.lib")
#pragma comment(lib,"cxcore210d.lib")
#pragma comment(lib,"highgui210d.lib")
cvGoodFeaturesToTrack is faster.
Associated revisions
Merge pull request #1838 from alekcac:ios64_fix
History
Updated by lin huan almost 13 years ago
example:
@#pragma comment(lib,"cv210d.lib")
#pragma comment(lib,"cxcore210d.lib")
#pragma comment(lib,"highgui210d.lib")
#include <cv.h>
#include <highgui.h>
#include <iostream>
#include <crtdbg.h>
#include <Windows.h>
LARGE_INTEGER BegainTime ;
LARGE_INTEGER EndTime ;
LARGE_INTEGER Frequency ;
using namespace std;
inline void EnableMemLeakCheck()
{
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
}
int main()
{
QueryPerformanceFrequency(&Frequency); //获得机器内部定时器的时钟频率
float ft=float(Frequency.QuadPart);
EnableMemLeakCheck();
IplImage *image0=cvLoadImage("lena.jpg",CV_LOAD_IMAGE_GRAYSCALE);
//opencv find good features to track
const int MIN_DISTANCE = 3;
const double QUALITY_LEVEL = 0.02;
IplImage * eig_img=cvCreateImage(cvGetSize(image0),IPL_DEPTH_32F,1);
IplImage * temp_img=cvCloneImage(eig_img);
int counter=200;
CvPoint2D32f fcorners[200];
QueryPerformanceCounter(&BegainTime);
cvGoodFeaturesToTrack(image0,eig_img,temp_img,fcorners,&counter,QUALITY_LEVEL,MIN_DISTANCE);
QueryPerformanceCounter(&EndTime);
printf("time2 %f s\n",float((EndTime.QuadPart - BegainTime.QuadPart )/ft));
printf("the opencv function find the number of features is %d\n", counter);
cvNamedWindow("4");
for (int i=0;i<counter;i++)
{
cvLine(image0,cvPointFrom32f(fcorners[i]),cvPointFrom32f(fcorners[i]),CV_RGB(255,0,0),5);
}
cvShowImage("4",image0);
cvWaitKey();
cvDestroyAllWindows();
cvReleaseImage(&image0);
cvReleaseImage(&eig_img);
cvReleaseImage(&temp_img);
}@
Updated by Vadim Pisarevsky almost 13 years ago
we do not support previous versions of OpenCV. Please, try the latest OpenCV 2.3.x or 2.4 beta. If there is a problem with performance, please, reopen the ticket
- Status changed from Open to Cancelled
- Category set to imgproc, video
- Assignee set to Vadim Pisarevsky
Updated by Andrey Kamaev almost 13 years ago
- Target version set to 2.4.0
Updated by lin huan almost 13 years ago
today I try the opencv 2.31
if I use debug vesion
@#pragma comment(lib, "opencv_core231d.lib")
#pragma comment(lib, "opencv_highgui231d.lib")
#pragma comment(lib,"opencv_imgproc231d.lib")
//#pragma comment(lib, "opencv_flann230.lib")
#pragma comment(lib,"opencv_video231d.lib")
//#pragma warning(disable : 4819)
#include "cv.h"
#include "highgui.h"@
cvGoodFeaturesToTrack cost about 50ms
if I use the release version
@#pragma comment(lib, "opencv_core231.lib")
#pragma comment(lib, "opencv_highgui231.lib")
#pragma comment(lib,"opencv_imgproc231.lib")
//#pragma comment(lib, "opencv_flann230.lib")
#pragma comment(lib,"opencv_video231.lib")
//#pragma warning(disable : 4819)
#include "cv.h"
#include "highgui.h"@
cvGoodFeaturesToTrack cost about 80ms
Is it a bug ???
Updated by Eran Guendelman almost 13 years ago
I experience a similar problem. I had it in 2.3.0, and I just tried 2.4.0 and have it too.
cvGoodFeaturesToTrack is much slower in Release than in Debug.
I do not currently have IPP libraries installed.
Thanks