Python
예제] openCV Motion Analysis - 객체 추적
import cv2 from cv2 import threshold cap = cv2.VideoCapture("car_way.mp4") # 백그라운드와 객체와 분리 object_detector = cv2.createBackgroundSubtractorMOG2(history=200, varThreshold=80) #백그라운드와 분리가 잘 안됨. 정확한 옵션을 알아야 할듯. #od_knn = cv2.createBackgroundSubtractorKNN(dist2Threshold=100) while True: # 프레임 별 읽기 ret, frame = cap.read() h, w, _ = frame.shape # extract region of interest #frame[x: x1, y: y1] x좌표에서 x..
2022. 1. 28. 21:17