Missing image about my kinect-opencv Qt program



  • 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_opencv

    code reference from this link:
    https://www.youtube.com/watch?v=akAAAvGyLn0


  • Lifetime Qt Champion

    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.



  • try calling QCoreApplication::processEvents(); inside your loop. if it solves your problem the the infinite loop is causing it


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.