Skip to content

Converts a video into images filtered for photogrammetry, suitable for use in software like Meshroom.

License

Notifications You must be signed in to change notification settings

RobertHue/video2images

Repository files navigation

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 robert.huem@gmail.com.

About

Converts a video into images filtered for photogrammetry, suitable for use in software like Meshroom.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages