Using known camera positions - alicevision/Meshroom GitHub Wiki

ImportFromKnownPoses

Meshroom now has a node "ImportFromKnownPoses" format and a sample of XML/JSON used in the KnownPosesData.

Features list https://github.com/alicevision/AliceVision/pull/1078

  • Import known poses from a JSON file (camera poses and intrinsics) (Details on Meshroom SFM format, read below)
  • Import known poses from XMP (XML) files (camera poses and intrinsics) (Agisoft Cameras XML Export? https://github.com/alicevision/Meshroom/issues/2158#issuecomment-1688088767)
  • Import known poses from a maya text file .ma (camera poses only).
  • [mesh] new remap visibility method without dense sfmData information. Guess visibilities from mesh orientation. It assumes that there is no occultation from non reconstructed elements.
  • [mesh] obj loader: fix material index management when combining multiple ones
  • [sfm] incremental: optimize input when starting from known poses/landmarks

Insert the node as follows and set the input for Known pose data. You probably want to enable FeatureMatching: FromKnownPoses option and maybe StructureFromMotion: lock cameras previously reconstructed, depending on your use case.

grafik

Old notes on Using known camera positions (outdated, but may be useful)

WIP (experimental feature, don´t expect it to work right away. Some tinkering is required.)

(matchFromKnownCameraPoses in the FeatureMatching node is not available in the 2019 release. )

In most of the cases using known camera positions is only useful for research. If you are looking for a way to improve accuracy: your own calculated camera poses are probably not precise enough. Using previously computed Meshroom sfm files will work though.

modifying existing cameras.sfm file

  1. Compute the default pipeline with a set of images to the SFM node.
  2. Open the SFM node folder
  3. Inspect the cameras.sfm file (you can compare it to the cameraInit.sfm to see what lines need to be added with your known camera positions.) Create a new cameras.sfm file with your known camera data in a new folder somewhere.

When creating your own sfm file, remove

`"featuresFolders":... and "matchesFolders": (leaving this in the sfm file messes up the paths).

[set "locked": "0" to "locked": "1" ]

Create a new cameras.sfm file with your known camera positions in a new folder somewhere. Rotation format Make sure your new sfm file uses the correct syntax and you did not miss any quotation marks (...).

  • disconnect CameraInit and FeatureExtraction
  • Input the new cameras.sfm in FeatureExtraction
  • make sure the node shows advanced settings (click on ... in the upper right border of the node settings)
  • in FeatureMatching you can now select "Match from known camera poses" (only in MR2020.x)
  • in StructureFromMotion "Lock Scene previously reconstructed" and "Force Lock of all Intrinsic Camera Parameters"

knownc

-> https://github.com/alicevision/meshroom/issues/1240

References: latest #829 #1167

#399, #740, #453, #475, #300, #787, #788, #747, #807, #721, #725, #1128 #1601

(Note: pose and rotation values may change from the 16+ digits after the decimal point)

Note: The creators of scAnt (an open-source platform for thecreation of 3D models of arthropods(and other small objects)) wrote their own script to create a sfm file with estimated poses. It can be used as reference: https://github.com/evo-biomech/scAnt/blob/master/scripts/estimate_camera_positions.py

Somewhat related: How to import own DepthMap discussion