nerfstudio-project / nerfstudio

A collaboration friendly studio for NeRFs
https://docs.nerf.studio
Apache License 2.0
8.91k stars 1.18k forks source link

[Question] about Agisoft Metashape data conversion #2294

Open sanskar107 opened 11 months ago

sanskar107 commented 11 months ago

I believe that agisoft follows colmap camera convention (right, down, forward), whereas nerfstudio follows right, up, backwards. So while data conversion, we just need to negate the second and third row of transform matrix ([x,y,z] -> [x,-y,-z]). But there's an extra axis rotation in the conversion script here... https://github.com/nerfstudio-project/nerfstudio/blob/main/nerfstudio/process_data/metashape_utils.py#L183

Why convert [x,y,z] to [z, x, y], and then change the sign to [z, -x, -y] ?

kkodamakazusa commented 11 months ago

As you mention, I also think some edit in metashape_utils.py make good result.

at line 142 and 143, m[:3, :3] = r, m[:3, 3] = t/s --> m[:3, :3] = r*s, m[:3, 3] = t. and comment out the line at182, transform = transform[[2, 0, 1, 3], :]. by this change, I obtain pcd model with same coordinate in metashape. (I also use "--pipeline.datamanager.camera-optimizer.mode off nerfstudio-data --orientation-method none --center-method none --auto-scale-poses False" option when training)

Yaodizhao commented 8 months ago

May I ask if I can convert the generated point cloud back to the original data, but there is a significant difference when I perform calculations. May I ask if you can give me some help