copied opencv code slower than pre-compiled code

asked 2020-05-26 01:04:03 -0500

healthy_H gravatar image

updated 2020-05-26 05:29:25 -0500

For the project I am currently working on, I need to modify the opencv MSER funtion. So, I have copied the github opencv code, and included those files, but even without modifying anything, I observed that opencv precompiled function runs much faster than the function I copied.. I searched for flags to see if any are disabled, but couldn't find any.. Did anyone encounter the same problem?? Attached below is my Qt .pro file...:

QT       += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
    main.cpp \
    mainwindow.cpp
HEADERS += \
    cvconfig.h \
    mainwindow.h \
    precomp.hpp \
    private.hpp
FORMS += \
    mainwindow.ui
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/release/ -lopencv_core
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/debug/ -lopencv_core
else:unix: LIBS += -L$$PWD/../../../../../usr/local/lib/ -lopencv_core
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/release/ -lopencv_features2d
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/debug/ -lopencv_features2d
else:unix: LIBS += -L$$PWD/../../../../../usr/local/lib/ -lopencv_features2d
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/release/ -lopencv_highgui
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/debug/ -lopencv_highgui
else:unix: LIBS += -L$$PWD/../../../../../usr/local/lib/ -lopencv_highgui
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/release/ -lopencv_imgproc
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/debug/ -lopencv_imgproc
else:unix: LIBS += -L$$PWD/../../../../../usr/local/lib/ -lopencv_imgproc
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/release/ -lopencv_imgcodecs
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../usr/local/lib/debug/ -lopencv_imgcodecs
else:unix: LIBS += -L$$PWD/../../../../../usr/local/lib/ -lopencv_imgcodecs
INCLUDEPATH += $$PWD/../../../../../usr/local/include
DEPENDPATH += $$PWD/../../../../../usr/local/include

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/ippicv/ippicv_lnx/lib/intel64/release/ -lippicv
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/ippicv/ippicv_lnx/lib/intel64/debug/ -lippicv
else:unix: LIBS += -L$$PWD/ippicv/ippicv_lnx/lib/intel64/ -lippicv
INCLUDEPATH += $$PWD/ippicv/ippicv_lnx/lib/intel64
DEPENDPATH += $$PWD/ippicv/ippicv_lnx/lib/intel64
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/ippicv/ippicv_lnx/lib/intel64/release/libippicv.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/ippicv/ippicv_lnx/lib/intel64/debug/libippicv.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/ippicv/ippicv_lnx/lib/intel64/release/ippicv.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/ippicv/ippicv_lnx/lib/intel64/debug/ippicv.lib
else:unix: PRE_TARGETDEPS += $$PWD/ippicv/ippicv_lnx/lib/intel64/libippicv.a

INCLUDEPATH += $$PWD/ippicv/ippicv_lnx/include
INCLUDEPATH += $$PWD/ippicv/ippiw_lnx/include
edit retag flag offensive close merge delete

Comments

1

please do not attach screenshots of code or similar here.

edit your question, and paste it as TEXT, thank you.

berak gravatar imageberak ( 2020-05-26 01:14:39 -0500 )edit
1

which compiler do you actually use ?

(prebuild libs are for VS only, but your project looks like it's using mingw ?)

debug build ? which configuration ?

berak gravatar imageberak ( 2020-05-26 03:04:54 -0500 )edit

Thanks for the response, when I say prebuilt libs, I mean the .so files generated after cmake in linux. And in the above example, the compiler is a qt project which uses g++..

healthy_H gravatar imagehealthy_H ( 2020-05-26 04:09:39 -0500 )edit