# tfg.rendering.camera.perspective.project

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/rendering/camera/perspective.py#L327-L388) |

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

    tfg.rendering.camera.perspective.project(
        point_3d: type_alias.TensorLike,
        focal: type_alias.TensorLike,
        principal_point: type_alias.TensorLike,
        name: str = 'perspective_project'
    ) -> tf.Tensor

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

\\\[
\\begin{matrix}
x' = \\frac{f_x}{z}x + c_x, \& y' = \\frac{f_y}{z}y + c_y,
\\end{matrix}
\\\]

where \\((f_x, f_y)\\) is the focal length and \\((c_x, c_y)\\) the principal
point.

<br />

<br />

<br />

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

<br />

<br />

<br />

<br />

| ## Args ||
|---|---|
| `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". |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tensor of shape `[A1, ..., An, 2]`, where the last dimension represents a 2d point. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If the shape of `point_3d`, `focal`, or `principal_point` is not supported. |

<br />