Ask Your Question

Revision history [back]

Using viz module from OpenCV-2.4.9 in Ubuntu 14.04 with QT5

I'm trying to lauch some program in C++ using Qt in Ubuntu. I've installed Qt and opencv library correctly. Everything works just fine, but I have problems when it comes to use viz module from opencv 2.4.9.

My .pro file includes:

LIBS +=
       -lboost_system\

CONFIG += link_pkgconfig
PKGCONFIG += opencv

I've included headers and it's fine.

> #include "opencv2/highgui/highgui.hpp"
> #include "opencv2/imgproc/imgproc.hpp"
> #include "opencv2/core/core.hpp"
> #include "opencv2/opencv.hpp"
> #include "boost/lexical_cast.hpp"
> #include <opencv2/viz/vizcore.hpp>

All modules works fine, but when I'm trying to use viz:

> viz::Viz3d Window("Wiz");

the program crashes.

> "warning: GDB: Failed to set
> controlling terminal:
> Niew\305\202a\305\233ciwy ioctl dla
> urz\304\205dzenia\n"
> *** Error in `/home/szymon/Dokumenty/build-bdroid-Desktop_Qt_5_3_GCC_64bit-Debug/bdroid':
> realloc(): invalid pointer:
> 0x00007ffff7313d40 ***

When I'm trying to debug the info appears:

Process stoped, because receved signal from operating system

Signal name: 
SIGABRT
Signal meaning: 
Aborted

At first I thought that some of dependecies wasn't included, but eventually I ran:

> cd
> ~/opencv-2.4.9/samples/cpp/tutorial_code/viz
> g++ -o widget_pose `pkg-config opencv
> --cflags` widget_pose.cpp `pkg-config opencv --libs`

from console and it's working.

I have no idea what might cause the problem. I will appreciate any suggestions.

Thanks in advance.