Introduction
Recently, I bought a second Xtion Pro Live. In this page I describe a multi-viewer which captures images simultaneously from two devices. The viewer derives a 3D point cloud from a depth image, and displays it with corresponding colors obtained from an RGB image using the OpenGL.Development Environment
- iMac
- Mac OS X 10.8.1
- Processor:3.06GHz Intel Core 2 Duo
- Memory:4GB
- Xcode4.4.1
Primary Libraries
- Boost
- OpenNI
- OpenGL
Source Code
Here is my source code. I confirmed that it works well on my machine.Compile Options
Header Search Path:Path | Purpose |
---|---|
/usr/include/ni/ | to include the OpenNI headers |
/opt/local/include/ | to include the Boost headers |
Library Search Path:
Path | Purpose |
---|---|
/opt/local/lib | to link with the Boost libraries |
To use the OpenGL, I also set "
-framework OpenGL
" and "-framework GLUT." More detailed information is in my source code.
Usage
An executable file name is "OpenNiMultiViewer
." Running it with an argument --help
, it prints the following statements.
After connecting two devices with the computer, running it without any arguments, it opens two viewers for images captured by devices.
To quit the application, type an escape key under the situation where the application focuses on viewers.
Addition
- To change the number of devices, you have to extend my code.
- My application paints white color in the region where the device is unable to take the depth.
- The Xtion Pro Live uses infrared ray to take the depth. If there is more than one device, the number of regions where the devices are unable to take the depth increases because of interference between infrared rays.
0 件のコメント:
コメントを投稿