Skip to content

Instantly share code, notes, and snippets.

View peymanmajidi's full-sized avatar
:octocat:
Github Pro User

Peyman Majidi Moein peymanmajidi

:octocat:
Github Pro User
View GitHub Profile
@peymanmajidi
peymanmajidi / basic_motion_detection_opencv_python.py
Created February 14, 2021 13:28 — forked from pknowledge/basic_motion_detection_opencv_python.py
Motion Detection and Tracking Using Opencv Contours
import cv2
import numpy as np
cap = cv2.VideoCapture('vtest.avi')
frame_width = int( cap.get(cv2.CAP_PROP_FRAME_WIDTH))
frame_height =int( cap.get( cv2.CAP_PROP_FRAME_HEIGHT))
fourcc = cv2.VideoWriter_fourcc('X','V','I','D')