Created
April 29, 2017 11:59
-
-
Save Jim-Holmstroem/66c819f6589b5859aec026fd027ec376 to your computer and use it in GitHub Desktop.
live transform opencv frame by frame
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function | |
import cv2 | |
id_ = lambda x: x | |
def live_transform(transformation=id_): | |
cap = cv2.VideoCapture(0) | |
while True: | |
ret, img = cap.read() | |
cv2.imshow("input", img) | |
key = cv2.waitKey(10) | |
if key == 27: | |
break | |
cv2.destroyAllWindows() | |
cv2.VideoCapture(0).release() | |
if __name__ == "__main__": | |
live_transform() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment