My current program is in Python and uses OpenCV. I rely on webcam captures and I am processing every captured frame:
import cv2
# use the webcam
cap = cv2.VideoCapture(0)
while True:
# read a frame from the webcam
ret, img = cap.read()
# transform image
I would like to make a Kivy interface (or another graphical user interface) with buttons, keeping already existing functionality with webcam captures.
I found this example: https://kivy.org/docs/examples/gen__camera__main__py.html — but it doesn’t explain how to acquire the webcam image to process it with OpenCV.
I found an older example: http://thezestyblogfarmer.blogspot.it/2013/10/kivy-python-script-for-capturing.html — it saves screenshots to disk using the ‘screenshot’ function. Then I can read the saved files and process them, but this seems to be an unnecessary step.
What else can I try?