Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Missing image about my kinect-opencv Qt program

    General and Desktop
    3
    3
    634
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      GermanGerm last edited by A Former User

      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

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • VRonin
          VRonin last edited by

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

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply Reply Quote 0
          • First post
            Last post