Ask Your Question
1

OpenCV C++ interface and Qt framework

asked 2013-04-21 04:31:06 -0600

PhilipJ gravatar image

Hello all.

I've been using OpenCV to create a project I need to make. I made a fully functioning console application, and now want to make it more graphical (adding a GUI). I'm using Qt for that.

Everything went well, I was getting into Qt programming, but then something strange happened. When I was calling some of my functions from the Qt project, I was experiencing strange crashes. From some reason, certain opencv functions fail when called from a 'qt project'. Functions include split, findChessboardcorners, cornerSubPix, ... I used the c++ interface. Strangly, the crashes seemed to resolve when calling the function with the c interface.

Does anybody has ANY idea why this might happen? I'm using OpenCV 2.4.2, and Qt 4.8.4.

Any help would be greatly appreciated.

Note: I'm using Windows 7, 64 bit. IDE is Visual Studio 2010.

Kind regards, Philip

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-04-24 09:36:06 -0600

zerog80 gravatar image

Hi, I'm currently using OpenCV 2.4.3 with Qt 4.8.3 inside Qt Creator on a Linux system and once the OpenCV library was linked inside the Qt Project file, everything is working properly, I can call every OpenCV and Qt function after including "opencv2/opencv.hpp" and "QtGui".

Have you tried to import your VS project inside Qt Creator and rebuild it in there?

edit flag offensive delete link more

Comments

Hi,

I have tried Qt creator, but for some reason, it won't work on my system. It keeps complaining about the target system (being x64, not x86). And when I change the target system, the error just reverses. So complete fail :)

However, my problem seemed to resolve itself for god knows which reason! I can call opencv functions without any problems (only imread still fails, so I use cvLoadImage).

Can't explain why, don't have time to find out the problem at the moment. Hopefully later on :)

PhilipJ gravatar imagePhilipJ ( 2013-05-01 06:22:51 -0600 )edit

Hi, I have the same problem, imread don't work at all with opencv 2.4.6 and vc2012x64, but cvLoadImage works.Why? if someone have the answer please commit it, thanks

ashare gravatar imageashare ( 2013-09-05 21:58:22 -0600 )edit

Question Tools

Stats

Asked: 2013-04-21 04:31:06 -0600

Seen: 936 times

Last updated: Apr 24 '13