Forum

Author Topic: Calculate the capture distance  (Read 4872 times)

Fabien13

  • Newbie
  • *
  • Posts: 11
    • View Profile
Calculate the capture distance
« on: June 25, 2024, 01:14:29 PM »
Hello,

Does anyone know how to calculate the capture distance on oblique photos taken by drone when it is a landscape and not a facade?

Thank you

Paulo

  • Hero Member
  • *****
  • Posts: 1500
    • View Profile
Re: Calculate the capture distance
« Reply #1 on: June 25, 2024, 10:00:05 PM »
Hello Fabien,

if you have a 3d Model or dense point cloud as a surface, then for each camera, the distance between camera perspective center and point on model or point cloud would be:

Code: [Select]
chunk = Metashape.app.document.chunk

surface = chunk.point_cloud

chunk.transform.scale * (ps.Vector(camera.center - surface.pickPoint(camera.center,camera.transform.mulp(ps.Vector((0,0,1))))).norm())
Out[21]: 2024-06-25 13:09:12 52.70104912784214

« Last Edit: June 25, 2024, 10:09:47 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Fabien13

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Calculate the capture distance
« Reply #2 on: July 09, 2024, 04:01:59 PM »
Thank you Paulo,

sorry but I need more explanations. How could I use this code?

Best regards.

Paulo

  • Hero Member
  • *****
  • Posts: 1500
    • View Profile
Re: Calculate the capture distance
« Reply #3 on: July 11, 2024, 03:17:28 PM »
Hello Fabien,
In above code camera is a certain camera in chunk.cameras. So in code you could loop thru all cameras in chunk by adding:
Code: [Select]
for camera in chunk.cameras:
    then add code to calculate capture distance
« Last Edit: July 11, 2024, 03:25:16 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor