Author Topic: addPhotos in Metashap 1.6.0 RuntimeError: Can't load photos  (Read 3421 times)


  • Newbie
  • *
  • Posts: 26
    • View Profile
addPhotos in Metashap 1.6.0 RuntimeError: Can't load photos
« on: December 02, 2019, 11:02:47 AM »
hello everyone,
 I run this script in Metashap 1.5.2 is ok,but run in Metashap 1.6.0 is error:
Traceback (most recent call last):
File "<console>", line 1, in <module>
RuntimeError: Can't load photos

import Metashape

can you help me? thank you very much

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14968
    • View Profile
Re: addPhotos in Metashap 1.6.0 RuntimeError: Can't load photos
« Reply #1 on: December 02, 2019, 03:27:15 PM »

In the version 1.6.0 the approach of loading images for multi-camera systems is slightly different.
For the filenames argument you should pass the plain list of the filenames, and for filegroups the list of int, where each number represents the number of sensors in each group. The images assigned to the filegroups will be taken from the filenames list.

So in your case you can do the following:

Code: [Select]
images = [None]*(len(rgb) + len(nir))
images[::2] = rgb
images[1::2] = nir
filegroups = [2]*(len(images)//2)
#images is alternating list of rgb, nir paths
#filegroups defines the multi-camera system groups: [2, 2, 2, ....]

chunk.addPhotos(filenames = images, filegroups = filegroups, layout=Metashape.MultiplaneLayout)

Best regards,
Alexey Pasumansky,
Agisoft LLC