Hello mrdebug,
thank you very much for your suggestion. I've done a second Qthread for calculation. so the cycle is the following.
Read cam_image with one thread every QTimer event (200ms). I've inserted a QThread::msleep(100) in the first thread, for letting the second thread to work, as you suggested.
Pass the the Mat data to the second thread for calculating ORB algorithm
Pass back the Mat, where the algorithm has been applied, to the first thread.
Convert Mat file to image and pass the QIMage to GUI thread.
The frame rate got an increasement up to 9 FPS (which is much more than before!).
For passing Mat object among threads, I had to register Mat type as follow:
....
Q_DECLARE_METATYPE(Mat)
int main(int argc, char *argv[])
{
qmlRegisterType<VideoCamera>("VideocameraLib", 1, 0, "Videocamera");
qRegisterMetaType<Mat>("Mat");
....
Concerning the CPU usage, the situation didn't change a lot, although the second thread and msleep.
0_1517061582408_934efba6-3c9c-4ca7-95d9-a883ccfdb9f8-immagine.png
If anyone could take a look at my other problem, I would really appreciate it:
https://forum.qt.io/topic/87039/pass-oncurrentindexchanged-event-to-an-object-in-page1/2
Thank you again.
Davidino