EnricoAhlers / agi2nerf

Simple tool for converting Agisoft XML files to NERF JSON files for https://github.com/NVlabs/instant-ngp
Other
112 stars 15 forks source link

"No calibration found" for spherical cameras #2

Open cpkcpkcpk opened 2 years ago

cpkcpkcpk commented 2 years ago

Hey,

Would it be possible to get this working with spherical / equirectangular camera positions exported from Metashape? Colmap doesn't support 360 images, so would be amazing if your script worked for this!

Here is a snippet from the xml, which is quite different to the regular "frame" type.

`<?xml version="1.0" encoding="UTF-8"?>

uint8 0 0 0 1 1 1
-8.9246900915267902e-01 2.0682838682109413e+01 2.5898418643679420e+01
1.5354224936167401e+02 6.7941420046488446e+01 6.0285307184855142e+01 -4.0138366329283741e-02 8.4499921858002310e-03 -9.9915840044533299e-01 -9.9821655039162638e-01 -4.4561741820354980e-02 3.9723666625547417e-02 -4.4188574005706568e-02 9.9897089487031399e-01 1.0223557568002074e-02
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
9.9959579221709571e-01 2.4701712245502279e-02 1.4074004192741969e-02 7.8205878137425722e-01 2.4443283329927897e-02 -9.9953467003790475e-01 1.8247446184902816e-02 -1.5206475018149446e-01 1.4518198301779174e-02 -1.7896055553066947e-02 -9.9973444129614353e-01 6.6758626639336242e+01 0 0 0 1 `
EnricoAhlers commented 2 years ago

Sadly 360 degree cameras are not supported. I have tried it already but didn't have any success. Outdoor scenes aren't working that well in general.

cpkcpkcpk commented 2 years ago

Ah, that's a shame. Metashape Pro does a great job with equirectangular images and it would be amazing to export the cameras for instant-ngp somehow (before my Pro trial runs out haha).

I have tried splitting the equirectangulars into cubemaps using a few different methods, but Metashape usually fails to align these as there isn't enough overlap.