Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Using OpenCV with QT5



  • is OpenCV compatible with QT5?
    and is it the best for capturing and playing back uncompressed AVI from a capture device?

    Regards,Tim.


  • Moderators

    AFAIK, answer to both questions are "yes" :)

    Don't ask me for details, though.



  • Ok cheers, i have been looking around and there seems to be issues that exist with openCV and QT 5 which do not exist in QT 4 and id like to know if there is any simpler library's to implement for the sole purpose of video acquisition and playback?



  • can you give us the issues, which doesn't exists in Qt4?

    I used OpenCV with Qt4 and the only thing, I needed, was converting between the OpenCV struct and QImage. That wasn't quite difficult.

    You have to try it out.


  • Lifetime Qt Champion

    Hi,

    What can happen (depending on your system) is that you get an OpenCV pre-built with Qt 4, in that case you'll be in trouble.

    But you can always build OpenCV yourself



  • Hi, I have written two functions to do the conversion cv::Mat <==> QImage.

    Maybe is useful for you
    https://github.com/dbzhang800/QtOpenCV/blob/master/cvmatandqimage.h

    [quote author="Serenity" date="1375873569"]can you give us the issues, which doesn't exists in Qt4?

    I used OpenCV with Qt4 and the only thing, I needed, was converting between the OpenCV struct and QImage. That wasn't quite difficult.

    You have to try it out. [/quote]



  • [quote author="1+1=2" date="1375926119"]Hi, I have written two functions to do the conversion cv::Mat <==> QImage.

    Maybe is useful for you
    https://github.com/dbzhang800/QtOpenCV/blob/master/cvmatandqimage.h
    [/quote]

    There is an easier way with setting the pointer of the CVImage to an QImage. So, If you make any painting changes on this picture with OpenCV, you don't need to add them already to QImage.

    That, he also have to do with his code. Copying every pixel from one image to another costs too much time.

    EDIT: ah, I see, you have done that in the last lines of your code :)


Log in to reply