tfg.rendering.camera.perspective.project

Projects a 3d point onto the 2d camera plane.

Projects a 3d point (x,y,z) to a 2d point (x,y) onto the image plane with

x=fxzx+cx,y=fyzy+cy,

where (fx,fy) is the focal length and (cx,cy) the principal point.

In the following, A1 to An are optional batch dimensions that must be broadcast compatible.

point_3d A tensor of shape [A1, ..., An, 3], where the last dimension represents a 3d point to project.
focal A tensor of shape [A1, ..., An, 2], where the last dimension represents a camera focal length.
principal_point A tensor of shape [A1, ..., An, 2], where the last dimension represents a camera principal point.
name A name for this op that defaults to "perspective_project".

A tensor of shape [A1, ..., An, 2], where the last dimension represents a 2d point.

ValueError If the shape of point_3d, focal, or principal_point is not supported.