Forum

Author Topic: importCameras problems  (Read 4557 times)

lmg

  • Newbie
  • *
  • Posts: 30
    • View Profile
importCameras problems
« on: April 22, 2014, 07:58:01 PM »
I am trying to import cameras using a python script.
The part of the code used in the script is this one:
path_cal="M:/D40"  #path for the calibration files
chunk = PhotoScan.Chunk()
starting_frame = iframe
chunk.label = "Frame_" + "{0:04d}".format(iframe)
path_cam=path_cal+"/c01_c04.xml"
chunk.importCameras(path_cam, "xml")


When I run the script, and the processing arrives to these lines, in the log on the console I have:
Loading project...
can't load project


and the cameras calibrations and positions are not imported.
How it is possible to solve this problem?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14818
    • View Profile
Re: importCameras problems
« Reply #1 on: April 22, 2014, 08:17:58 PM »
Hello lmg,

The console output looks like PhotoScan is trying to load the project and not camera calibration. Are there any lines above the code provided with doc.open() or anything similar involving PhotoScan.Document() class variables?
Best regards,
Alexey Pasumansky,
Agisoft LLC

lmg

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: importCameras problems
« Reply #2 on: April 24, 2014, 06:46:30 PM »
I have moved chunk.importCameras(path_cam, "xml") at the end, and now it works. Thank you.
Bye