/Shot-Transition-Detection

Temporal segmentation of video by detecting scene transitions in input videos, using Python

Primary LanguagePython

Histogram-based Video Shot Transition Detection

This code detects abrupt (cut) shot transitions in a given input video by, hierarchical temporal partitioning of video frames, using block-color histogram of the consequitive frames, and thresholding. This code is written based on the cut transition detection method that is introduced in these papers: paper1, paper2.

CT detection

 Hierarchical partitioning of video frames

Environment

  • Ubuntu 18.04
  • CUDA 10.0
  • CuDNN 10.0
  • Python 3.8
  • Anaconda 3: Use "requirement.txt" to create a conda environment with all required packages
conda create --name <env> --file requirements.txt

Using the code

  • Step 1: Put the input video files (<video_name>.mp4) in "videos" folder.

  • Step 2: Run shot_transition_detection.py

  • Outputs: A folder will be created, i.e. "./videos/<video_name>" , that will include:

  • All video shots, ".mp4".
  • A “.csv” file with information about all of the generated video shots.

Cite us please

Please cite the following papers if you are using this code

@inproceedings{yazdi2016shot,
  title={Shot boundary detection with effective prediction of transitions' positions and spans by use of classifiers and adaptive thresholds},
  author={Yazdi, Mehran and Fani, Mehrnaz},
  booktitle={2016 24th Iranian Conference on Electrical Engineering (ICEE)},
  pages={167--172},
  year={2016},
  organization={IEEE}
}


@article{fani2021localization,
  title={Localization of Ice-Rink for Broadcast Hockey Videos},
  author={Fani, Mehrnaz and Walters, Pascale Berunelle and Clausi, David A and Zelek, John and Wong, Alexander},
  journal={arXiv preprint arXiv:2104.10847},
  year={2021}
}