Forum

Author Topic: Depth maps / distance from sensor  (Read 1701 times)

KarenStr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Depth maps / distance from sensor
« on: March 19, 2021, 08:04:35 PM »
Hi!

For my project, I require the distance from the camera(/sensor), ideally for each individual pixel of my photos. If I understood correctly, the depth maps should contain exactly that. I used the script provided in this post https://www.agisoft.com/forum/index.php?topic=11171.msg50351 to export the depthmaps as tifs and now loaded the stored values into an array.

What I do not understand: the dimensions of the depthmaps (and the resulting arrays) are not the same as the original photos, they are smaller. Why is that and where do I find the distance value I am looking for?

Thanks in advance!! :-)
« Last Edit: March 19, 2021, 08:16:07 PM by KarenStr »

KarenStr

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Depth maps / distance from sensor
« Reply #1 on: March 20, 2021, 01:41:19 AM »
Haha, nevermind the resolution question - it was due to me calculating depth maps only with medium resolution. Working with ultrahigh gives the expected dimensions of the array.

However, each entry of the array seems to be 0.0. What am I missing?
« Last Edit: March 20, 2021, 01:44:47 AM by KarenStr »

Paulo

  • Hero Member
  • *****
  • Posts: 1347
    • View Profile
Re: Depth maps / distance from sensor
« Reply #2 on: March 20, 2021, 09:51:54 AM »
Hi KarenStr,

i think not all values from your numpy array are 0. Only the nodata values are set to 0 and represent no depth or black when visualizing the depth map in MS. In attached screen copy, I printed out the array values from 100th row of depth map from camera DJI_0359 and values are not 0 excepth for first and last 2. Of course, 1st row and last row are 0 (all black in image).

Hope this can be insightful,

In 2nd attachment, I display the exported depth map superimposed on original image in Global Mapper. I cropped out the nodepth value of 0 to only show the valid depths (scaled by chunk.transform.scale during export).
« Last Edit: March 20, 2021, 04:56:41 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor