Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [SOLVED] Qt5.2 and OpenCV 2.4.9
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt5.2 and OpenCV 2.4.9

Scheduled Pinned Locked Moved 3rd Party Software
9 Posts 3 Posters 9.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pmh4514
    wrote on last edited by
    #1

    I am currently evaluating the commercial version of Qt5.2 enterprise on a PC running 64bit Win8.1

    I downloaded OpenCV 2.4.9 and used CMake and mingw to compile it. There are a whole host of tutorials on the web about making Qt and OpenCV work together, but I have not had success with any of them, I feel like I'm running around in circles

    Do I need to download and compile my own copy of Qt in order to make this work? Will that impact my current 5.2 enterprise/commercial (trial) installation?

    Any helpful pointers or tutorials would be greatly appreciated.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What have you tried ? How did it fail ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pmh4514
        wrote on last edited by
        #3

        Hi, thanks for the reply. I'll have to go back through and "retry" tutorials, keeping specific notes of exactly what I did and what went wrong, in order to adequately answer you.

        In a nutshell, I downloaded latest OpenCV, extracted it, used CMake to generate a makefile, and then mingw to compile it. In the end I had no .LIB files. I tried again, this time specifying WITH_QT and then got a whole host of errors about missing Qt paths, which makes me suspect perhaps I have to download and compile it myself, but I'm unsure. Then I tried again, only instead of mingw, using Visual Studio 2010 which was already installed. Another long slew of errors.

        Since each of the tutorials seemed a few years old, and my now being at Qt5.2 I thought maybe somebody has an updated "how to " for letting me use OpenCV functions within Qt

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Essentially you need to ensure that you use the same compiler for both. IIRC OpenCV's binary package provides pre-built libraries for several compilers. You should look at that first before starting to compile.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pmh4514
            wrote on last edited by
            #5

            ok so in theory, if I downloaded the sources for both OpenCV and Qt, and compiled them both with the same compiler, things should work.. I'll try that on another machine to see, as I have the commercial evaluation license in place and I'm not sure if compiling the sources will mess that up.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Yes they should. IIRC OpenCV binary package comes with a set of library for almost all compiler flavors for Windows

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pmh4514
                wrote on last edited by
                #7

                I did finally get this to work.

                I downloaded the Qt 5.2.1 w/OpenGL / mingw version and installed it.
                Then I used the mingw version that came with that package, to compile OpenCV with QT.

                From there everything linked and ran properly. Thanks!

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You're welcome !

                  Since you have everything working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • mrdebugM Offline
                    mrdebugM Offline
                    mrdebug
                    wrote on last edited by
                    #9

                    Can you do one thing for me?
                    There is a open bug in OpenCV with mingw. The bug is described here:

                    http://code.opencv.org/issues/3593

                    Can you add this line of code and verify if the bug in still open or not?

                    @"cv::CascadeClassifier *a= new cv::CascadeClassifier();"
                    or
                    "cv::CascadeClassifier a;"@

                    Need programmers to hire?
                    www.labcsp.com
                    www.denisgottardello.it
                    GMT+1
                    Skype: mrdebug

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved