initModule_nonfree segfault

asked 2013-03-26 18:40:16 -0500

updated 2013-03-26 18:48:41 -0500

calling cv::initModule_nonfree() is giving a SEGFAULT.

backtrace from gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff51292ab in cv::createSURF () at /home/luca/tmp/opencv-2.4.4/modules/nonfree/src/nonfree_init.cpp:50
50  CV_INIT_ALGORITHM(SURF, "Feature2D.SURF",
(gdb) backtrace
#0  0x00007ffff51292ab in cv::createSURF () at /home/luca/tmp/opencv-2.4.4/modules/nonfree/src/nonfree_init.cpp:50
#1  0x00007ffff51295e1 in cv::initModule_nonfree () at /home/luca/tmp/opencv-2.4.4/modules/nonfree/src/nonfree_init.cpp:70

Opencv 2.4.4 compiled from source, debian 64bit

Test case:

#include <nonfree/nonfree.hpp>

int main(int argc, char* argv[]) {
    cv::initModule_nonfree();
    return 0;
}

---

g++ main.cpp -o main -I/usr/local/include/opencv2 -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_video -lopencv_calib3d -lopencv_features2d -lopencv_objdetect -lopencv_ml -lopencv_flann -lopencv_nonfree -lopencv_contrib -lopencv_legacy -ldl

edit retag flag offensive close merge delete

Comments

1

... Seems it was linking against an older set of opencv2 libs installed by my package manager, adding path to /usr/local/lib solved this.

luca-deltodesco gravatar imageluca-deltodesco ( 2013-03-26 19:23:31 -0500 )edit