Forum

Author Topic: Distance between camera center and point in pointcloud  (Read 1678 times)

akoumis

  • Newbie
  • *
  • Posts: 3
    • View Profile
Distance between camera center and point in pointcloud
« on: July 19, 2018, 12:05:46 AM »
Hi, I have tried the following variations but can't get accurate values, any ideas?

Code: [Select]
T = chunk.transform.matrix
scale = chunk.transform.scale
pt = chunk.point_cloud.points[0]
crs = chunk.crs

distance = (T.mulv(cam.center - pt.coord[:3]) * scale).norm()
distance = (crs.project(T.mulp(cam.center)) - crs.project(T.mulp(pt.coord[:3]))).norm()

Thank you!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Distance between camera center and point in pointcloud
« Reply #1 on: July 19, 2018, 05:47:47 PM »
Hello akoumis,

I think that (T.mulv(cam.center - pt.coord[:3])).norm() should give you the proper result.
Best regards,
Alexey Pasumansky,
Agisoft LLC