Performance issue cloning features algorithm sources into my project

asked 2013-05-29 04:09:31 -0600

ShadowTS gravatar image

Hello, I'm working on a project for which I want to modify the ORB algorithm. To do this within my C++ project I copied the sources orb.cpp, fast.cpp, fast_score.cpp, fast_score.hpp, precomp.cpp, precomp.hpp. The source of FAST is necessary as it is called by the algorithm ORB and I would like to optimize that as well. The last 4 sources are necessary as called with "include" in fast.cpp. I also created a new header by copying the class declarations (fast and orb) from features2d.hpp in a new header file.

Because I want to reuse the data structures of OpenCV in my project, I added the include to features2d.hpp, core.hpp etc etc because I need structures such as Mat, KeyPoint...

As a first trial to test if it works I simply changed the names of all classes of the copied sources, so they can be instantiated in a distinct manner.

The problem is the following: the cloned algorithm works, but the performance (computational time, FPS) is worse by almost 50% compared to invoke the algorithm of OpenCV. What can be the problem? I did not expect a gap so large!

Actually I'm working and testing on a Mac laptop, but I will eventually take my project to Android.

edit retag flag offensive close merge delete

Comments

3

guess you have used different compiler flags for your project, e.g. debug-mode, or TBB or SSE, ...

Guanta gravatar imageGuanta ( 2013-05-29 04:21:03 -0600 )edit
1

@Guanta you're right! I was using eclipse with build configuration "debug". Switching to "release" took back performance to values ​​comparable to those of opencv!

ShadowTS gravatar imageShadowTS ( 2013-05-30 10:18:29 -0600 )edit