signal from c++ (cv::Mat* ) and display video in qml gui
-
wrote on 10 Nov 2023, 09:49 last edited by
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 ! -
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 !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 ? -
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 !@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.
-
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 ?wrote on 13 Nov 2023, 09:18 last edited by Diana97@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
-
@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.
wrote on 13 Nov 2023, 09:32 last edited by Diana97@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/5