Forum

Author Topic: Depth maps don't export from context menu (1.4.1)  (Read 3462 times)

andyroo

  • Sr. Member
  • ****
  • Posts: 401
    • View Profile
Depth maps don't export from context menu (1.4.1)
« on: May 22, 2018, 10:37:35 PM »
I have the same issue as this post in version 1.4.1 (windows 7). When I right-click on a photo or selected photos after creating depth maps (selecting keep depth maps in preferences) nothing happens. There's no additional prompt, no waiting, no nothing. I can see in the project structure that the .exr files exist, but can't access them to export from the application.

[EDIT] I wonder if the problem is that I have the model in local coordinates so there's no absolute depth reference? I can see that depth maps are generated in my active chunk because I changed the photo view to show them. I tried to explore this a little more with some code in the console and got a Null Model error. This was my attempt at exporting via python:

Code: [Select]
doc = PhotoScan.app.document
chunk = doc.chunk
task = PhotoScan.Tasks.ExportDepth()
task.cameras = chunk.cameras
task.export_depth =True
task.export_normals = True
task.export_diffuse = True
path_depth = "E:\depthMaps"
path_diffuse = "E:\diffuse"
path_normals = "E:\\normals"
task.apply(chunk)
2018-05-22 13:45:46 ExportDepth
2018-05-22 13:45:46 Finished processing in 0.001 sec (exit code 0)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-57-a7a9f0f263fc> in <module>()
----> 1 task.apply(chunk)
RuntimeError: Null model
« Last Edit: May 23, 2018, 12:05:47 AM by andyroo »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13913
    • View Profile
Re: Depth maps don't export from context menu (1.4.1)
« Reply #1 on: May 24, 2018, 07:24:38 PM »
Hello Andy,

Can you please check, if Export Depth works in the version 1.4.2 build 6205 properly?

Actually, Export Depth operation is not using depth maps generated during the dense cloud calculation, the depth is estimated as a distance from the camera to the mesh model and would work even for unscaled models.

So to complete this task you need to have mesh model and Null Model error indicates that there's no mesh in the active chunk.
Best regards,
Alexey Pasumansky,
Agisoft LLC

andyroo

  • Sr. Member
  • ****
  • Posts: 401
    • View Profile
Re: Depth maps don't export from context menu (1.4.1)
« Reply #2 on: May 24, 2018, 08:25:15 PM »
That's my problem then, I generated depthmap and pointcloud only. I assumed that since the depth map was visible in the photo pane I could export it.


Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 13913
    • View Profile
Re: Depth maps don't export from context menu (1.4.1)
« Reply #3 on: May 24, 2018, 09:03:42 PM »
Hello Andy,

you can try to use the following basing on the depth maps:

Code: [Select]
chunk = PhotoScan.app.document.chunk
for camera in chunk.cameras:
    if camera in chunk.depth_maps.keys():
        depth = chunk.depth_maps[camera].image()
        depth.save(camera.label + ".exr")

Let me know if it provides the expected results. But note that the depth image is scaled due to the dense cloud quality value.
Best regards,
Alexey Pasumansky,
Agisoft LLC