A lightweight Python tool for detecting objects (e.g., cancer cells) in video footage using OpenCV’s Haar Cascade classifiers. The project processes videos at their original playback speed, outputs annotated videos, CSV logs, and interactive parameter tuning for optimal performance.
-
Haar Cascade Detection: Fast, pretrained classifiers—no need for custom training data.
-
Correct Playback Speed: Reads original FPS to avoid accelerated output.
-
Annotated Video Output: Saves annotated.mp4 with detection boxes, FPS, counts, and alerts.
-
CSV Logging: Optional detections.csv with frame-wise bounding box coordinates.
-
Interactive Controls: Trackbars to adjust scaleFactor, minNeighbors, and alert thresholds on the fly.
-
Centroid Tracking: Assigns IDs to objects and tracks them across frames.
-
Performance Metrics: Displays real-time FPS and object counts.
pip install opencv-python pandas matplotlib openpyxl
Run detection on a video or webcam stream: python detect.py
--source "High-Powered-Microscopes-Capture-Cancer-Cells-in-Action.MP4"
--cascade cars.xml
--output annotated.mp4
--csv