0

For our requirements, we need to capture image from usb UVC camera (webcam) when the snap button is clicked on hardware. But we dont know how to get that event.

cap = cv2.VideoCapture(0)

cap.set(cv2.CAP_PROP_BRIGHTNESS, 50)
cap.set(cv2.CAP_PROP_CONTRAST,60)

while cap.isOpened():
    ret, frame = cap.read()
    cv2.imshow("webcam",frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

we are able to get frames in loop and set the uvc settings using opencv methods.

But as I mentioned above, we need to catch that snap button on the device is clicked so that save the frame that is captured in that moment. how can we do that, thanks in advance

smoothumut
  • 3,423
  • 1
  • 25
  • 35
  • it's not possible. use system APIs directly. for such a button, you might have to ask the manufacturer for their proprietary API. I doubt a "capture button" is standardized. – Christoph Rackwitz Mar 22 '23 at 12:07

0 Answers0