Forum

Author Topic: Camera import naming inconsistant  (Read 1694 times)

DaveRig

  • Newbie
  • *
  • Posts: 24
    • View Profile
Camera import naming inconsistant
« on: March 02, 2018, 08:41:16 PM »
I'm writing a script to import cameras from a folder and I found the naming in the file is not the same as if I import the cameras from the UI. Using this code
Code: [Select]
for photo in image_list:
if ("tif" or "tiff") in photo.lower():
photo_list.append(path_photos + "\\" + photo)
print ("photo_list - " + str(','.join(photo_list)))
chunk.addPhotos(photo_list)
I get camera labels of "Camera1, Camera2, Camera3,..." but if I import the same cameras using the UI I get "Camera1.tiff, Camera2.tiff, Camera3.tiff..."
This is causing a issue with alignment as I am importing the cameras to speed alignment but the label difference is causing it to fail.
Anyone know how to have the "addPhotos()" command keep the file extention?
I verified by printing out the list that the file extension are included in the list.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14860
    • View Profile
Re: Camera import naming inconsistant
« Reply #1 on: March 02, 2018, 09:07:28 PM »
Hello DaveRig,

You need to use "strip_extensions = False" in the .addPhotos() function, if you wish to keep the file extensions in the camera labels. This argument has been implements in Python API 1.4.1.
Best regards,
Alexey Pasumansky,
Agisoft LLC

DaveRig

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Camera import naming inconsistant
« Reply #2 on: March 02, 2018, 11:25:43 PM »
Awesome, thanks  :)