code: def compute_dot(
      image_size: tf.Tensor,
      intrinsics: tf.Tensor,
      extrinsics: tf.Tensor,
      axis=1,
      image_intersection=(0.5, 0.75),
  ) -> tf.Tensor:
      """Computes the intersection at the ground plane of a ray from the camera.
  
      Args:
        image_size: The size of the camera image.
        intrinsics: The camera intrinsics matrix. Shape: (3, 3)
        extrinsics: The camera extrinsics matrix. Shape: (3, 4)
        axis: The ground plane corresponds to the plane defined by axis = 0.
        image_intersection: The relative image position of the ray intersection.
  
      Returns:
        The intersection. Shape: (3, 1)
      """
      # Shoot ray through image pixel
      ray_2d = tf.cast(image_size, tf.float32) * [
          image_intersection[0],
          image_intersection[1],
          1 / image_size[-1],
      ]
      ray_2d = tf.reshape(ray_2d, [3, 1])
  
      # Invert intrinsics matrix K
      k = tf.reshape(intrinsics, [3, 3])
      k_inv = tf.linalg.inv(k)
  
      # Decompose extrinsics into rotation and translation, and inverte
      rt = tf.reshape(extrinsics, [3, 4])
      r = tf.gather(rt, [0, 1, 2], axis=1)
      t = tf.gather(rt, [3], axis=1)
  
      r_inv = tf.linalg.inv(r)
      t_inv = r_inv @ t * (-1)
  
      # Compute ray intersection with the ground plane along specified axis
      ray = r_inv @ k_inv @ ray_2d
      l = t_inv[axis] * -1 / ray[axis]  # determine lambda
      l = tf.expand_dims(l, -1)
  
      # this is the same
      dot = ray * l + t_inv
      return dot
  
file_path: graphics/tensorflow_graphics/projects/points_to_3Dobjects/utils/tf_utils.py
imports: import numpy
  import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: compute_dot(image_size, intrinsics, extrinsics, axis, image_intersection) and returns: dot