webcam에서 가져온 영상을 mp4로 저장하는 OpenCV Python
import cv2 import time import os # 이미지에 텍스트를 출력하는 함수 def draw_text(img, text, x, y): font = cv2.FONT_HERSHEY_SIMPLEX font_scale = 1 font_thickness = 2 text_color=(255, 0, 0) text_color_bg=(0, 0, 0) text_size, _ = cv2.getTextSize(text, font, font_scale, font_thickness) text_w, text_h = text_size offset = 5 cv2.rectangle(img, (x - offset, y - offset), (x + text_w + offset, y + text_h + offset), te..
2022. 4. 1.