Author Topic: Import Camera Positions via Python API  (Read 2543 times)


  • Newbie
  • *
  • Posts: 1
    • View Profile
Import Camera Positions via Python API
« on: August 03, 2021, 07:05:08 PM »
Hello Metashape Community,

as I am a very new user to Metashape Pro I have a little Question. I've searched the Forum but did not find an answer to it.

For my Bachelor thesis in Robotics I am building a Robot with a camera attached to it, to automatically 3D scan small objets using Metashape Pro to model them from taken Images. As described here I've created a .txt file with the robot positions and the Filenames at the beginning of each line front.

As far as I understood I can import the File via File -> import -> import Cameras

So first question: is that correct? or do I use the worng Button, since if I click it it asks me about building the Point cloud but afterwards nothing happens.

Second Question is: How can I import this file via the Python API?

I hope to get some Answers soon :)

Kind regards and thank you in advance



  • Hero Member
  • *****
  • Posts: 1350
    • View Profile
Re: Import Camera Positions via Python API
« Reply #1 on: August 03, 2021, 09:27:58 PM »
Hi caboom345,

Precise external and internal camera data can be imported into Metshape in case where this data has beeb determined in some external process or software (Inpho, PatB, Bingo,....). When you do the Cameras Import, then the camera`s estimated reference will be set as well as camera calibration adjusted values according to imported data. Then the software will ask to perform an image feature detection and matching process keeping external/ internal orientation fixed. This supposes that corresponding images are loaded in the project...

This import can only be done with camera data set in certain formats as specified in User Manual page 30.

I doubt that your txt file corresponds to any of these formats....

Using Python you can look at chunk.importReference(...) method to import your reference info to your cameras source reference.... see p.40 of API reference manual...
« Last Edit: August 04, 2021, 02:31:22 AM by Paulo »
Best Regards,
Paul Pelletier,