Skip to content

Instantly share code, notes, and snippets.

@harshad-tal
harshad-tal / bg_subtractor.py
Created March 10, 2017 09:23
Background Subtraction from video using OpenCV and Python
import numpy as np
import cv2
file_path = "vid.mp4"
cap = cv2.VideoCapture(file_path)
first_iter = True
result = None
while True:
ret, frame = cap.read()