GithubHelp home page GithubHelp logo

ebbozkurt / extract_scene Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 16.77 MB

This repository contains scripts for extracting scenes from a video based on different methods. The goal is to identify scene changes and split the video into separate segments representing each scene.

License: Apache License 2.0

Python 100.00%

extract_scene's Introduction

Video Scene Extraction

This repository contains scripts for extracting scenes from a video based on different methods. The goal is to identify scene changes and split the video into separate segments representing each scene.

Methods

  1. Threshold-based scene extraction: This method compares consecutive frames using the absdiff function from the OpenCV library. A threshold is set to determine when a scene change occurs. However, this method may not be very effective in all cases and might not provide accurate scene detection.

  2. Histogram difference-based scene extraction: This method calculates the histogram difference between consecutive frames using the OpenCV calcHist function. By comparing the histogram differences, scene changes can be detected. This method shows better results compared to the first approach, but it still may not be perfect in all scenarios.

  3. Average hash-based scene extraction: This method utilizes the average hash algorithm to calculate the perceptual hash of each frame. The Hamming distance between consecutive frame hashes is computed to identify scene changes. This approach has proven to be the most effective and reliable in our experiments, providing accurate scene detection.

Usage

To extract scenes from a video using the preferred method, follow these steps:

  1. Clone the repository:

    git clone https://github.com/EBBozkurt/extract_scene.git

  2. Install the necessary dependencies:

    pip install -r requirements.txt

  3. Replace video_path with the path to your video file, and threshold_value with the desired threshold value for scene change detection.

  4. The extracted scenes will be saved as individual video files in the same directory as the input video.

Conclusion

Based on our experiments, the average hash-based scene extraction method has shown the most accurate and reliable results. It takes advantage of perceptual hashing to identify scene changes effectively. However, it is important to note that scene extraction can still be a challenging task, and the choice of method may vary depending on the characteristics of the video.

If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request.

extract_scene's People

Contributors

ebbozkurt avatar yusufs-d avatar

Stargazers

 avatar  avatar

Watchers

 avatar

extract_scene's Issues

Video deleting on excel and video folder

When we press delete in labeling, it does not delete in excel and video folder.
Unlabeled and frameless leaves a label with only the name and does not delete the line in excel.

Excel Services fixes

xlsxwriter==3.1.1
openpyxl==3.0.10

There are two excel services in project, can we go with only one module?

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.