# Generate point cloud from rbg and depth image

**URL:** https://discourse.vtk.org/t/generate-point-cloud-from-rbg-and-depth-image/3563
**Category:** Support
**Created:** [June 15, 2020, 7:23pm UTC](https://discourse.vtk.org/t/generate-point-cloud-from-rbg-and-depth-image/3563 "2020-06-15T19:23:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![beginner](https://discourse.vtk.org/user_avatar/discourse.vtk.org/beginner/32/1930_2.png) [@beginner](https://discourse.vtk.org/u/beginner)
#### Post date: [June 15, 2020, 7:23pm UTC](https://discourse.vtk.org/t/generate-point-cloud-from-rbg-and-depth-image/3563/1 "2020-06-15T19:23:58Z")

</div>

I found this [vtkDepthImageToPointCloud()](https://vtk.org/doc/release/7.1/html/classvtkDepthImageToPointCloud.html) but the way I used it didn’t seem to work. Can anyone explain how to use it?

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [June 16, 2020, 12:27am UTC](https://discourse.vtk.org/t/generate-point-cloud-from-rbg-and-depth-image/3563/2 "2020-06-16T00:27:57Z")

</div>

@pieper gave a nice demo of this in 3D Slicer at a [recent developer tcon](https://discourse.slicer.org/t/2020-05-19-hangout/11605/3). If you want to acquire and display live surface scan stream from an Intel RealSense, Microsoft Kinect, etc. device using VTK then you can use this gist:

> <https://gist.github.com/pieper/05a402b38c74598f89e90670272c39a5>

The code snippet works as is in 3D Slicer but by changing a few lines you can use it in any VTK render window.
