Forum

Author Topic: Proper Usage for buildDepthMaps(camera)  (Read 4642 times)

jeffreyianwilson

  • Newbie
  • *
  • Posts: 40
  • Technical Director at Rendered.AI
    • View Profile
    • Portfolio Webpage
Proper Usage for buildDepthMaps(camera)
« on: June 09, 2023, 08:15:45 PM »
Hi

So I am trying to step through cameras in a chunk, the scan is huge and I want to save after each camera depth map is generated.  What is the proper use of [,cameras] for buildDepthMaps?

Jeff


Code: [Select]
if buildDM == True:
    if stepDM == True: # Step through all cameras in a chunk and build depth map and save project
        cameras = chunk.cameras
        cameraCount = len(cameras)
        print("There are " + str(cameraCount) + " cameras in the chunk")
        for i in range(len(cameras)):
            print("------------- Camera " +str(i))
            chunk.buildDepthMaps(cameras[i], downscale=quality, filter_mode=Metashape.FilterMode.MildFiltering, reuse_depth=True, max_neighbors=-1, subdivide_task=True, workitem_size_cameras=20, max_workgroup_size=100)
            doc.save()
Jeffrey Ian Wilson
Technical Director / Program Manager
3D Scanning Masterclass
https://jeffreyianwilson.com

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15612
    • View Profile
Re: Proper Usage for buildDepthMaps(camera)
« Reply #1 on: June 14, 2023, 06:39:13 PM »
Hello Jeff,

Currently it is not possible to access the individual depth maps until the depth maps generation task is finished. The task takes the list of camera.key elements for the cameras that should participate in the process (i.e. those cameras that are not included, will be internally "disabled" and would not be taken into account).
Best regards,
Alexey Pasumansky,
Agisoft LLC