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 523 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 10 Nov 2023, 09:49 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 !

    S G 2 Replies Last reply 10 Nov 2023, 21:19
    0
    • D Diana97
      10 Nov 2023, 09:49

      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 !

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Nov 2023, 21:19 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 13 Nov 2023, 09:18
      1
      • D Diana97
        10 Nov 2023, 09:49

        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 !

        G Offline
        G Offline
        GrecKo
        Qt Champions 2018
        wrote on 11 Nov 2023, 09:33 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 13 Nov 2023, 09:32
        1
        • S SGaist
          10 Nov 2023, 21:19

          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 13 Nov 2023, 09:18 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
          • G GrecKo
            11 Nov 2023, 09:33

            @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 13 Nov 2023, 09:32 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

            1/5

            10 Nov 2023, 09:49

            • Login

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