Forum

Author Topic: Adding Images from list to two Groups  (Read 3128 times)

Chris_1979

  • Newbie
  • *
  • Posts: 6
    • View Profile
Adding Images from list to two Groups
« on: March 12, 2021, 01:51:02 PM »
Hi There,

I have been using the attached script with Metashape version 1.5.5 for the past couple of years. I recently updated to 1.7.1 and the script no longer works. I think I fixed one issue with the the way I was loading the XML calibration file, but I think it's now failing on the chunk.addPhotos(image_list).

Do I need to add the extra arguments (filegroup, and image layout)? If so, how should I do that?

Kind Regards,
Chris

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15160
    • View Profile
Re: Adding Images from list to two Groups
« Reply #1 on: March 13, 2021, 02:18:54 PM »
Hello Chris,

Please try to include an additional argument to addPhotos method:
Code: [Select]
chunk.addPhotos(image_list, strip_extensions=False)
Does it solve the problem?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Chris_1979

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Adding Images from list to two Groups
« Reply #2 on: March 13, 2021, 08:02:37 PM »
Hi Alexey,

Unfortunately that didn't fix it either. Also tried setting it to True.

When I run the script through the console, I get the error in the attached image.

Any suggestions?

Kind Regards,
Chris


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15160
    • View Profile
Re: Adding Images from list to two Groups
« Reply #3 on: March 13, 2021, 11:20:41 PM »
Hello Chris,

You may need to replace the "map" line (#40) with the following line:
Code: [Select]
image_list = [image.strip() for image in image_list]
Also make sure that the paths use either "slash" symbol or double-"backslash".
Best regards,
Alexey Pasumansky,
Agisoft LLC

Chris_1979

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Adding Images from list to two Groups
« Reply #4 on: March 15, 2021, 02:11:34 PM »
Hi Alexey,

Thank you for this. It helped a lot.

Kind Regards,
Chris