Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ivangael/object_detection_with_background_substractor

Object Detection and Tracking with OpenCV background subtractors
https://github.com/ivangael/object_detection_with_background_substractor

background-substraction-algorithm background-subtraction lucas-kanade numpy object-detection object-tracking opencv optical-flow python scipy

Last synced: about 1 month ago
JSON representation

Object Detection and Tracking with OpenCV background subtractors

Awesome Lists containing this project

README

        

# Object Detection and Tracking with OpenCV

This project implements an object detection and tracking system using OpenCV in Python. It combines background subtraction, centroid-based tracking, and optical flow to detect and track moving objects in a video stream.

![Demo](demo.png)

## Features

- Background subtraction using MOG2(Mixture of Gaussians) or KNN(K-Nearest Neighbors) methods
- Centroid-based object tracking with unique ID assignment
- Optical flow tracking for visualizing object movement
- Foreground mask overlay for visual feedback

## Requirements

````
pip install -r requirements.txt
````

## How it works

1. Background subtraction isolates moving objects from the static background.
2. Contour detection identifies potential objects.
3. Centroid tracking assigns and maintains unique IDs for detected objects.
4. Optical flow tracking visualizes the movement of feature points.