Ask Your Question

BDVS's profile - activity

2013-10-30 15:51:36 -0600 asked a question OpenCV2.4.6 with Qt5.1.0 - clashing JPEG versions

I am seeking to use OpenCV2.4.6 with Qt5.1.0 in a statically built application. Qt seems to need JPEG version 8.0 libraries and OpenCV2.4.6 needs JPEG version 6.2.

Can OpenCV2.4.6 be made to work with JPEG version 8.0 libraries - does the call version need to match the library version?

Update: I'm thinking it may be link order...the code using OpenCV is first built into a (static) library...which presumably pulls in OpenCV's JPEG at link time. This library is then linked into the main app which uses Qt call to read a JPEG file. It's as though Qt uses the (clashing version) of OpenCV's JPEG rather than it's own. Everything appears to build cleanly.

Library build: g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I....\ToolkitNonThreaded\TVR -I"....\ToolkitNonThreaded\Core" -I"............\PInstalls\OpenCV2.4.6\opencv\release\install\include" -I"C:\Qt\Qt5.1.0\Tools" -I"C:\qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\include" -I"C:\qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\include\QtWidgets" -I"C:\qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\include\QtGui" -I"C:\qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\include\QtCore" -I"release" -I"." -I"C:\Qt\Qt5.1.0\qt-everywhere-opensource-src-5.1.0\qtbase\mkspecs\win32-g++" -o release\Steps.o ....\ToolkitNonThreaded\TVR\Steps.cpp

ar -ru release\libTVR.a release/TVRAnalyse.o release/ProcessingStep.o release/Steps.o release/VehicleClass.o release/moc_TVRAnalyse.o release/moc_ProcessingStep.o

Final build: g++ -static -static-libgcc -Wl,-s -Wl,-subsystem,windows -mthreads -o release\Toolkit.exe object_script.Toolkit.Release -lmingw32 -lqtmain -L../pipslib/release -L../winpcap-lib -L../qtsingleapplication/release -lpips ..\winpcap-lib\wpcap.lib ..\winpcap-lib\Packet.lib -lIPHlpApi -lWs2_32 -LC:/qt/Qt5.1.0/qt-everywhere-opensource-src-5.1.0/qtbase/lib -lwpcap -lpacket -lqtsingleapplication -L../TVR/release -lTVR -LF:/PInstalls/OpenCV2.4.6/opencv/release/install/lib -lopencv_video246 -lopencv_calib3d246 -lopencv_features2d246 -lopencv_flann246 -lopencv_imgproc246 -lopencv_highgui246 -lopencv_legacy246 -lopencv_core246 -LC:/Qt/Qt5.1.0/Tools/OpenCV2.4.6/opencv/release/3rdparty/lib -lIlmImf -llibjasper -llibjpeg -llibpng -llibtiff -lzlib -LC:/Qt/Qt5.1.0/Tools/mingw48_32/i686-w64-mingw32/lib -lQt5XmlPatterns -lQt5Widgets -lQt5Xml -lQt5Network -ldnsapi -LC:/Qt/Qt5.1.0/qt-everywhere-opensource-src-5.1.0/qtbase/plugins/platforms -lqwindows -lwinspool -lshlwapi -lQt5PlatformSupport -lQt5Gui -lcomdlg32 -loleaut32 -limm32 -lwinmm -lglu32 -lopengl32 -lgdi32 -lQt5Core -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz release\Toolkit_res.o

Runtime Qt error: Wrong JPEG library version: library is 62, caller expects 80

If I use a non-statically built Qt and the same source, with dll's all works fine.

2012-11-05 15:55:02 -0600 received badge  Student (source)
2012-10-18 15:34:24 -0600 received badge  Editor (source)
2012-10-18 15:31:28 -0600 asked a question cvFindHomography crashes with more than 4 points

My environment is Mingw4.4 under Qt 4.8.1 with OpenCV2.4.2 built under Ming4.4

I am seeking to calibrate a camera from 9 points on a plane at circa 20 degrees to the camera, 4 in the corners and the other 5 at the mid points. When I run cvFindHomography with the 4 corner points it fills in the matrix correctly; however when I try 6 points (adding the mid-point at the top and bottom of the image, it crashes.

int count = 6;
float aImg[] = {
3.f, 8.f,
646.f, 12.f,
1372.f, 15.f,
11.f, 499.f,
630.f, 498.f,
1382.f, 504.f
};
float aWorld[] = {
    280.f, 1871.f,
    442.f, 1887.f,
    635.f, 1911.f,
    238.f, 1542.f,
    195.f, 1548.f,
    528.f, 1554.f
};

    CvMat mImg, mWorld;
    cvInitMatHeader(&mImg, count, 2, CV_32FC1, aImg,0);
    cvInitMatHeader(&mWorld, count, 2, CV_32FC1, aWorld,0);

    CvMat *h1 = cvCreateMat(3, 3, CV_32FC1);
    qDebug("OK here");
    cvFindHomography(&mImg, &mWorld, h1, 0, 0.0, NULL );
    qDebug("Doesn't get to here");

Yet taking out two points and it's fine:

int count = 4; float aImg[] = { 3.f, 8.f, 1372.f, 15.f, 11.f, 499.f, 1382.f, 504.f }; float aWorld[] = { 280.f, 1871.f, 635.f, 1911.f, 238.f, 1542.f, 528.f, 1554.f };

Crash details: Problem Event Name: APPCRASH Application Name: OpenCVTest.exe Application Version: 0.0.0.0 Application Timestamp: 5080664d Fault Module Name: libopencv_core242.dll Fault Module Version: 0.0.0.0 Fault Module Timestamp: 507ee5a5 Exception Code: c0000005 Exception Offset: 000fbe96 OS Version: 6.1.7601.2.1.0.256.48

2012-10-17 04:33:45 -0600 asked a question MingGW (4.7.0) does not build OpenCV2.4.2

I have previously been running OpenCV2.1 but need to upgrade to latest to get extended findHomography implementation with additional parameters.

MINGW gcc 4.7.0 (installed with TDM-GCC-4.7.1.2) drops out when trying to build algorithm.cpp.obj, due I think to not handling template declaration correctly.

Mingw drops out with: ...operations.hpp:2634: error: invalid initialization of reference of type 'cv::Matx<cv::algorithm, m,="" n="">&' from expression of type 'cv::Ptr<cv::algorithm>'

Can anyone point me at a pre-built set of libraries under mingw for OpenCV2.4.2, or has anyone been successful in building it under any mingw release? (I need to use mingw on account of also using Qt 4.8). I get identical operation under mingw4.4, as installed by Qt. Thanks