diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2023-03-18 00:50:51 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2023-03-18 00:50:51 +0530 |
commit | 275edecf5f32dfdeaae4e7a056f192319475368e (patch) | |
tree | 4c5e9d499723d786a38e984925ae96eb9a3b7f33 |
Adding Camtest.py
-rw-r--r-- | CamTest.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/CamTest.py b/CamTest.py new file mode 100644 index 0000000..e8f3414 --- /dev/null +++ b/CamTest.py @@ -0,0 +1,18 @@ +import numpy as np +import cv2 +cap = cv2.VideoCapture(0) +cap.set(3,640) # set Width +cap.set(4,480) # set Height +while(True): + ret, frame = cap.read() + #frame = cv2.flip(frame, -1) # Flip camera vertically + gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) + + cv2.imshow('frame', frame) + cv2.imshow('gray', gray) + + k = cv2.waitKey(30) & 0xff + if k == 27: # press 'ESC' to quit + break +cap.release() +cv2.destroyAllWindows() |