nenuscanner/scanner.py

11 lines
185 B
Python

import cv2
def capture(output_path: str) -> bool:
cam = cv2.VideoCapture(0)
s, img = cam.read()
if s:
cv2.imwrite(output_path, img)
cam.release()
return s