Skip to content

Latest commit

 

History

History
93 lines (63 loc) · 3.49 KB

README.md

File metadata and controls

93 lines (63 loc) · 3.49 KB

video2images

Python License: MIT ci-tests ci-linting

Converts a video into images filtered for Photogrammetry.

Its main goal is to reduce the on-site time needed for data capture and also the time for photogrammetry software, such as Meshroom, to compute by only using a small selection of frames from a video data capture. This tool filters out frames that are too blurry to be used and consecutive frames that have too many features in common.

Table of Contents

Getting Started

Installation Prerequisites

To install Poetry, follow these steps:

python -m pip install --upgrade pip
python -m pip install --user pipx
python -m pipx ensurepath
pipx install poetry

To install the project dependencies, execute the following command:

poetry install

To activate the virtual environment, run:

poetry shell

Usage

For command line arguments, use:

python video2images.py --help

To convert a video into images, run:

python video2images.py PATH_TO_VIDEO

This command will create a folder named extracted_frames at the same location as PATH_TO_VIDEO.

How It Works

The process is based on a simple, pipeline-oriented approach. No multiprocessing, threads, or clusters are used.

The pipeline operates as follows:

  1. Create an output directory or clear if already existent
  2. Open the video file and retrieve needed properties
  3. Processes each frame with the following quality checks:
    1. Blurriness Check:

      Filters out frames that are too blurry based on the blur_min_threshold.

    2. Feature Check:

      Filters out frames that do have too many features in common with its previous frame based on feature_max_threshold.

  4. Save Valid Frames
  5. Cleanup & Print Stats

Acknowledgments

Special thanks to the following resources for their contributions:

If you have other possible approaches or suggestions, please contact me at [email protected].