Computer VisionCompleted

Automated Detection and Removal of Corrupted Video Frames Using OpenCV and DBSCAN

Automated detection and removal of corrupted video frames using OpenCV, feature extraction (color histograms, SIFT, ORB), and DBSCAN clustering, followed by frame reordering and video reconstruction.

2025
1 week
1 person
Individual Project
Automated Detection and Removal of Corrupted Video Frames Using OpenCV and DBSCAN

Context & Background

This project aimed to automatically detect, isolate, and remove corrupted or parasitic frames from a damaged video file. The approach combined computer vision feature extraction with unsupervised clustering to identify abnormal frames. Once detected, the corrupted frames were removed and the cleaned video was reconstructed in the correct frame order.

Challenge

Corrupted videos can contain visually distorted frames that break continuity and degrade quality. Manual inspection is inefficient, especially for long videos, and traditional methods fail to distinguish between natural content variation and actual corruption. The challenge was to design an automated solution capable of detecting and removing these anomalies while preserving valid frames and the correct playback sequence.

Solution

Frames were extracted from the video using OpenCV and analyzed with multiple feature extraction techniques. For each frame, color histograms for the blue, green, and red channels were computed, and additional descriptors were obtained with SIFT and ORB to capture texture and structural details. These feature vectors were combined and clustered with DBSCAN to separate normal frames from anomalies. Detected corrupted frames were removed, and the remaining frames were reordered using similarity matching before reconstructing the cleaned video.

Results & Impact

DBSCAN successfully separated anomalies from normal frames without manual labeling
Reconstructed a cleaned and properly ordered version of the original video

Appendix

Original Corrupted Video

The input video file containing corrupted and parasitic frames that need to be detected and removed. This video demonstrates the quality issues and frame discontinuities that the algorithm is designed to address. The cleaned and reordered output video can be found in the GitHub repository.

Technologies Used

PythonOpenCVDBSCANSIFTORBMatplotlibNumpyJupyter

Project Details

Company

Personal Project

Duration

1 week

Team Size

1 person

My Role

Individual Project

Interested in Similar Work?

Let's discuss how I can help your team with data science and ML projects.

Get In Touch