I'm experiencing a very performance differences between 2.4.9 and 3.0.
With the simple Soble function I see OpenCV 3.0 run 10x slower than OpenCV 2.4.9 ... O_O ...
I've build up a Visual Studio 2013 project self contained with my benchmark.
Could anyone try and tell me if It sees the same performance difference and could someone explain me the reason?
The project could be downloaded at: http://www.versionestabile.it/opencv/openCvTestDifferentVersionsPerformances.zip
With @Eduardo, @StevenPuttemans we ended up to note that OpenCV 3.0 Sobel First Call has a very big overhead, right near 700msec.
cout << "Hello, World! " << CV_VERSION;
int64 A, B;
A = getTickCount();
string _image_name = "equalizzata300.bmp";
string _image_path = "../img/";
Mat image;
image = imread(_image_path + _image_name, CV_8UC3);
if (!image.data)
{
cout << "Could not open or find the image" << std::endl;
return;
}
int scale = 1;
int delta = 0;
int ddepth = CV_16S;
Mat grad;
int64 a, b;
std::cout << "\n STD SOBEL STARTED 1ST CALL \n";
a = getTickCount();
Sobel(image, grad, ddepth, 1, 1, 5, scale, delta, BORDER_DEFAULT);
b = getTickCount();
convertScaleAbs(grad, grad);
B = getTickCount();
cout << "\n STD SOBEL FINISHED 1ST CALL in " << 1000 * (((double)(b - a)) / getTickFrequency()) << ", total " << 1000 * (((double)(B - A)) / getTickFrequency());
std::cout << "\n STD SOBEL STARTED 2ND CALL \n";
a = getTickCount();
Sobel(image, grad, ddepth, 1, 1, 5, scale, delta, BORDER_DEFAULT);
b = getTickCount();
convertScaleAbs(grad, grad);
B = getTickCount();
cout << "\n STD SOBEL FINISHED 2ND CALL in " << 1000 * (((double)(b - a)) / getTickFrequency()) << ", total " << 1000 * (((double)(B - A)) / getTickFrequency());
namedWindow("Sobel", CV_WINDOW_AUTOSIZE);
imshow("Sobel", grad);
waitKey(0);
The question now is: Does someone know the reason of that? Is that true also for other image processing functions?