PCL - Point Cloud Library

This could be useful:

The Point Cloud Library (or PCL) is a large scale, open project for point cloud processing.

The PCL framework contains numerous state-of-the art algorithms including filtering, feature estimation, surface reconstruction, registration, model fitting and segmentation.


totally, especially this http://pointclouds.org/documentation/tutorials/planar-segmentation.php#planar-segmentation

it automatically detects planes. could be useful for planar projection mapping, or plane tracking.

and this looks great as well: http://pointclouds.org/documentation/tutorials/resampling.php#moving-least-squares

really nice technique for generating smooth normals.

Hey, this looks great.
I’m getting to understand how this library works and I pretend to convert it into an addon.
Any help would be really appreciated.

I started looking at this as well, but compiling the PCL libs requires boost, which means they’d need to a be compiled as a monolithic .a and might have some interoperability problems calling into it w/o access to boost classes http://www.pointclouds.org/downloads/source.html :confused:

Ok, so the precompiled binaries for OSX were not built with openNI support, since the kinect is my main pointcloud capture device I wanted PCL to hace OpenNI support, yet several dependencies need to be compiled specially for this.
First, i’ll asume that OpenNi, NITE and avin2’s kinectdriver have been installed correctly (usually at /usr/local).
Then VTK 5.9 needs to be compiled and installed with the COCOA and CARBON set OFF and X11 set ON. this are not the default compiling parameters.
then you’ll need to install (easily through Macports) the latest wxWidgets.
$ sudo port install wxwidgets-devel
otherwise you’ll get an error when compilling in 64 bits arch.
After all this run ccmake for PCL and check for the correct include dirs for the stuff aforementioned.
I also had to create a symbolic link to usblib, as I installed it with macports, and the compiler was looking for it in /usr/lib instead of /opt/local/lib where macports installs stuff.

After all this PCL with openni support compiled correctly. So now I’ll try to get stuff running with OF.
I’ll let you know of any improvements ASAP.


There’s a Boost library for ofx:

You might want to look at the nestk library. I found it today. It allows you to interface with PCL.


going to give this a shot - hit me up if you have tried or have any insights

seems the tricky part is going to get all the dependencies to 32 bit versions

i’ve gotten it to compile in OSX and ubuntu. it was much easier on ubuntu. the main problem i had was that once it was compiled, the demos weren’t working at all on OSX. and i was running ubuntu in a VM so the graphics acceleration might have been crashing it there.

that was a few months ago. they’re moving really fast. good luck!

ok - I think I have most things down to 32 bit and started to bring them into OF

I am using the nestk route for now. I am hung up on this error:

/usr/include/c++/4.2.1/ctime:68:0 /usr/include/c++/4.2.1/ctime:68: error: '::tm' has not been declared  

From my searching it seems that this is caused by ntk having a class named time.h. It is however in a ntk namespace so I am thinking I need some sort of XCode flag set or forward declaration trick or possibly a framework added in order for it to use the correct one?

 In file included from /usr/include/c++/4.2.1/cwchar:52,  
                 from /usr/include/c++/4.2.1/bits/postypes.h:46,  
                 from /usr/include/c++/4.2.1/iosfwd:49,  
                 from /usr/include/c++/4.2.1/bits/stl_algobase.h:70,  
                 from /usr/include/c++/4.2.1/algorithm:65,  
                 from addons/ofxOpenCv/libs/opencv/include/opencv2/core/core.hpp:56,  
                 from addons/ofxOpenCv/libs/opencv/include/opencv/cxcore.h:51,  
                 from addons/ofxNestk/include/ntk/core.h:25,  
                 from /Volumes/WORK_IN_PROGRESS/OPENFRAMEWORKS/007/openFrameworks/apps/jvcApps/NestkTest/addons/ofxNestk/include/ntk/utils/time.h:23,  
                 from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:26,  
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:20,  
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h:20,  
                 from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,  
                 from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20:  
/usr/include/c++/4.2.1/ctime:68: error: '::tm' has not been declared  
/usr/include/c++/4.2.1/ctime:70: error: '::clock' has not been declared  
/usr/include/c++/4.2.1/ctime:71: error: '::difftime' has not been declared  
/usr/include/c++/4.2.1/ctime:72: error: '::mktime' has not been declared  
/usr/include/c++/4.2.1/ctime:73: error: '::time' has not been declared  
/usr/include/c++/4.2.1/ctime:74: error: '::asctime' has not been declared  
/usr/include/c++/4.2.1/ctime:75: error: '::ctime' has not been declared  
/usr/include/c++/4.2.1/ctime:76: error: '::gmtime' has not been declared  
/usr/include/c++/4.2.1/ctime:77: error: '::localtime' has not been declared  
/usr/include/c++/4.2.1/ctime:78: error: '::strftime' has not been declared  

I would post the project but I still have a lot of dependencies that are on my system

I still don’t try nestk, I’d like to do so, maybe this weekend and see how it goes.

As for PCL I gave up, at least making it work with the kinect and trying to compile its examples.
I really don’t remember which errors the compilation threw, it was some time ago, but I can see that theres a new version of PCL and that the kinect issues were fixed.

I’ll post any improvements.


I am using libfreenect drivers with C language on linux platform.My task is to find x,y,z coordinates of the markers placed on a human body joints which will be detected by kinect sensors i.e x,y coordinates from rgb camera of kinect and z from depth sensor of kinect.Can any one tell me how to use pcl library for finding out x,y,z coordinates of markers with opencv and Point cloud library.Waiting for your urgent help.
Thanks in advance.

Hi, do you really need markers? I assume that this is for doing MoCap.
Because otherwise try OpenNI, and you will get automatically the joint coordinates.
On the other hand, PCL is not designed to track markers.
You can do everything you need with OpenCV, from capturing the kinect rgb and depth data, to tracking the markers. Make sure you enable the registervieport method so the rgb and depth images coincide.
For tracking infrared illumination should work better, and using infrared reflective markers.

Good luck with it!

BTW, for everyone else.

Yesterday I compiled PCL 1.2 on my mac, in fact there are some really neat instructions for doing so, but I was unable to capture data from the kinect with the demos provided.
When running them, after doing the usual OpenNI inicialization the program crashed with a segmentation fault.
The strange thing is that on PCL’s site it says that you need to install a patched version of OpenNI and the Primesense driver, that were buid from version 1.1 which is quite old. Maybe that is generating the problems.
I’ll insist on it later this week and let you know how it goes.

Yes I am doing Mocap but i dont want markers.Actually i have already used opencv algorithm to detect and track markers and that is done.My next step is to extract the x,y,z coordinates of the moving markers for which i think we can use PCL library and opencv but i dont know what functions will be used to extract x,y from rgb and z from depth.Or can u tel me any other way to find x,y,z coordinates rather than pcl library.Moreover,can u elaborate what is register viewport and how to do it with libfreenect. Actually,i am very new to opencv, computer vision and kinect so i need your help.

as your question drifts away from the focus of this thread I moved it here.


I appear to have PCL 1-2 compiled and working in OF. Fingers crossed I have all the dependencies/libraries included to where they will work on another machine.

You can follow on github:

Here is the project that I have currently working:

Warning - it is pretty massive - around 900MB. about 140MB

Downloading it right now.
Did yo try using the kinect with your compilation of PCL?


I haven’t

update: Got the openni stuff compiling/running. As PCL 1-2 has a hardcoded path for macs you currently have to copy