code: def generate_point(
      rgb_image,
      depth_image,
      intrinsic,
      subsample=1,
      world_coordinate=True,
      pose=None,
  ):
      """Generate 3D point coordinates and related rgb feature
      Args:
          rgb_image: (h, w, 3) rgb
          depth_image: (h, w) depth
          intrinsic: (3, 3)
          subsample: int
              resize stride
          world_coordinate: bool
          pose: (4, 4) matrix
              transfer from camera to world coordindate
      Returns:
          points: (N, 3) point cloud coordinates
              in world-coordinates if world_coordinate==True
              else in camera coordinates
          rgb_feat: (N, 3) rgb feature of each point
      """
      intrinsic_4x4 = np.identity(4)
      intrinsic_4x4[:3, :3] = intrinsic
  
      u, v = np.meshgrid(
          range(0, depth_image.shape[1], subsample),
          range(0, depth_image.shape[0], subsample),
      )
      d = depth_image[v, u]
      d_filter = d != 0
      mat = np.vstack(
          (
              u[d_filter] * d[d_filter],
              v[d_filter] * d[d_filter],
              d[d_filter],
              np.ones_like(u[d_filter]),
          )
      )
      new_points_3d = np.dot(np.linalg.inv(intrinsic_4x4), mat)[:3]
      if world_coordinate:
          new_points_3d_padding = np.vstack(
              (new_points_3d, np.ones((1, new_points_3d.shape[1])))
          )
          world_coord_padding = np.dot(pose, new_points_3d_padding)
          new_points_3d = world_coord_padding[:3]
  
      rgb_feat = rgb_image[v, u][d_filter]
  
      return new_points_3d.T, rgb_feat
  
file_path: ARKitScenes/threedod/benchmark_scripts/utils/tenFpsDataLoader.py
imports: import copy
  import cv2
  import glob
  import json
  import numpy
  import os
  from .box_utils import compute_box_3d, boxes_to_corners_3d, get_size
  from .rotation import convert_angle_axis_to_matrix3
  from .taxonomy import class_names, ARKitDatasetConfig
label_desc: Use image node_id 3 for calling a global function with example usage: generate_point(rgb_image, depth_image, intrinsic, subsample, world_coordinate, pose) and returns: new_points_3d,  rgb_feat