Forum

Author Topic: question about camera.project and camera.unproject  (Read 1548 times)

joshua19881228

  • Newbie
  • *
  • Posts: 9
    • View Profile
question about camera.project and camera.unproject
« on: May 30, 2024, 04:19:16 PM »
Hello,

I've written some code as follows

Code: [Select]

        print("0. width, height:", camera.sensor.width, camera.sensor.height)
print("1. camera.center:",camera.center)

print("2. camera.unproject(Metashape.Vector((2000,1500,0))):", camera.unproject(Metashape.Vector((2000,1500,0))))
print("3. camera.project(camera.center):", camera.project(camera.center))

and the result is

Code: [Select]
0. width, height: 4000 3000
1. camera.center: Vector([6.560932254872134, -0.915845546119054, 0.6655975799801932])
2. camera.unproject(Metashape.Vector((2000,1500,0))): Vector([6.560932254872134, -0.915845546119054, 0.6655975799801932])
3. camera.project(camera.center): None

what is the function of "camera.project"

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15086
    • View Profile
Re: question about camera.project and camera.unproject
« Reply #1 on: June 07, 2024, 01:46:57 PM »
Hello joshua,

camera.project method can be used to get the 2D pixel coordinates in the image space of the 3D point (defined in the internal coordinate system of the chunk).
Best regards,
Alexey Pasumansky,
Agisoft LLC