code: def extract_pcd(depth_image, K, color_image=None):
      """
      transform a depth image into a pointcloud (here a numpy array)
      """
  
      Z = (depth_image / 1000).ravel()
      mask_z = (Z < 6) * (Z > 0)
      X, Y = np.meshgrid(
          np.arange(depth_image.shape[1]),
          np.arange(depth_image.shape[0]),
      )
  
      Xworld = (X.ravel()[mask_z] + 0.5 - K[0, 2]) * Z[mask_z] / K[0, 0]
      Yworld = (Y.ravel()[mask_z] + 0.5 - K[1, 2]) * Z[mask_z] / K[1, 1]
  
      pcd = np.vstack((Xworld, Yworld, Z[mask_z])).T
      if color_image is None:
          return pcd
      else:
          color = color_image.reshape(-1, 3)[mask_z, :]
          return pcd, color
  
imports: import collections
  import errno
  import numpy
  import os
  import os.path
  import torch
  from torch_geometric.data import Data
  from torch_points_kernels.points_cpu import ball_query
  import imageio
  from tqdm.auto import tqdm
  from torch_points3d.core.data_transform import GridSampling3D, SaveOriginalPosId
  from torch_geometric.transforms import Compose
  import torch_points3d.datasets.registration.fusion
  from torch_cluster import fps
label_desc: Use image node_id 5 for calling a global function with example usage: extract_pcd(depth_image, K, color_image) and returns: pcd, pcd,  color