Giter VIP home page Giter VIP logo

agi2nerf's Introduction

Agisoft Metashape 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 Agisoft Metashape camera locations. Updated for per camera intrinsic outputs.

Installation

Copy agi2nerf.py file into instant-ngp\scripts folder

Usage

Use Agisoft Metashape to align cameras.

Export cameras

File -> Export -> Export Cameras...

Save the XML file exported from Agisoft Metashape into the directory that contains your /imagesfolder.

Open a shell (CMD, Powershell, Bash, etc.) and navigate to the directory with your XML file and /images folder:

cd [PATH TO FOLDER]

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

Commands

Example:

python "[PATH TO iNGP]\agi2nerf.py" --xml_in "[NAME_OF_XML_FILE].xml" --imgfolder .\images

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

Additional command examples

Disable the agisoft scale and scene orientation

python "[PATH TO iNGP]\agi2nerf.py" --xml_in "[NAME_OF_XML_FILE].xml" --imgfolder .\images --no_scale --no_scene_orientation

Scale the scene down by 0.01

python "[PATH TO iNGP]\agi2nerf.py" --xml_in "[NAME_OF_XML_FILE].xml" --imgfolder .\images --scale 0.01

Display the cameras in 3d and set the camera size (for debugging)

python "[PATH TO iNGP]\agi2nerf.py" --xml_in "[NAME_OF_XML_FILE].xml" --imgfolder .\images --plot --camera_size 1

Arguments:

Argument Default Value Description
--xml_in None specify xml 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 agisoft orientation
--no_scale False disable the agisoft 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

agi2nerf's People

Contributors

joreeves avatar enricoahlers avatar jojoreeves avatar

Stargazers

Raja Kumar avatar  avatar  avatar Andrew Hazelden avatar  avatar

Watchers

Erik Winquist avatar Henry Pearce avatar

Forkers

henrypearce4d

agi2nerf's Issues

Fisheye support

Hi, I posted this request in the original repo, but just saw you've added loads of nice features here!

It would be great if this tool worked with Metashape's fisheye camera type, now that Instant NGP supports OpenCV fisheye.

Nerfstudio's Metashape import was recently updated to support this, in case it helps:

https://github.com/nerfstudio-project/nerfstudio/blob/f015245ca4be13b1d3778e4d139c1f1590013757/nerfstudio/process_data/metashape_utils.py#L15

Currently using Colmap to align fisheye images, but it's painfully slow compared to Metashape!

Thanks!

No matching image found

No matching images found, the script finds all of the cameras and sensors in the .xml file but not the images.

Hard to say how to reproduce.

I expect the images to be found and the transforms file to have more data than;

    "aabb_scale": 16,
    "frames": []

XML attached
cameras.zip

Screenshots
image
image

  • OS: Windows 10 Pro

This is the script format I used and ran cmd from the folder location of the /images folder and .xml
C:\Users\user\Downloads\Instant-NGP-for-RTX-2000\scripts\agi2nerf.py" --xml_in "cameras.xml" --imgfolder .\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.