Giter Site home page Giter Site logo

samahussien7 / video-subtitles-detector Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 976 KB

The Video Subtitles Detector is designed to detect and highlight subtitles within a video. It identifies the area containing the subtitles by drawing bounding boxes around them and further detects the location of each word within the subtitles. The program processes the video using basic filters and morphological operations.

Jupyter Notebook 100.00%
image-processing image-processing-python morphological-operators morphology noise-generator segmentation subtitles-detecor

video-subtitles-detector's Introduction

Video Subtitles Detector

Overview

The Video Subtitles Detector is a program designed to detect and highlight subtitles within a video. It identifies the area containing the subtitles by drawing bounding boxes around them and further detects the location of each word within the subtitles. The program processes the video using basic filters and morphological operations, without relying on deep learning, machine learning, or OCR techniques.

Features

  • Detect and highlight subtitles in a video using image processing techniques.
  • Draw red bounding boxes around each line of subtitles.
  • Draw green bounding boxes around each word within the subtitles.
  • Process and apply bounding boxes to all subtitles in the video.

Requirements

  • Python 3.x
  • OpenCV
  • numpy

Usage

  1. Place the video file you want to process in the input directory.

  2. Run the subtitles detector script:

    python detect_subtitles.py --input input/your_video.mp4 --output output/processed_video.mp4
  3. The processed video with bounding boxes will be saved in the output directory.

Arguments

Example

To run the program on an example video:

python detect_subtitles.py --input input/example_video.mp4 --output output/processed_example_video.mp4

Expected Output

  • Red Bounding Box: Represents the bounding box of the subtitles (a separate bounding box for each line if the subtitles span across multiple lines).
  • Green Bounding Box: Represents the bounding box of each word within the subtitles.

Methodology

This program uses basic image processing techniques such as:

  • Grayscale conversion
  • Thresholding
  • Morphological operations (e.g., dilation and erosion)
  • Contour detection

These techniques help in identifying the regions containing subtitles and distinguishing individual words within the subtitles.

Contributing

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a pull request.

Thank you for using the Video Subtitles Detector! I hope it helps you with your project.

video-subtitles-detector's People

Contributors

samahussien7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.