Ask Your Question

shadowsheep's profile - activity

2020-09-22 00:25:20 -0500 received badge  Student (source)
2020-04-07 10:05:12 -0500 received badge  Notable Question (source)
2017-07-19 07:52:37 -0500 received badge  Popular Question (source)
2016-11-06 06:42:05 -0500 received badge  Popular Question (source)
2015-08-02 14:12:46 -0500 received badge  Scholar (source)
2015-08-02 14:12:42 -0500 received badge  Supporter (source)
2015-08-02 11:20:51 -0500 commented question OpenCV 3.0 Vs OpenCV 2.4.9 + Sobel Performance

@matman: Yep! It works!

    Hello, World! 3.0.0
 STD SOBEL STARTED 1ST CALL

 STD SOBEL FINISHED 1ST CALL in 20.2502, total 39.5455
 STD SOBEL STARTED 2ND CALL

 STD SOBEL FINISHED 2ND CALL in 20.683, total 67.209

So @matman if you wanna answer this question, I'll mark it like "solved" because in fact it solves it! Thanks to all.

Perhaps that's strange, it's like OpenCV 3.0 setup OpenCL driver (like GPU module) even if I don't ask them to use it.

Thank you all and see you at the next question.

2015-08-02 10:25:30 -0500 received badge  Necromancer (source)
2015-08-02 03:08:23 -0500 commented question OpenCV 3.0 Vs OpenCV 2.4.9 + Sobel Performance

@Eduardo, thanks to have given it a try. So, like StevenPuttemans says, it seems like OpenCV 3.0 have a first function call overhead.

I've so made a new test with only two calls that seems to enforce that assumption.

I've put the code in the question.

Hello, World! 2.4.9

STD SOBEL STARTED 1ST CALL

STD SOBEL FINISHED 1ST CALL in 22.2636, total 45.8063 STD SOBEL STARTED 2ND CALL

STD SOBEL FINISHED 2ND CALL in 23.4234, total 86.663

Hello, World! 3.0.0

STD SOBEL STARTED 1ST CALL

STD SOBEL FINISHED 1ST CALL in 426.064, total 438.489 STD SOBEL STARTED 2ND CALL

STD SOBEL FINISHED 2ND CALL in 22.0421, total 469.745

2015-08-02 03:04:57 -0500 received badge  Enthusiast
2015-08-01 12:33:59 -0500 received badge  Self-Learner (source)
2015-08-01 08:34:00 -0500 commented question OpenCV 3.0 Vs OpenCV 2.4.9 + Sobel Performance

Yep, so if you wanna try the src with the attach image we could check the performance on your system.

2015-08-01 08:26:25 -0500 commented question OpenCV 3.0 Vs OpenCV 2.4.9 + Sobel Performance

There are no pdb files. Only src and dll and lib used :) It's the world300.dll that take the most of the space. Have you looked at the zip?! :/

I've put all the dll I've used right because you could try my dll!

2015-08-01 07:56:35 -0500 commented question Opencv 3.0 + visual studio 2013 + CUDA + CMake

The question is answer by Eduardo when he asked me to try the prebuild binaries. Because the problem I'm experiencing there's also with the prebuild version I've open another question here: http://answers.opencv.org/question/67...

2015-08-01 07:55:10 -0500 asked a question OpenCV 3.0 Vs OpenCV 2.4.9 + Sobel Performance

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/...

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?

2015-07-30 05:33:02 -0500 commented question Opencv 3.0 + visual studio 2013 + CUDA + CMake

Yes, the code below

int scale = 1;
int delta = 0;
int ddepth = CV_16S;

Mat grad;

int a, b;

cout << "\n STD SOBEL STARTED \n";
a = getTickCount();
Sobel(image, grad, ddepth, 1, 1, 5, scale, delta, BORDER_DEFAULT);
b = getTickCount();

printf("\n STD SOBEL FINISHED in %f, total = %f \n", 1000 * (((double)(b - a)) / getTickFrequency()), 1000 * (((double)(B - A)) / getTickFrequency()));

Run faster with OpenCV 2.4.9 than OpenCV 3.0

2015-07-30 05:18:11 -0500 commented question Opencv 3.0 + visual studio 2013 + CUDA + CMake

Eduardo I've tried also with the precompiled *world300.dll and I've got the same lower performances than version 2.4.9. But now the question is... why with OpenCV 3.0.0 the sobel performance are so degraded than OpenCV 2.4.9?

2015-07-29 14:57:03 -0500 commented question Opencv 3.0 + visual studio 2013 + CUDA + CMake

I've posted my CMAKE output. Hope it helps us to find the reason...

2015-07-29 14:56:21 -0500 received badge  Editor (source)
2015-07-28 23:08:35 -0500 asked a question Opencv 3.0 + visual studio 2013 + CUDA + CMake

I've successfully compiled OpenCV 3.0 with CUDA 7 with Visual Studio 2013 makeing the solution with CMake for x64 architecture. I've notice that my *300.dll performances are slower than the already compiled *249.dll for x86 architecture (downloaded from opencv.org). For example the same sobel test program run with 2.4.9 at 30msec while run with 3.0 at 280msec O_O. How could it be possible? Have I missing some optimization or building options?

Thats my Flag for Release: //Flags used by the compiler during release builds. CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG

Here's my CMAKE Output

General configuration for OpenCV 3.0.0 =====================================
  Version control:               unknown

  Platform:
    Host:                        Windows 6.2 AMD64
    CMake:                       3.3.0-rc4
    CMake generator:             Visual Studio 12 2013 Win64
    CMake build tool:            C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe
    MSVC:                        1800

  C/C++:
    Built as dynamic libs?:      YES
    C++ Compiler:                C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe  (ver 18.0.31101.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /wd4251 /wd4324 /MP8  /MD /O2 /Ob2 /D NDEBUG  /Zi
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR /EHa  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /wd4251 /wd4324 /MP8  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/x86_amd64/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi    /MP8  /MD /O2 /Ob2 /D NDEBUG  /Zi
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi    /MP8  /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:x64  /INCREMENTAL:NO  /debug
    Linker flags (Debug):        /machine:x64  /debug /INCREMENTAL 
    Precompiled headers:         YES
    Extra dependencies:          comctl32 gdi32 ole32 setupapi ws2_32 vfw32 cudart nppc nppi npps cublas cufft
    3rdparty dependencies:       zlib libjpeg libwebp libpng libtiff libjasper IlmImf ippicv

  OpenCV modules:
    To be built:                 hal cudev core cudaarithm flann imgproc ml video cudabgsegm cudafilters cudaimgproc cudawarping imgcodecs photo shape videoio cudacodec highgui objdetect ts features2d calib3d cudafeatures2d cudalegacy cudaobjdetect cudaoptflow cudastereo stitching superres videostab
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 python3 viz

  Windows RT support:            NO

  GUI: 
    QT:                          NO
    Win32 UI:                    YES
    OpenGL support:              NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.2.8)
    JPEG:                        build (ver 90)
    WEBP:                        build (ver 0.3.1)
    PNG:                         build (ver 1.5.12)
    TIFF:                        build (ver 42 - 4.0.2)
    JPEG 2000:                   build (ver 1.900.1)
    OpenEXR:                     build (ver 1.7.1)
    GDAL:                        NO

  Video I/O:
    Video for Windows:           YES
    DC1394 1.x:                  NO
    DC1394 2.x:                  NO
    FFMPEG:                      YES (prebuilt binaries)
      codec:                     YES (ver 55.18.102)
      format:                    YES (ver 55.12.100)
      util:                      YES (ver 52.38.100)
      swscale:                   YES (ver 2.3.100)
      resample:                  NO
      gentoo-style:              YES
    OpenNI:                      NO
    OpenNI PrimeSensor Modules:  NO
    OpenNI2:                     NO
    PvAPI:                       NO
    GigEVisionSDK:               NO
    DirectShow:                  YES
    Media Foundation ...
(more)
2015-07-28 23:08:34 -0500 answered a question Opencv 3.0, visual studio 2013-

You are trying to build for x64 architecture? If so, It's because your application try to load the wrong version of dll. To check this, first of all try to copy all the *300.dll in your output dir (for Release) or *300d.dll (for Debug).

Run the .exe program and if now it works, all you have to do is to make a custom build in order to copy the right opencv dll in your outdir at every build. Or you must put on your path the opencv build\bin dir.