class_docstr: A :class:`Camera` that uses perspective projection.
  
  Args:
    focal_length (float): The focal length of the camera lens in `mm`. `Default
      = 50`
    sensor_width (float): Horizontal size of the camera sensor in `mm`. `Default
      = 36`
    shift_x (float): Principal point horizontal offset defined as fraction of
      sensor width. `Default = 0.0`
    shift_y (float): Principal point vertical offset defined as fraction of
      sensor height. `Default = 0.0`
class_docstr_tok: ["A",":","class",":","`","Camera","`","that","uses","perspective","projection",".","Args",":","focal_length","(","float",")",":","The","focal","length","of","the","camera","lens","in","`","mm","`",".","`","Default","=","50","`","sensor_width","(","float",")",":","Horizontal","size","of","the","camera","sensor","in","`","mm","`",".","`","Default","=","36","`","shift_x","(","float",")",":","Principal","point","horizontal","offset","defined","as","fraction","of","sensor","width",".","`","Default","=","0.0","`","shift_y","(","float",")",":","Principal","point","vertical","offset","defined","as","fraction","of","sensor","height",".","`","Default","=","0.0","`"]
code: def z_to_depth(self, z: ArrayLike) -> np.ndarray:
      z = np.array(z)
      assert z.ndim >= 3
      h, w, _ = z.shape[-3:]
  
      pixel_centers_x = (
          (np.arange(-w / 2, w / 2, dtype=np.float32) + 0.5)
          / w
          * self.sensor_width
      )
      pixel_centers_y = (
          (np.arange(-h / 2, h / 2, dtype=np.float32) + 0.5)
          / h
          * self.sensor_height
      )
      squared_distance_from_center = np.sum(
          np.square(
              np.meshgrid(
                  pixel_centers_x,  # X-Axis (columns)
                  pixel_centers_y,  # Y-Axis (rows)
                  indexing="xy",
              )
          ),
          axis=0,
      )
  
      depth_scaling = np.sqrt(
          1 + squared_distance_from_center / self.focal_length**2
      )
      depth_scaling = depth_scaling.reshape(
          (1,) * (z.ndim - 3) + depth_scaling.shape + (1,)
      )
      return z * depth_scaling
  
imports: import numpy
  import traitlets
  from kubric.core.assets import UndefinedAsset
  from kubric.core import objects
  from kubric.kubric_typing import ArrayLike
label_desc: Use image node_id 6 for calling the PerspectiveCamera obj's underlying member method code with example usage: obj.z_to_depth(z) and returns: unknown