class_docstr: Class to represent Pinhole Camera Model.
  
  The pinhole camera model describes the mathematical relationship between
  the coordinates of a point in three-dimensional space and its projection
  onto the image plane of an ideal pinhole camera,
  where the camera aperture is described as a point and no lenses are used to focus light.
  See more: https://en.wikipedia.org/wiki/Pinhole_camera_model
  
  Example:
      >>> cam = CameraModel(ImageSize(480, 640), CameraModelType.PINHOLE, torch.Tensor([328., 328., 320., 240.]))
      >>> cam
      CameraModel(ImageSize(height=480, width=640), PinholeModel, tensor([328., 328., 320., 240.]))
class_docstr_tok: ["Class","to","represent","Pinhole","Camera","Model",".","The","pinhole","camera","model","describes","the","mathematical","relationship","between","the","coordinates","of","a","point","in","three-dimensional","space","and","its","projection","onto","the","image","plane","of","an","ideal","pinhole","camera",",","where","the","camera","aperture","is","described","as","a","point","and","no","lenses","are","used","to","focus","light",".","See","more",":","https",":","\/\/en.wikipedia.org\/wiki\/Pinhole_camera_model","Example",":",">",">",">","cam","=","CameraModel","(","ImageSize","(","480",",","640",")",",","CameraModelType.PINHOLE",",","torch.Tensor","(","[","328.",",","328.",",","320.",",","240",".","]",")",")",">",">",">","cam","CameraModel","(","ImageSize","(","height=480",",","width=640",")",",","PinholeModel",",","tensor","(","[","328.",",","328.",",","320.",",","240",".","]",")",")"]
docstr: Returns the camera matrix.
  
  The matrix is of the form:
  
  .. math::
      \begin{bmatrix} fx & 0 & cx \\
      0 & fy & cy \\
      0 & 0 & 1\end{bmatrix}
  
  Example:
      >>> cam = CameraModel(ImageSize(480, 640), CameraModelType.PINHOLE, torch.Tensor([1.0, 2.0, 3.0, 4.0]))
      >>> cam.matrix()
      tensor([[1., 0., 3.],
              [0., 2., 4.],
              [0., 0., 1.]])
code: def matrix(self) -> Tensor:
      r"""Returns the camera matrix.
  
          The matrix is of the form:
  
          .. math::
              \begin{bmatrix} fx & 0 & cx \\
              0 & fy & cy \\
              0 & 0 & 1\end{bmatrix}
  
          Example:
              >>> cam = CameraModel(ImageSize(480, 640), CameraModelType.PINHOLE, torch.Tensor([1.0, 2.0, 3.0, 4.0]))
              >>> cam.matrix()
              tensor([[1., 0., 3.],
                      [0., 2., 4.],
                      [0., 0., 1.]])
          """
      z = zeros_like(self.fx)
      row1 = stack((self.fx, z, self.cx), -1)
      row2 = stack((z, self.fy, self.cy), -1)
      row3 = stack((z, z, z), -1)
      K = stack((row1, row2, row3), -2)
      K[..., -1, -1] = 1.0
      return K
  
imports: from __future__ import annotations
  from enum import Enum
  from typing import Any, Union
  from kornia.core import Tensor, stack, zeros_like
  from kornia.geometry.vector import Vector2, Vector3
  from kornia.image import ImageSize
  from kornia.sensors.camera.distortion_model import AffineTransform, BrownConradyTransform, KannalaBrandtK3Transform
  from kornia.sensors.camera.projection_model import OrthographicProjection, Z1Projection
label_desc: Use image node_id 2 for calling the PinholeModel obj's underlying member method code with example usage: obj.matrix() and returns: K