From 9e990d1b81649c30f8fc50e3e09f83e3a5af5dd0 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sat, 23 Sep 2023 00:42:16 +0700 Subject: [PATCH] camera_test --- access_control_python/camera_test.py | 10 ++++++++++ access_control_python/requirements.txt | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 access_control_python/camera_test.py diff --git a/access_control_python/camera_test.py b/access_control_python/camera_test.py new file mode 100644 index 0000000..927c2b1 --- /dev/null +++ b/access_control_python/camera_test.py @@ -0,0 +1,10 @@ +import numpy as np +import cv2 +import os + +cam = cv2.VideoCapture(0) + +ret, frame = cam.read() +img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) + +cv2.imwrite("cam_test_img.jpg",img) \ No newline at end of file diff --git a/access_control_python/requirements.txt b/access_control_python/requirements.txt index d35b7af..f795ca7 100644 --- a/access_control_python/requirements.txt +++ b/access_control_python/requirements.txt @@ -1,2 +1,3 @@ pyserial -line_notify \ No newline at end of file +line_notify +opencv-python \ No newline at end of file