PCL - Point Cloud Library

I did that.
And it compiles, starts running an initializing the OpenNI modules but at some point it crashes.
Have you encountered any problems of that kind?
Besides, in the openNI site it says that a modified OpenNI and Primesens libs should be installed so PCL can run with the Kinect. Did you install these mod’d libs or did you use a newer version.
I ask becaause I tryed it with the OpenNI provided libs and with the newest OpenNI libs.
In both cases it failed to work.

So far I haven’t been able to test what you posted before. I’d beed ultra busy.

best

@roymacdonald can you post your console output when it crashes?

I am using this without openni installed on the system. I am actually using gameoverhack’s ofxOpenNI openni libs from his experimental branch. I did mod these with the change_exec_paths script so PCL correctly sourced them at runtime.

had a typo in previous post SampleConfig.xml should be SamplesConfig.xml

This is a really interesting project. I’m writing a library for primitive shape detection in point clouds, and PCL is the obvious approach. Got it compiling and running in oF, but the kinect data is handled with some middleware methods I wrote to map ofxopenni data to pcl::pointcloud. It works, but I want to use pcl::opennigrabber.

So far, everything compiles fine, but I hit this in the console:

Init lib_usb control of Kinect Motor, LEDs and accelerometersCreating OpenNIDevice
Open failed: File not found!
node depth problems
node image problems
node ir problems

Any idea what file it’s looking for (think only XnOS.h throws that)? Can’t find any reference in the debugger. I do have SamplesConfig.xml in the right spot, as per http://pointclouds.org/documentation/tutorials/compiling-pcl-macosx.php#compiling-pcl-macosx

Got it to work. My console looks like this now (using http://pointclouds.org/documentation/tutorials/openni-grabber.php sample):

Init lib_usb control of Kinect Motor, LEDs and accelerometersCreating OpenNIDevice
Warning: USB events thread - failed to set priority. This might cause loss of data…
node ir problems
distance of center pixel :1.777 mm. Average framerate: 17.747 Hz
distance of center pixel :1.795 mm. Average framerate: 18.174 Hz
distance of center pixel :1.814 mm. Average framerate: 17.2978 Hz
distance of center pixel :0.511 mm. Average framerate: 17.0666 Hz
distance of center pixel :0.49 mm. Average framerate: 19.1783 Hz
distance of center pixel :0.486 mm. Average framerate: 17.5537 Hz
distance of center pixel :0.513 mm. Average framerate: 18.0526 Hz
distance of center pixel :0.561 mm. Average framerate: 17.9862 Hz

I needed to upgrade my libusb and openni libraries as per http://pointclouds.org/downloads/macosx.html I think the modified openni libs are essential, but I’ll dig around some more to make sure.

Since the release of PCL 1.4.0 I gave this another shot on a clean system that is working with the latest OpenNI/Kinect. This time I went the route of installing OpenNI on the system as opposed to trying to use self-contained libs

It’s a bit of a mess and I would like to get it into a separate project that is included (like the OF project) but is currently working with the openGrabber Example

https://github.com/jvcleave/example-PCL-1-4-0

great I will give it a try.

Awesome. I wasn’t brave enough to download it yet. This will actually be a good opportunity to start brand new, and even fork off into another branch.

I’ve been successful using openniGrabber, but the code is messy and my links/headers need to be cleaned up. Regardless, PCL is relatively fast at things operations like SACSegmentation and can even work real-time with the right downsampling.

Here’s real-time plane segmentation (holding up a book)…

https://plus.google.com/u/0/photos/111647573513369634114/albums/5696432199179382113/5696432203521978770

There are a couple of ofxPCL projects on http://ofxaddons.com/ worth looking into

I’ve got Arturo’s example working with a few tweaks (my develop branch) and will try satoruhiga’s as well

I couldn’t get OpenMP to work nicely with some of the feature detectors he was using. Might try again, but my next step will be to get this tutorial to work: http://pointclouds.org/documentation/tutorials/template-alignment.php

Also, I got pcl::apps::DominantPlaneSegmentation to run, but it was far too slow for real-time (like 1fps on an i7 MBP). Let me know if you play with that example. Would be interesting to compare results.

Sure - feel free to send me anything as I am mostly testing the features to see what is working. gmail is jvcleave

So tried this on another machine today and kept getting “OpenNi Error!, No file found!”

Apparently it needs these particular files

https://github.com/jvcleave/example-PCL-1-4-0/tree/master/COPY-CONTENTS-TO-etc/openni

in /etc/openni (as opposed to /etc/primesense which is the OpenNI default)

Looking back this is probably what stopped my PCL_1-3-0 version to stop working with OpenNI. I am guessing these files are created when PCL is compiled

did any one get this working with xcode?
it looks like the point cloud library is super power, once one gets it working.

thx, stephan.

yes it works, i’m on lion
i grabbed this https://github.com/satoruhiga/ofxPCL alongside ofxBoost, copy pasted i think the planarsegmentation sample from pointclouds site /verbatim/ and it worked on the first run

i have no idea, however, which version of PCL was compiled / but considering the current one ( 1.5.1 ) does not even compile for me from their sources on lion with clang, it’s much better than nothing ) /

i also tried to compile pcl for iOS but no luck so far

edit: i have no idea also whether e.g. OpenNI is there, but presumably not since only boost is as a dependency

thanks for the info. seems to compile fine for me too.
there are a few ofxPCL approaches out there and i got lost in all the different ones.

i hope i can get the ICP (iterative closest point) algorithm to work.

thx.

i worked with this now for a few days and it does compile and run fine.
i was not really successful with getting good results on the ICP thing. (matching two point clouds and getting a transformation matrix)

i found this tutorial on “How to incrementally register pairs of clouds”
http://pointclouds.org/documentation/tutorials/pairwise-incremental-registration.php#pairwise-incremental-registration

but it requires pcl_visualizer which is not part of satoruhiga/ofxPCL

does anyone know if pcl 1.3 comes with pcl_visualizer?
or will i have to get 1.4 or 1.5 to work. which seems difficult judging from jvcleave attempts.

thx

pcl_visualizer is basically a QT based front end. It is packaged with PCL but I would think you could do the calculations without it and display in OF (with an addon like ofxPCL)

PCL moves so fast that by the time I had updated the libs/packaging they had already released another version. The way I feel about it now is that the best approach is to just use an addon like satoruhiga’s but require PCL libs to be installed on the machine.

Ok, so I’m diving back into this. I’ve gotten HEAD of PCL to compile via SuperBuild: pcl-developers.org/A-SuperBuild-for-PCL-tp5706899.html And I’ve also gotten https://github.com/satoruhiga/ofxPCL to compile with a really basic example (just loads a pcd file in, converts it to a mesh and displays it). As of this writing PCL HEAD is coming up on 1.6 pretty soon. There are a bunch of advances in PCL that I’d like to incorporate into ofxPCL (especially the Poisson surface reconstruction stuff), but first I’m struggling to get my arms around using ofxPCL with OF.

Here’s my example:

https://github.com/atduskgreg/of-pcl-example

I’m trying to add normal estimation, triangulation, and moving least squares, but I’m getting hung-up on how to deal with the templated point cloud types (see the commented lines in my setup function: https://github.com/atduskgreg/of-pcl-example/blob/master/src/testApp.cpp).

normalEstimation() takes a “cloud” and and “output_cloud_with_normals”. I’m having a hard time constructing the right types to be sent to this function. I tried to create a PointNormalPointCloud thusly:

PointNormalPointCloud normalBunny = create();

and pass that along with the PointCloud. This seems to work for normalEstimation, but the call to convert() inside of triangulate() then fails with a linker error thusly:

Undefined symbols for architecture i386:
“void ofxPCL::convert<boost::shared_ptr<pcl::PointCloudpcl::PointNormal >, ofMesh>(boost::shared_ptr<pcl::PointCloudpcl::PointNormal > const&, ofMesh&)”, referenced from:
ofMesh ofxPCL::triangulate<boost::shared_ptr<pcl::PointCloudpcl::PointNormal > >(boost::shared_ptr<pcl::PointCloudpcl::PointNormal > const&, float)in testApp.o

I’m not 100% up to speed with Boost shared_ptr stuff (especially with how to handle it in a complex templated setup like this).

Would love some help with this. I understand the basic PCL concepts so if I can just get a grasp on moving between PCL and OF types, I think I can build out some nice examples. And then I’ll focus on upgrading ofxPCL to a more recent release of PCL, which will open up a bunch of the awesome surface reconstruction work they’ve done recently.

Hey Greg,

Are you able to use anything boost? Mostly wondering if it is compiled as 32 bit.

Hi guys,

I tried recently ofxPCL and it is working nicely with ofxKinect but as all features of PCL are not included in the addon, I have been trying to compile the latest version of PCL.
I found this tutorial on PCL website: http://www.pcl-users.org/file/n4023824/PCL-Development-Build—Mac-OS-X-%2815-Nov-2012%29.pdf

I have compiled successfully PCL on my mac mini (osx 10.7) but then problems arise when using it with OF: having architecture problem as I understand OF has been compiled for 32 bits.

So now I tried to compile PCL and other dependencies for 32 bits architecture but I am quite struggling with it.

Also I was wondering looking here: http://pointclouds.org/downloads/macosx.html
Since those are pre-compiled universal binaries, installing those right out of the box and then in OF linking against each of them should do the trick or … what?