Forum

Author Topic: Adding photos to CameraGroup  (Read 4865 times)

mankoff

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Home Page
Adding photos to CameraGroup
« on: April 26, 2016, 06:57:39 PM »
Hi,

I can add photos to a chunk with chunk.addPhotos(file_list). Is there a way to add images to a group? The group is created with group = chunk.addCameraGroup().

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15160
    • View Profile
Re: Adding photos to CameraGroup
« Reply #1 on: April 26, 2016, 07:22:18 PM »
Hello mankoff,

You can use the following code as a reference:

Code: [Select]
group = chunk.addCameraGroup()
camera = chunk.cameras[0]
camera.group = group

If you need to "ungroup" the camera, then pass None to camera.group.

Best regards,
Alexey Pasumansky,
Agisoft LLC

mankoff

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Home Page
Re: Adding photos to CameraGroup
« Reply #2 on: April 26, 2016, 08:43:26 PM »
Code: [Select]
camera = chunk.cameras[0] results in
Code: [Select]
IndexError: list index out of range

mankoff

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Home Page
Re: Adding photos to CameraGroup
« Reply #3 on: April 26, 2016, 08:58:29 PM »
Nevermind, I figured it out. To move the last photo into a group that has been created, I do the following.

Code: [Select]
    group = chunk.addCameraGroup()
    for img in image_list:
        chunk.addPhotos([img])
        camera = chunk.cameras[-1]
        camera.group = group