Friday, May 31, 2013

Create a Point Cloud by using the DepthToPoints Node

The DepthToPoints gizmo is used to generate a 3D point cloud from a depth pass and 3D camera. This gizmo takes the color and depth information in the image and then creates the image as a 3D point cloud. Then, you can use the points in the point cloud to line up any geometry in the 3D space. Make sure that the alpha channel of the image is not set to black. Figures 1 and Figure 2 display the color and depth information of an input image.
Figure 1
Figure 2
To generate a point cloud using DepthToPoints gizmo, you need to follow the steps given below:

Step - 1
Export a camera chan file from your 3D application.

Step - 2
Read in the input image having depth channel embedded in it; the Read1 node will be inserted into the Node Graph panel.

Step - 3
Add a DepthToPoints node from the 3D > Geometry menu; the DepthToPoints1 node will be inserted in the Node Graph panel.

Step - 4
Make a connection between the image input of the DepthToPoints1 node and Read1 node. If image contains normal data, connect it with the norm input of the DepthToPoints1 node.

Step - 5
Click on the empty area of the Node Graph panel and then add a Camera node from the 3D menu; the Camera1 node will be inserted in the Node Graph panel.

Step - 6
In the Camera tab of the Camera1 node properties panel, click on the file_menu icon; a flyout will be displayed.

Step - 7
Choose the Import chan file option from the flyout; the Chan File dialog box will be displayed. In this dialog box, navigate to the location where you saved the chan file and then select it. Next, choose the Open button from the dialog box.

Step - 8
Select the DepthToPoints1 node in the Node Graph and then press 1 to view the output in the Viewer1 panel. You will notice that point cloud is displayed in the Viewer1 panel but the position of the cloud is not proper. We need to connect the chan camera data to the DepthToPoints1 to get the correct camera angle.

Step - 9                                  
In the User tab of the DepthToPoints1 node properties panel, select the depth channel from the depth drop-down.

Step - 10
Connect the camera input of the DepthToPoints1 node with the Camera1 node; the point cloud will be displayed in the Viewer1 panel, refer to Figure 3.
Figure 3
By default, the DepthToPoints node displays the point cloud in a solid color. If you want to display the outline of the geometry in the Viewer panel, select the wireframe option from the display drop-down, refer to Figure 4.
Figure 4
Step - 11
Enter 0.1 in the point detail field; the density of the point cloud will change in the Viewer1 panel, refer Figure 5.
Figure 5
If you set the value 1 for the point detail field, all available points will be displayed in the Viewer panel. If you want to change the size of the points, enter a value in the point size field. Now, you can place a 3D geometry in the 3D space with help of the point cloud.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...