kl3m3n's blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

3D point cloud registration in Labview using PCL - Point cloud library (C++ source code, dll, Labview example)

Klemen
Active Participant

Hello,

turns out I have a little bit more time, so the next post is here!

I am just going to paste the intro to this post from the end of the previous post titled "Kinect in Labview using PCL - Point cloud library (C++ source code, dll, Labview example)":

"My next post will be talking about point cloud registration (also in Labview using PCL). I have used ICP (iterative closest point) algorithm in one of the previous posts to align two point clouds, but no coarse alignment/registration was made prior to the refined ICP registration. So in some cases, the alignment using only ICP is incorrect (mostly for greater degree of transformation - rotation and translation - between two successively acquired point clouds)."

So for example, if you want to align the following point clouds (similar object/surface, but different position in space - so two acquired point clouds from different point of view) the ICP yields an incorrect result - in my case the algorithm does not converge:

source_target.png

Figure 1. Source point cloud/surface (gray) and the target point cloud/surface (green).

Using the feature based initial alignment (MORE INFORMATION ABOUT THE REGISTRATION AND ITS PARAMETERS etc... CAN BE OBTAINED FROM THE PCL web site, so I will not go into these details here) the result is:

source_target_sacia.png

Figure 2. Source point cloud/surface (gray), the target point ploud/surface (green) and the transformed source point cloud/surface (red) after initial alignment.

And after the initial alignment, the ICP algorithm produces the following result:

source_target_sacia+icp.png

Figure 3. Source point cloud/surface (gray), the target point ploud/surface (green) and the transformed source point cloud/surface (red) after initial alignment and ICP.

Also, the point clouds are filtered prior to registration using the MLS filter, that is not included (this is also a part of the PCL library and I use a seperate .dll for filtering). The Labview example is saved for Labview 2010.

I am attaching the source code, dll and a Labview example program. You need PCL 1.6.0 to be able to run/modify the example. The .dll was built using Visual Studio 2010x86.

Best regards,

K



https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Comments
Gyc
Member
Member

Hello.

I am dealing with a similar problem (I think).

I acquire the image of a tube with a 3D laser scanner and I need to measure the perimeter of the inner "hole". (the tubes are made of rubber, so they are not perfectly round when i measure them).

If I compute the  perimeter by adding distances from pixel to pixel of all the pixels on the edge, the "granularity" is too high and - mostly - when there are artifacts in the image (it happens quite often) the  result is completely off.

What (I think) I need is to fit an elipsoid to  the series of (x,y,z) points that are the edge of the inner diameter and subsample it to find its length.

Can this be done with the registering function? Is there a better function in PCL?

Please fell free to any other suggestion you may have.

Thanks.

Klemen
Active Participant

Hello,

currently, the PCL has no ellipsoide fit (only spherical, see here http://docs.pointclouds.org/trunk/group__sample__consensus.html )

I am not sure if 3d data registration will do the trick. Depends on your setup. Could you explain a bit more?

I have made a small program for least-squares ellipsoid fit, so if you give me some sample data (x,y,z) corrdinates of the inner edge points, I can take a look at it. Do you filter the 3d data before analysis?

Below is the example of the mentioned ellipsoide fit. The data (green points) are generated from ellipsoide with some added normal noise. The red data is the LS fit. It seems to fit well, but I have no idea about the result on real data.

FitEllipsoidLeastSquares_FP.png

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Tariff Impact Update Learn more