This is the basic webcam code!
Reference it :)
import cv2
cap = cv2.VideoCapture(0)
if not cap.isOpened():
raise IOError("Cannot open webcam! Check please :) ")
while True:
ret, frame = cap.read()
frame = cv2.resize(frame, None, fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA)
cv2.imshow('Input', frame)
c = cv2.waitKey(1)
if c == 27:
break
cap.release()
cv2.destroyAllWindows()
'Python' 카테고리의 다른 글
torch._six error 해결 (0) | 2024.06.18 |
---|---|
Pymongo에서 프로세스 종료하는 명령어 (0) | 2024.06.04 |
[Resolved] ModuleNotFoundError: No module named 'ipywidgets' (0) | 2024.03.06 |
17142 - 백준 python 백트래킹 및 bfs 문제 해결법 - 반례 있어서 주의 해야함. (0) | 2024.02.14 |
14502. 연구소 시간 단축 코드 - 백트래킹 말고, python 문제 풀이 (1) | 2024.02.14 |