1. 목표
ESP32-CAM 에서 출력되는 steam 이미지를 OpenCV 를 이용햇 Python 윈도우에 표시
2. ESP32-CAM 코드
예제 - ESP32 - Camera -CameraWebServer 코드
3. Python 코드
import cv2
video = cv2.VideoCapture('http://192.168.200.146:81/stream')
frame_size = (int(video.get(cv2.CAP_PROP_FRAME_WIDTH)), int(video.get(cv2.CAP_PROP_FRAME_HEIGHT)))
while True:
ret, frame = video.read()
if not ret:
break
cv2.imshow('ESP32-CAM', frame)
# Press 'Esc' to stop
key = cv2.waitKey(25)
if key == 27:
break
if video.isOpened():
video.release()
cv2.destroyAllWindows()
4. 실행 및 확인
1) ESP32-CAM 실행
2) Python 코드 실행
3) 'ESP32-CAM' Python 윈도우에 steam 이미지 표시됨
'Study > Arduino' 카테고리의 다른 글
[Arduino] OLED Display (0) | 2022.07.10 |
---|---|
[Arduino] Arduino-Arduino UART Communication (0) | 2022.07.10 |
[Arduino] ESP32-CAM Setup (0) | 2022.07.10 |