Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. signal from c++ (cv::Mat* ) and display video in qml gui
Forum Updated to NodeBB v4.3 + New Features

signal from c++ (cv::Mat* ) and display video in qml gui

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 491 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.
  • D Offline
    D Offline
    Diana97
    wrote on last edited by
    #1

    Hi everyone ! I am trying to rewrite some c++ code in order to work with qml . I have a signal coming from C++ signalDisplayVideo(cv::Mat* frame) and I was wondering if is enough to use just this signal to be able to see the video in a qml gui , or do I need more things ?
    Thank you !

    SGaistS GrecKoG 2 Replies Last reply
    0
    • D Diana97

      Hi everyone ! I am trying to rewrite some c++ code in order to work with qml . I have a signal coming from C++ signalDisplayVideo(cv::Mat* frame) and I was wondering if is enough to use just this signal to be able to see the video in a qml gui , or do I need more things ?
      Thank you !

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      QML has no idea how to manage OpenCV's Mat objects.

      You need to convert them.

      Which version of Qt are you using ?
      How are you showing them currently ?

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

      D 1 Reply Last reply
      1
      • D Diana97

        Hi everyone ! I am trying to rewrite some c++ code in order to work with qml . I have a signal coming from C++ signalDisplayVideo(cv::Mat* frame) and I was wondering if is enough to use just this signal to be able to see the video in a qml gui , or do I need more things ?
        Thank you !

        GrecKoG Offline
        GrecKoG Offline
        GrecKo
        Qt Champions 2018
        wrote on last edited by
        #3

        @Diana97 I think the way to do this now is with VideoOutput and providing QVideoFrame to its QVideoSink. Forum or Google searches should give you resources on how to convert CV Mat to QVideoFrame.

        D 1 Reply Last reply
        1
        • SGaistS SGaist

          Hi,

          QML has no idea how to manage OpenCV's Mat objects.

          You need to convert them.

          Which version of Qt are you using ?
          How are you showing them currently ?

          D Offline
          D Offline
          Diana97
          wrote on last edited by Diana97
          #4

          @SGaist I am using Qt5.14 .. at the moment I am trying to convert the C++ code that I already had it (but the GUI to display it was using xml files and now I want to create the GUI using qml) which sends me information about cv::Mat * videoFrame and I don't know how should I started to display the video into QML using signal from C++ (cv::Mat frame). I made it visible for QML using the qml registerType but not sure what to do further. Tia

          1 Reply Last reply
          0
          • GrecKoG GrecKo

            @Diana97 I think the way to do this now is with VideoOutput and providing QVideoFrame to its QVideoSink. Forum or Google searches should give you resources on how to convert CV Mat to QVideoFrame.

            D Offline
            D Offline
            Diana97
            wrote on last edited by Diana97
            #5

            @GrecKo Thank you! I tried to use this ( code https://stackoverflow.com/questions/62069201/display-cvmat-as-qvideoframe-in-a-qml-videooutput ) but I don't know how should I connect the cv::Mat frame used in this code with my cv::Mat* frame from my initial C++ code which is very complex and I don't want to change that too much. Tia

            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