stm32-fmt-code/access_control_python/camera_test.py

10 lines
173 B
Python

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)