Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Threads in PyQt and opencv

Threads in PyQt and opencv

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 531 Views
  • 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.
  • I Offline
    I Offline
    iamMHZ
    wrote on 2 Sept 2019, 11:51 last edited by
    #1

    i have a code in python ,
    and it has 5 buttons ,
    and when each button clicks i want to access the webcam ,
    and get frames from it and do some things on the webcam frames(each button performs diffrient things on the webcam frame)

    the problem is that when first button gets the webcam on a separate THREAD
    when i click other buttons , they can't access the Webcam ,
    how can i notify the that thread to releases the Webcam for others
    ?

    P 1 Reply Last reply 2 Sept 2019, 16:52
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 2 Sept 2019, 15:51 last edited by
      #2

      Hi
      you could send a signal to the tread via the normal signal & slots?
      Or is the thread not a Qt thread but a openCV one?

      1 Reply Last reply
      0
      • I iamMHZ
        2 Sept 2019, 11:51

        i have a code in python ,
        and it has 5 buttons ,
        and when each button clicks i want to access the webcam ,
        and get frames from it and do some things on the webcam frames(each button performs diffrient things on the webcam frame)

        the problem is that when first button gets the webcam on a separate THREAD
        when i click other buttons , they can't access the Webcam ,
        how can i notify the that thread to releases the Webcam for others
        ?

        P Offline
        P Offline
        Pablo J. Rogina
        wrote on 2 Sept 2019, 16:52 last edited by
        #3

        @iammhz said in Threads in PyQt and opencv:

        when i click other buttons , they can't access the Webcam

        What if you just have only one method/thread to access the webcam, independent on which button is actually pressed, and when the image is captured then pass that image to the specific processing method/thread depending on the button/effect pressed.

        This way you'll avoid the bottleneck of "sharing" the webcam among threads

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        2

        3/3

        2 Sept 2019, 16:52

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved