Created
October 8, 2019 18:19
-
-
Save vallantin/eb6244064fd92959f5e215794b1728f5 to your computer and use it in GitHub Desktop.
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
# turn camera on | |
video_capture = cv2.VideoCapture(0) | |
while True: | |
# get last recorded frame | |
_, color = video_capture.read() | |
# transform color -> grayscale | |
bw = cv2.cvtColor(color, cv2.COLOR_BGR2GRAY) | |
# detect the face and blur it | |
blur = find_and_blur(bw, color) | |
# display output | |
cv2.imshow('Video', blur) | |
# break if q is pressed | |
if cv2.waitKey(1) & 0xFF == ord('q'): | |
break | |
# turn camera off | |
video_capture.release() | |
# close camera window | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment