Loading...
Given a 3D point in camera coordinates and a camera intrinsic matrix K, compute the projected 2D pixel coordinates using the pinhole camera model.
The intrinsic matrix K has the form:
K=fx000fy0cxcy1
Where fx,fy are focal lengths and (cx,cy) is the principal point.
The projection formula is:
uv1=Zc1KXcYcZc
Return the 2D pixel coordinates [u,v] rounded to 2 decimal places.
print(pinhole_projection([[800.0, 0.0, 320.0], [0.0, 800.0, 240.0], [0.0, 0.0, 1.0]], [10.0, 20.0, 5.0]))
[1920.0, 3440.0]