From 2f141c3fb923630fb90b80d6567990a5a1c85895 Mon Sep 17 00:00:00 2001 From: ShkSalmanAhmad Date: Thu, 24 Oct 2019 09:22:51 +0500 Subject: [PATCH] Create videoFilter.py This python code will be capturing live video throught the front camera and will be converting that image to grayscale. The code can be further updated to save the video as well. --- liveVideoFilter/videoFilter.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 liveVideoFilter/videoFilter.py diff --git a/liveVideoFilter/videoFilter.py b/liveVideoFilter/videoFilter.py new file mode 100644 index 0000000..a721a6c --- /dev/null +++ b/liveVideoFilter/videoFilter.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +""" +Created on Sun Oct 24 08:10:24 2019 + +@author: Salman Ahmad +"This program will capture live video and apply filters to that video""" + +import cv2 +video=cv2.VideoCapture(0) +while True: + check, frame=video.read() + gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) + cv2.imshow("Video Capturing and Filtering!",gray) + key=cv2.waitKey(1) + if key==ord('q'): + break + +video.release() +cv2.destroyAllWindows \ No newline at end of file