-
Notifications
You must be signed in to change notification settings - Fork 3
Example Applications
The Single Test applications allows to run KinectFusion with Kangaroo in a single computer from one or several cameras at the same time.
Steps:
-
Arrange one or several Kinect2 cameras in fixed positions and connect them to the same computer.
-
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.
-
Run the SingleTest application. For example, to use two Kinect2 cameras with the calibration file
cameras.xmlobtained 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:

- Activate the
fuseoption to run the 3D fusion. Deactivate theview onlyoption at some moment to fully render the reconstructed scene.
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 switchingoption in theEnergy Savertab inSystem Preferences. - Close Google Chrome, Firefox or any other browser.
- Plug or unplug an external screen.
- Close the laptop lid and open it again.
These examples shows how to run KinectFusion by acquiring images from cameras over the network. For that, you need several computers connected to the same local network.
In this example, we suppose there is an auxiliary computer with one or several computers connected to it and a master computer that performs the 3D reconstruction.
-
Calibrate the cameras as in the section above.
-
Locate the HAL application
CamToNode(HAL/Applications/CamToNode). -
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.
-
Run SingleTest with the driver
nodeand thecameras.xmlcalibration file obtained in the previous step 1:./singletest -cam node://camera_node/images -cmod cameras.xml -
Use the
fuseandview onlyoptions to see the output.
In this example, we suppose there is several auxiliary computers with one or several computers connected to them and a master computer that performs the 3D reconstruction.
Before going on, calibrate the remote cameras to generate a cameras.xml file.
-
Run the
CamToNodeprogram, changing the node namecamera_ito an unique name, e.g.camera_1,camera_2, etc:./CamToNode -node camera_i -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_i/images.
-
Run SingleTest with the
joindriver to join severalnodedrivers and with thecameras.xmlcalibration file obtained before. For example, if there are two auxiliary computers publishing images, you may do:./singletest -cam "join://node://camera_1/images&node://camera_2/images" -cmod cameras.xml
You can concatenate as node drivers as necessary for any arbitrary number of auxiliary computers by separating them with the & character. Note that the value of the -cam argument must be between quotes to escape the &.
- Use the fuse and view only options to see the output.