agisoft-llc / metashape-scripts

Python scripts for Metashape (former PhotoScan)
MIT License
376 stars 204 forks source link

Gaussian splatting script does not include all tie points (?) #78

Closed shiukaheng closed 7 months ago

shiukaheng commented 7 months ago

I am using the Gaussian Splatting export script but it seems like all the point3d_id's referenced in points3D.txt do not exist in the IDs in images.txt. However I am not familiar enough with the Metashape API to figure out what the issue is. I would continue to look into this but would appreciate any help in the meantime, thanks!

Attached are some sample reconstruction files demonstrating the issue; I have converted it to .txt format for easy reading. images.txt points3D.txt

Teran72 commented 7 months ago

Thank you for the report, we have fixed that.

graveyard99 commented 5 months ago

This script only exports Master cameras.

Right now I have 700 Master cams, each with 5 Slave cams, so in total I should have access to 3500 cams for GS… I hope that makes sense

Looking at the scripting documentation here: http://download.agisoft.com/metashape-java-api/latest/com/agisoft/metashape/Chunk.html

Seems like I need to do something like this, but unsure how exactly, as I’m a total Python noob:

To export the slave/secondary cameras, I’ll need to modify the parts of the script that iterate over the cameras in each chunk/frame. Specifically, in the functions “get_filtered_track_structure”, “save_undistorted_images”, and “save_images”, i’lll need to iterate over not just “frame.cameras” but also “frame.camericaclusters” which contains the slave camera clusters.

For each slave camera cluster, I’ll need to extract the individual slave cameras using “cluster.cameras” and process them similar to how the primary cameras are processed.

Can we get this updated in the script so Multicam users can enjoy GS too? Would help people in the VFX and Surveying industry a great deal!

PolarNick239 commented 5 months ago

Hi @graveyard99, please create a new issue so that it will be easier not to get entangled in discussions.

Also, please share a project-reproducer to support@agisoft.com with steps to reproduce (probably just "open the project -> launch the script"), so we were able to reproduce and investigate the problem. Probably small part of the project will be enough - just make sure that it can reproduce the problem.