I am using Python 2.7 and OpenCV 2.4.9.
I need to capture the current frame that is displayed to the user and load it as a cv :: Mat object in Python.
Do you guys know a quick way to do this recursively?
I need something like what was done in the example below that recursively captures Mat frames from a webcam:
import cv2 cap = cv2.VideoCapture(0) while(cap.isOpened()): ret, frame = cap.read() cv2.imshow('WindowName', frame) if cv2.waitKey(25) & 0xFF == ord('q'): cap.release() cv2.destroyAllWindows() break
In this example, he used the VideoCapture class to work with a captured image from a webcam.
With VideoCapture.read (), a new frame is always read and saved in the Mother object.
Can I load a βprint screen streamβ into a VideoCapture object? Can I create a streaming display of my computer from OpenCV to Python without saving and deleting a lot of .bmp files per second?
I need these frames as Mat objects or NumPy arrays , so I can execute some Computer Vision routines with these frames in real time.
source share