Giter VIP home page Giter VIP logo

mr2nerf's Introduction

Meshroom camera location to NERF conversion tool with per camera intrinsics

This tool is for use with https://github.com/NVlabs/instant-ngp and allows the use of Meshroom camera locations.

Usage

In Meshroom, add a ConvertSfMFormat node and change the SfM Format to json. af32538a-bd34-4c62-aa1d-9706002ea0a0

Optional: Meshroom does not align or constrain solved cameras, you may want to add a SfMTransform after the StructureFromMotion node, set the Transformation Method to Manual, and adjust the location and rotation of the solved cameras.

When you Start the Meshroom processing, it will generate a folder for the output of the ConvertSfMFormat node, which you can easily find by right clicking on the node and selecting Open Folder. The file sfm.json will be generated when Meshroom is done processing. This is the file you need for this script's --input function. 0eec4a33-97a7-4c38-91dd-5261500aae68

Run the mr2nerf.py on this JSON file using the following command, replacing the text in brackets [โ€ฆ] with the file names and paths on your machine:

Commands

Example:

  • Replace [PATH_TO_JSON_FILE] with the path to the JSON that was exported from Meshroom
  • Replace [PATH_TO_IMAGES] with the path to your images folder
python mr2nerf.py --input "[PATH_TO_JSON_FILE].json" --imgfolder "[PATH_TO_IMAGES]"

The quotes are only required if you have spaces in any of the folder or file names.

Additional command examples

Scale the scene up by 100

python mr2nerf.py --input "[NAME_OF_JSON_FILE].json" --imgfolder "[PATH_TO_IMAGES]" --scale 100

Display the cameras in 3d and set the camera size (for debugging only, requires installing matplotlib and pytransform3d)

python mr2nerf.py --input "[NAME_OF_JSON_FILE].json" --imgfolder "[PATH_TO_IMAGES]" --plot --camera_size 1

Arguments:

Argument Default Value Description
--input None specify json file location
--out transforms.json specify output file path
--imgfolder .\images location of image folder
--imgtype jpg ex.: jpg, png, ...
--aabb_scale 16 sets the aabb scale
--no_scene_orientation False disable the Meshroom orientation
--no_scale False disable the Meshroom scale
--no_center False disable the scene centering
--plot False display the camera positions
--camera_size 0.1 the size of the displayed cameras
--debug_ignore_images False ignores the input images, for debugging only
--threads 8 number of threads to use when reading images

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.