Filter to get an certain amount of points

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Filter to get an certain amount of points

MedEngineer95
Hello,

I'm a undergrad student and I'm currently working on a project, which uses
the PointCloud library.

My code generates two PointClouds of different sizes,
which in addition can vary each time I run the programm.
I.e. the sizes are not constant when running the programm several times.
For example, once they are 11.500 and 6000 the other time 10.800/7000 and so
on.
However I need both PointClouds to have the exact same size.

For example, if the size of one PointCloud is 11.500 the other one 7.000,
I have to downsample both to 5.000 without just cutting of one part of the
PointCloud.

I checked the filter classes in the documentation,
but can't really find a good solution for that problem.
Maybe I have to take a break, in order to have a clear mind again tomorrow,
however if someone has a good idea or can tell me which filter to use, I
would really appreciate it.:)

Thanks






--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Filter to get an certain amount of points

Richard Frank
What is your input? A camera or a file/s?

What is the desired outcome?

If the points represent the “same” data, I would think about registration between the two clouds and delete the points that have no correspondences. Not sure if there’s anything out of the box that will do this.

Rick Frank

> On Jan 28, 2018, at 3:11 PM, MedEngineer95 <[hidden email]> wrote:
>
> Hello,
>
> I'm a undergrad student and I'm currently working on a project, which uses
> the PointCloud library.
>
> My code generates two PointClouds of different sizes,
> which in addition can vary each time I run the programm.
> I.e. the sizes are not constant when running the programm several times.
> For example, once they are 11.500 and 6000 the other time 10.800/7000 and so
> on.
> However I need both PointClouds to have the exact same size.
>
> For example, if the size of one PointCloud is 11.500 the other one 7.000,
> I have to downsample both to 5.000 without just cutting of one part of the
> PointCloud.
>
> I checked the filter classes in the documentation,
> but can't really find a good solution for that problem.
> Maybe I have to take a break, in order to have a clear mind again tomorrow,
> however if someone has a good idea or can tell me which filter to use, I
> would really appreciate it.:)
>
> Thanks
>
>
>
>
>
>
> --
> Sent from: http://www.pcl-users.org/
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Filter to get an certain amount of points

MedEngineer95
Hey thanks for replying.

One input is camera the other one a file.
Both inputs are not the same though.
Thus the registration won't do it.

I actually want to do a registration with Coherent Point Drift.
However for that I need same sized matrices.






--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Filter to get an certain amount of points

Richard Frank
So you need a non rigid registration. Sounds to me like you would need some prior knowledge of the data- are the points around the centroid of each set the most reliable? If so take some equal number of points some normalized distance from the centroid of each cloud and drop all the rest and run this points thru the registration. Other than that, I’m not sure how you could decide which points to drop.

Rick Frank

> On Jan 28, 2018, at 4:04 PM, MedEngineer95 <[hidden email]> wrote:
>
> Hey thanks for replying.
>
> One input is camera the other one a file.
> Both inputs are not the same though.
> Thus the registration won't do it.
>
> I actually want to do a registration with Coherent Point Drift.
> However for that I need same sized matrices.
>
>
>
>
>
>
> --
> Sent from: http://www.pcl-users.org/
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Filter to get an certain amount of points

Sérgio Agostinho

Covariance Sampling might help.

"Point Cloud sampling based on the 6D covariances.

It selects the points such that the resulting cloud is as stable as possible for being registered (against a copy of itself) with ICP. The algorithm adds points to the resulting cloud incrementally, while trying to keep all the 6 eigenvalues of the covariance matrix as close to each other as possible. This class also comes with the computeConditionNumber method that returns a number which shows how stable a point cloud will be when used as input for ICP (the closer the value it is to 1.0, the better).

"

Cheers


On 28-01-2018 22:23, Richard Frank wrote:
So you need a non rigid registration. Sounds to me like you would need some prior knowledge of the data- are the points around the centroid of each set the most reliable? If so take some equal number of points some normalized distance from the centroid of each cloud and drop all the rest and run this points thru the registration. Other than that, I’m not sure how you could decide which points to drop.

Rick Frank

On Jan 28, 2018, at 4:04 PM, MedEngineer95 [hidden email] wrote:

Hey thanks for replying.

One input is camera the other one a file.
Both inputs are not the same though.
Thus the registration won't do it.

I actually want to do a registration with Coherent Point Drift.
However for that I need same sized matrices.






--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users


_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Filter to get an certain amount of points

MedEngineer95
This post was updated on .
Thanks for replying.
I tried to use Covariance Sampling,
however I get a Linking error LNK2001: unresolved external symbol "" in the applyFilter() function.
I just use it like any other filter.

I build in release x64 mode and installed the x64 installer of pcl 1.8.0,
so it can't have to do with that.

That's my code snippet.

#include <pcl/filters/covariance_sampling.h>

pcl::CovarianceSampling<pcl::PointXYZ, pcl::PointXYZ> csFilter;
csFilter.setInputCloud(pointCloud);
csFilter.setNumberOfSamples(5000);
csFilter.filter(*pointCloud);

All other PCL classes I use work without any problems.


--
Sent from: http://www.pcl-users.org/
_______________________________________________
PCL-users@pointclouds.org / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Filter to get an certain amount of points

MedEngineer95
I found a solution:  RandomSample Filter!!!

http://docs.pointclouds.org/1.8.1/classpcl_1_1_random_sample.html

Thank you guys though for replying and taking your time:)



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users