
    3j                         S r SSKrSSKJr  S\R                  S\R                  4S jrS\R                  S\R                  S\R                  4S jrS\R                  S\R                  4S	 jrg)
z;nn.Module containing functions for orthographic projection.    NKORNIA_CHECK_SHAPEpoints_in_camerareturnc                 0    [        U SS/5        U SSS24   $ )a  Project points from the camera frame into the canonical z=1 plane through orthographic projection.

.. math::
    \begin{bmatrix} u \\ v \end{bmatrix} =
    \begin{bmatrix} x \\ y \\ z \end{bmatrix}


Args:
    points_in_camera: torch.Tensor representing the points to project.

Returns:
    torch.Tensor representing the projected points.

Example:
    >>> points = torch.tensor([1., 2., 3.])
    >>> project_points_orthographic(points)
    tensor([1., 2.])

*3.N   r   r   s    h/home/wildlama/miniconda3/lib/python3.13/site-packages/kornia/geometry/camera/projection_orthographic.pyproject_points_orthographicr      s&    ( '#s4C!G$$    	extensionc                     [        U SS/5        [        U R                  5      [        UR                  5      :w  a  US   n[        R                  " X/SS9$ )a  Unproject one or more points from the canonical z=1 plane into the camera frame.

.. math::
    \begin{bmatrix} x \\ y \\ z \end{bmatrix} =
    \begin{bmatrix} u \\ v \\ w \end{bmatrix}

Args:
    points_in_camera: torch.Tensor representing the points to unproject with shape (..., 2).
    extension: torch.Tensor representing the extension of the points to unproject with shape (..., 1).

Returns:
    torch.Tensor representing the unprojected points with shape (..., 3).

Example:
    >>> points = torch.tensor([1., 2.])
    >>> extension = torch.tensor([3.])
    >>> unproject_points_orthographic(points, extension)
    tensor([1., 2., 3.])

r   2).N)dim)r   lenshapetorchcat)r   r   s     r   unproject_points_orthographicr   2   sO    * '#s4
!!"c)//&::i(	99&2;;r   c                 X    [        U SS/5        [        R                  " U SSS24   5      $ )a  Compute the derivative of the x projection with respect to the x coordinate.

.. math::
    \frac{\partial u}{\partial x} = 1

Args:
    points_in_camera: torch.Tensor representing the points to project.

Returns:
    torch.Tensor representing the derivative of the x projection with respect to the x coordinate.

Example:
    >>> points = torch.tensor([1., 2., 3.])
    >>> dx_project_points_orthographic(points)
    tensor([1.])

r   r	   .r      )r   r   	ones_liker   s    r   dx_project_points_orthographicr   O   s0    $ '#s4??+C1H566r   )__doc__r   kornia.core.checkr   Tensorr   r   r    r   r   <module>r!      sr   $ B  0%%,, %5<< %0<ELL <U\\ <^c^j^j <:7U\\ 7ell 7r   