Skip to content

Example Applications

dorian3d edited this page Oct 28, 2014 · 8 revisions

Single Test

The Single Test applications allows to run KinectFusion with Kangaroo in a single computer from one or several cameras at the same time.

Steps:

  1. Arrange one or several Kinect2 cameras in fixed positions and connect them to the same computer.

  2. Calibrate the infrared cameras of the Kinect2's at the same time. Check the Calibration documentation. Use one of these files instead of the ones generated by Vicalib to get marks for the Vicon markers: small pattern, medium pattern, large pattern.

  3. Run the SingleTest application. For example, to use two Kinect2 cameras with the calibration file cameras.xml obtained in the step 2:

     ./singletest -cam freenect2:[rgb=0,ir=0,depth=1]// -cmod cameras.xml
    

You should see the GUI application with the depth images and the reconstructed 3D volume: Single Test

  1. Activate the fuse option to run the 3D fusion. Deactivate the view only option at some moment to fully render the reconstructed scene.

Usual problems

Kangaroo makes an intensive use of the GPU, requiring a large amount of video memory. You may need to free video memory if you get an error like this:

188 MB Video Memory Available.
terminate called after throwing an instance of 'roo::CudaException'
  what():  CudaException: Unable to cudaMallocPitch
cudaError code: out of memory (2)
Abort trap: 6

These tricks have been seen to work to free video memory:

  • On Mac, activate the Automatic graphics switching option in the Energy Saver tab in System Preferences.
  • Close Google Chrome, Firefox or any other browser.
  • Plug or unplug an external screen.
  • Close the laptop lid and open it again.

SingleTest with remote cameras

This example shows how to run KinectFusion by acquiring images from cameras over the network. For that, you need two computers that are connected to the same local network.

Steps for the machine connected to the cameras:

  1. Calibrate the cameras as in the section above.

  2. Locate the HAL application CamToNode (HAL/Applications/CamToNode).

  3. Run the program:

     ./CamToNode -node camera_node -topic images -fps 30 -cam freenect2:[rgb=0,ir=0,depth=1]//
    

This will export depth images to the local network through the address camera_node/images.

Steps for the remote machine performing the 3D reconstruction:

  1. Run SingleTest wit the driver node and the cameras.xml calibration file obtained in the previous step 1:

     ./singletest -cam node://camera_node/images -cmod cameras.xml
    
  2. Use the fuse and view only options to see the output.

Clone this wiki locally