PCL - Point Cloud Library

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.

cheers!

Hi,
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.
Sana.

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.
thanks.

@angelfriend89
as your question drifts away from the focus of this thread I moved it here.
http://forum.openframeworks.cc/t/opencv-mocap-[moved]/7612/1

best!

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:
https://github.com/jvcleave/PCL-KDTREE-OF

Here is the project that I have currently working:
http://pointclouds.org/documentation/tutorials/greedy-projection.php

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

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

best!

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

bin/data/openni/config/ofxopenni_config.xml

to

/etc/primesense/SamplesConfig.xml

https://github.com/jvcleave/PCL-KDTREE-OF

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.