How to get QML camera feed and send to C ++ server

I am trying different implementations of how to achieve further processing from a QML camera, I need to feed the feed to the C ++ end so that it can then be converted to a cv :: Mat image and passed to functions for processing, I tried to install the QCamera from the C end ++ and start it on a button click, but it seems Qt cannot create two instances of the same camera. I have also tried the open CV method, to no avail. What's the best way to do this?

+3


source to share


2 answers


This is not a fix, but a workaround. I used the OpenCv camera plugin and made it visible to my QML using qmlRegisterType. Then I could easily send the frames from the backend to another class for processing. For those looking to do this, I used this plugin: https://github.com/rferrazz/CvCamView



+3


source


Qt QML Camera for C ++ QImage on Android

I just answered this question, I think you had the same problem.



The basic idea is to get a QML camera instance, access the QMediaObject point and examine it using QVideoProbe. There are other solutions as well, but AFAIK they really work easily or quickly on Android platforms, but if that is not your case, you should try QAbstractVideoFilter along with the QVideoFilterRunnable classes that were designed specifically for handling qml videos.

Note that QAbstractVideoFilter and QVideoFilterRunnable are only Qt 5.5 classes.

+2


source







All Articles