Qt with openCV

  • I am a begginer with both Qt and OpenCV.

    I would like to configure Qt with openCV. But I cannot make it work. I found some tutorials like this: http://www.barbato.us/2010/09/20/using-opencv-within-qtcreator-in-windows/

    I have a simple UI and everything works fine (even with OpenCV imports) until I want to use OpenCV:
    @Mat image = imread("d:/work/Project/resources/test.jpg", CV_LOAD_IMAGE_COLOR);@

    In that case the application exists with: "exited with code -1073741819" (access violation error) without reaching that line in the debugger... This is the case using Qt 5.1.1 with bundled MinGW and Qt Creator 2.8.1.

    I found some forum records that suggests to switch back to Qt 4. So I would like to switch to Qt 4.8, but it isn't bundled with MinGW (qt-win-opensource-4.8.4-mingw.exe installer always asking for existing MinGW installation). There are builds for Qt ( http://download.qt-project.org/development_releases/prebuilt/mingw_32/ ) but I don't know which one to choose.

    Does anybody know a working version combination of QtCreator - Qt - Mingw - openCV for Windows 7 ?

    Thanks for any information.

    I've just tried to install Qt 4.8 using this version of MinGW ( http://download.qt-project.org/development_releases/prebuilt/mingw_32/x32-4.8.0-release-posix-dwarf-rev2.7z ), but it has the following problems:

    • if I choose directory 'd:\app\mingw32' then it's missing w32api.h
    • if I choose directory 'd:\app\mingw32\i686-w64-mingw32' then it says "There is a problem with MinGW installation: g++ not found in d:\app\mingw32\i686-w64-mingw32\bin\

    UPDATE2: I tried to go on with the above warning, but get this message (as expected):
    @12:06:01: Starting: "mingw32-make.exe"
    qtcreator_ctrlc_stub: Command line failed: mingw32-make.exe
    12:06:01: The process "mingw32-make.exe" crashed.
    Error while building/deploying project Project (kit: Qt 4.8.5 with MinGW-4.8 )
    When executing step 'Make'@



    This tutorial works well: http://stackoverflow.com/questions/15881913/how-to-link-opencv-in-qtcreator-and-use-qt-library

    Building OpenCV with MinGW is a must!
    ...and then everything is working fine

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.