1. DroidCam 설정
2. Python Code
import cv2
video = cv2.VideoCapture('http://192.168.200.113:4747/mjpegfeed')
frame_size = (int(video.get(cv2.CAP_PROP_FRAME_WIDTH)), int(video.get(video.CAP_PROP_FRAME_HEIGHT)))
while True:
ret, frame = video.read()
if not ret:
break
cv2.imshow('frame', frame)
# Press 'Esc' to stop
key = cv2.waitKey(25)
if key == 27:
break
if video.isOpened():
video.release()
cv2.destroyAllWindows()
3. 실행
핸드폰에서 DriodCam 실행 후 Python code 실행
'Study > Python - OpenCV' 카테고리의 다른 글
[Python - OpenCV] opencv-python Package Install (0) | 2022.07.10 |
---|