项目作者: ItsWajdy

项目描述 :
A Python package to reconstruct 3D models from video
高级语言: Python
项目地址: git://github.com/ItsWajdy/modeler.git
创建时间: 2018-12-19T05:07:25Z
项目社区:https://github.com/ItsWajdy/modeler

开源协议:MIT License

下载


modeler

A simple package to reconstruct a 3D model of an object from a video taken for that object

Prerequisites

This package uses Python 3.x

Also, you’ll need OpenCV and numpy which can be downloaded using the following commands

  1. pip install numpy
  2. pip install opencv-python

Installation

To install modeler simply run this command from the command line:

  1. pip install modeler

Or

  1. pip install git+git://github.com/Wajdy759/modeler.git#egg=modeler

Then you can import it using:

  1. import modeler

Usage

modeler has a module called SfM which handles wraps everything you’ll need

  1. sfm = SfM(results_dir, video_already_converted, video_path, video_sampling_rate)

Where:

  • results_dir: the directory where the module outputs the .ply file
  • video_already_converted: a boolean set to true if the video used was already converted to images in ‘input_images’
  • video_path: in case video_already_converted is False, the module uses the video in ‘video_path’ as input
  • video_sampling_rate: the frequency at which the module extracts images from the video to use in the actual reconstruction

To actually run the algorithm and get the 3D model you’d use

  1. sfm.find_structure_from_motion()

Example

  1. from modeler import SfM
  2. sfm = SfM('results/', False, 'videos/vid1.mp4', 27)
  3. sfm.structure_from_motion()

When the progrm terminates you’ll get a set of .ply files in the folder named results

References

This project was heavily inspired by this article https://www.researchgate.net/publication/265190880_3D_reconstruction_from_multiple_images