title: Python example to create a depth map from point clouds with camera intrinsic
body: <p>I've seen plenty of opencv code in c++ about how to convert a 3d point cloud to a depth map, with camera intrinsics(matrix and with width, height, fx, fy, cx, and cy), but I have not seen any code about convert a point cloud to a depth map with python. I've tried using open3d, which works well when converting from a depth image to a point cloud, but when converting from point cloud to depth map, I get a heatmap, which randomly scales, so when I reimport from a depth map to a point cloud in open3d, the depth map is  incorrect(since I had to convert from heatmap to depthmap), and the depth map does not line up with the rgb image.
  Here is my code in open3d to convert rgb and a depthmap to a point cloud in open3d?</p>
  <pre><code>intrinsics = o3d.camera.PinholeCameraIntrinsic(640, 480 ,525.0, 525.0, 319.5, 239.5) 
  '''
  width (int) – Width of the image.
  
  height (int) – Height of the image.
  
  fx (float) – X-axis focal length
  
  fy (float) – Y-axis focal length.
  
  cx (float) – X-axis principle point.
  
  cy (float) – Y-axis principle point.
  '''
  depth_raw = o3d.io.read_image(&quot;./00000.png&quot;)
  color_raw = o3d.io.read_image(&quot;./color.jpg&quot;)
  rgbd_image = create_rgbd_image_from_color_and_depth(
      color_raw, depth_raw)
  
  pcd =  o3d.geometry.create_point_cloud_from_rgbd_image(rgbd_image, o3d.camera.PinholeCameraIntrinsic(intrinsics))
  pcd.transform([[1, 0, 0, 0], [0, -1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]]) # flips to it is right side up
  o3d.visualization.draw_geometries([pcd])
  np.savetxt(&quot;./pcd.txt&quot;, np.asarray(pcd.points))
  </code></pre>
  <p>Could someone help me out with code to project a point cloud to a depth map, in python, in either opencv or with any other library.</p>