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
QtWS25 Last Chance

Threads in PyQt and opencv

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 527 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 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
    ?

    Pablo J. RoginaP 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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

        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
        ?

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on 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

        • Login

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