Missing image about my kinect-opencv Qt program
-
wrote on 2 Nov 2016, 16:12 last edited by A Former User 11 Feb 2016, 19:01
i've worked with at program using Opencv to show the image from Kinect v2 and Qt to build a ui.
Then it comes out that cv::imshow() is working but Qimage process isn't.
Can someone discuss the issue with me?
Maybe it's not the correct way to use QTimer like this or just dont put while(1) in the slot function?my code on github:
https://github.com/GermanGerm/kinect_screen_showing_with_opencvcode reference from this link:
https://www.youtube.com/watch?v=akAAAvGyLn0 -
Hi and welcome to devnet,
Putting an infinite loop like that in a slot will block the event loop thus freeze your application UI. You either need to do the grabbing from another thread or use a QTimer (watch out for the speed of the function).
Note that OpenCV can also use Qt as UI backend.
-
wrote on 2 Nov 2016, 23:25 last edited by
try calling
QCoreApplication::processEvents();
inside your loop. if it solves your problem the the infinite loop is causing it
1/3