From 748d3b6dc17303b258195bb48a5e04996c32c1c2 Mon Sep 17 00:00:00 2001 From: Anisha Mamgain Date: Thu, 1 Oct 2020 19:05:46 +0530 Subject: [PATCH 1/2] Click images --- click_image.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 click_image.py diff --git a/click_image.py b/click_image.py new file mode 100644 index 0000000..2ee9be3 --- /dev/null +++ b/click_image.py @@ -0,0 +1,26 @@ +#https://www.facebook.com/anisha.mamgain.37/posts/1061681344253497 +#Subscribed by Code House +import cv2 + +cap = cv2.VideoCapture(0) + +img = 0 + +while True: + ret, frame = cap.read() + cv2.imshow("Image", frame) + k = cv2.waitKey(1) + if k == 27: + # ESC pressed + print("Closing the window...") + break + elif k == 32: + # Press SPACE to click picture + img_name = "opencv_frame.jpg".format(img) + cv2.imwrite(img_name, frame) + print(format(img_name)) + img += 1 + +cap.release() + +cv2.destroyAllWindows() From 8283dc4d6ed07359538cb0652746a137658c358c Mon Sep 17 00:00:00 2001 From: Anisha Mamgain Date: Fri, 2 Oct 2020 18:37:50 +0530 Subject: [PATCH 2/2] Update click_image.py --- click_image.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/click_image.py b/click_image.py index 2ee9be3..92caeb0 100644 --- a/click_image.py +++ b/click_image.py @@ -1,5 +1,4 @@ -#https://www.facebook.com/anisha.mamgain.37/posts/1061681344253497 -#Subscribed by Code House + import cv2 cap = cv2.VideoCapture(0)