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