strange effect of the downsampling

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

strange effect of the downsampling

Mauro Bellone
Dear All,
I'm working on the registration of a large number of point cloud, and I noticed a strange effect of the downsampling filter.  
Preface that all my clouds are already downsampled before of the registration process and everything works good.
Btw I want to align many point clouds (over than 1 thousand) and during the mapping I downsample every aligned cloud in order to avoid overlapped points and save memory usage but during the mapping I can see a confused result (the leaf size is the same).
Below you can see an example of this effect

Num. A - 1

Num. A - 2

Num. A - 3

Num. A - 4


here there are the same clouds aligned by GICP and mapped without the downsampling filter on the complete cloud, so I think that the alignment accuracy could be good for my application but the downsampling filter produce an undesired effect

Num. B - 1

Num. B - 2

Num. B - 3

Num. B - 4


I would like to know how can I avoid this effect, I already tried also a statistical outlier removal but the results are not good.
Thanks
Mauro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

y666
MB> Dear All,
MB> I'm working on the registration of a large number of point cloud, and I
MB> noticed a strange effect of the downsampling filter.  
MB> Preface that all my clouds are already downsampled before of the
MB> registration process and everything works good.
MB> Btw I want to align many point clouds (over than 1 thousand) and during the
MB> mapping I downsample every aligned cloud in order to avoid overlapped points
MB> and save memory usage but during the mapping I can see a confused result
MB> (the leaf size is the same).
MB> Below you can see an example of this effect

MB> http://www.pcl-users.org/file/n3857829/52.png 

MB> http://www.pcl-users.org/file/n3857829/40.png 

MB> http://www.pcl-users.org/file/n3857829/29.png 

MB> http://www.pcl-users.org/file/n3857829/43.png 


MB> here there are the same clouds aligned by GICP and mapped without the
MB> downsampling filter on the complete cloud, so I think that the alignment
MB> accuracy could be good for my application but the downsampling filter
MB> produce an undesired effect

MB> http://www.pcl-users.org/file/n3857829/23.png 

MB> http://www.pcl-users.org/file/n3857829/01.png 

MB> http://www.pcl-users.org/file/n3857829/59.png 

MB> http://www.pcl-users.org/file/n3857829/09.png 


MB> I would like to know how can I avoid this effect, I already tried also a
MB> statistical outlier removal but the results are not good.
MB> Thanks
MB> Mauro

MB> --
MB> View this message in context:
MB> http://www.pcl-users.org/strange-effect-of-the-downsampling-tp3857829p3857829.html
MB> Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com.
MB> _______________________________________________
MB> [hidden email] / http://pointclouds.org
MB> http://pointclouds.org/mailman/listinfo/pcl-users

Do You use VoxelGrid?
Which version of PCL?
Post min / max of X, Y and Z dimensions of point clouds and leaf size
You're using, please.

---------------------------------------

Białym śniegiem zimą
Górą i doliną
Mrozem i kolędą
Tym dla ciebie będę
Będę ciepłem lata
Lepszą stroną świata
Będę kiedy jesień
Babie lato niesie

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

Mauro Bellone
Yes! I use voxel grid. Leaf size = 0.01. My version of PCL is 1.5.1 (some times I also use some file from the trunk)
this is the simple part of my code.

pcl::VoxelGrid<pcl::PointXYZRGB> ds;  //create downsampling filter
  ds.setInputCloud (complete_map);
  ds.setLeafSize (0.01, 0.01, 0.01);
  ds.filter (*complete_map);

Btw, I have a funtion and I always use the same with every point cloud in my code. Every time it works.
My clouds have been acquired by a kinect camera and downsampled with the same leaf size.
I have this strange effect only when I align point clouds.
I hope these information will help.

Mauro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

y666
MB> Yes! I use voxel grid. Leaf size = 0.01. My version of PCL is 1.5.1 (some
MB> times I also use some file from the trunk)
MB> this is the simple part of my code.

MB> pcl::VoxelGrid<pcl::PointXYZRGB> ds;  //create downsampling filter
MB>   ds.setInputCloud (complete_map);
MB>   ds.setLeafSize (0.01, 0.01, 0.01);
MB>   ds.filter (*complete_map);

MB> Btw, I have a funtion and I always use the same with every point cloud in my
MB> code. Every time it works.
MB> My clouds have been acquired by a kinect camera and downsampled with the
MB> same leaf size.
MB> I have this strange effect only when I align point clouds.
MB> I hope these information will help.

MB> Mauro


MB> --
MB> View this message in context:
MB> http://www.pcl-users.org/strange-effect-of-the-downsampling-tp3857829p3859183.html
MB> Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com.
MB> _______________________________________________
MB> [hidden email] / http://pointclouds.org
MB> http://pointclouds.org/mailman/listinfo/pcl-users

Calculate minimum and maximum of each (separately) of dimensions
(X,Y,Z) and post it.
Are You application 32 bit?

---------------------------------------

Białym śniegiem zimą
Górą i doliną
Mrozem i kolędą
Tym dla ciebie będę
Będę ciepłem lata
Lepszą stroną świata
Będę kiedy jesień
Babie lato niesie

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

Mauro Bellone
All my clouds are prefiltered in a passthrough filter in order to avoid noisy data (z= [0, 5m]). And my application run in 32bit. In the case that I proposed every cloud has been transformed with a transformation matrix by

pcl::transformPointCloud(*cloud, *cloud, transformation);

You can see values bigger then 5 meter because of the transformation matrix, my robot is going ahead in the z direction so in order to align the new clouds with the first one is correct that z_max increase (but not too much cause of the wall in front).
 
Btw, in according with the scenario of the previous images the values are:

MAX1 = 1.04657     0.401563   5.15644  
MIN1 = -1.35197    -1.93015     0.844462


MAX2 = 1.04657     0.40511      5.15644
MIN2 = -1.35197     -1.93015     0.844462  


MAX3 = 1.63723      0.40511    5.20991
MIN3 = -1.35197     -1.93015   0.844462

Thanks.
Mauro

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

y666
In reply to this post by Mauro Bellone
Weird. Sounds like a bug. Can You post one point cloud, so i could try it at home and see what is happening?


W dniu 2012-03-27 11:55:36 użytkownik Mauro Bellone <[hidden email]> napisał:

> All my clouds are prefiltered in a passthrough filter in order to avoid noisy
> data (z= [0, 5m]). And my application run in 32bit. In the case that I
> proposed every cloud has been transformed with a transformation matrix by
>
> pcl::transformPointCloud(*cloud, *cloud, transformation);
>
> You can see values bigger then 5 meter because of the transformation matrix,
> my robot is going ahead in the z direction so in order to align the new
> clouds with the first one is correct that z_max increase (but not too much
> cause of the wall in front).
>  
> Btw, in according with the scenario of the previous images the values are:
>
> MAX1 = 1.04657     0.401563   5.15644  
> MIN1 = -1.35197    -1.93015     0.844462
>
>
> MAX2 = 1.04657     0.40511      5.15644
> MIN2 = -1.35197     -1.93015     0.844462  
>
>
> MAX3 = 1.63723      0.40511    5.20991
> MIN3 = -1.35197     -1.93015   0.844462
>
> Thanks.
> Mauro
>
>
>
> --
> View this message in context: http://www.pcl-users.org/strange-effect-of-the-downsampling-tp3857829p3860871.html
> Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com.
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
>




--
--------------------------------

Białym śniegiem zimą
Górą i doliną
Mrozem i kolędą
Tym dla ciebie będę
Będę ciepłem lata
Lepszą stroną świata
Będę kiedy jesień
Babie lato niesie
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

Mauro Bellone
Here you can download a zip with the clouds:

http://www.mediafire.com/?2mmzbm74o4rwrop

File:
cloud.bin                           ====   is my results after a registration process
cloud_downsampled.bin     ====    is my result after downsampling

there are also two screenshot of the clouds (downsampled and not).

The file cloud.bin is composed by registered 11 clouds, the length of the path is 1.48meters (about 1 cloud every 15cm), the accuracy of the alignment is about 5cm. I thought that the voxel grid could be influenced by the dispersion of the points.
Here there is the part of my code that generate the clouds. As you can see it is very simple.

if (pcl::console::find_argument (argc, argv, "-d") >= 0)
   {
     if (argc<2)
     {
       std::cout << " Argument not recognized !!! " <<std::endl;
     }
     else
     {
       image_cloud1=single_pcl_reader(image_cloud, argv[2]);
     }
     std::cerr << "Viewer starting ...." << std::endl;
     w.writeBinary<pcl::PointXYZRGB> ("../Exp_data/cloud.bin", *image_cloud);
     pcl::VoxelGrid<pcl::PointXYZRGB> ds;
     ds.setInputCloud (image_cloud);
     ds.setLeafSize (0.01, 0.01, 0.01);
     ds.filter (*image_cloud);
     w.writeBinary<pcl::PointXYZRGB> ("../Exp_data/cloud_downsampled.bin", *image_cloud);
     return 0;
   }

Cheers
Mauro
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

y666
You cant filter cloud in place with VoxelGrid. You - in general -
shouldnt use "in-place" behaviour, unless documentation specifically
states its allowed.

Use something like this:

(...)
pcl::PointCloud<pcl::PointXYZRGB>::Ptr res(new pcl::PointCloud<pcl::PointXYZRGB>);
ds.setInputCloud (image_cloud);
ds.setLeafSize (0.01, 0.01, 0.01);
ds.filter (*res);
w.writeBinary<pcl::PointXYZRGB>("../Exp_data/cloud_downsampled.bin",*res);
(...)


---------------------------------------

Białym śniegiem zimą
Górą i doliną
Mrozem i kolędą
Tym dla ciebie będę
Będę ciepłem lata
Lepszą stroną świata
Będę kiedy jesień
Babie lato niesie

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

clockwise9
I'd be interested in knowing if the VoxelGrid filter introduces errors when doing registration?  VoxelGrid computes the averages of points, resulting in a slightly different cloud.

Thanks!
Justin

On Tue, Mar 27, 2012 at 11:06 PM, Radosław Cybulski <[hidden email]> wrote:
You cant filter cloud in place with VoxelGrid. You - in general -
shouldnt use "in-place" behaviour, unless documentation specifically
states its allowed.

Use something like this:

(...)
pcl::PointCloud<pcl::PointXYZRGB>::Ptr res(new pcl::PointCloud<pcl::PointXYZRGB>);
ds.setInputCloud (image_cloud);
ds.setLeafSize (0.01, 0.01, 0.01);
ds.filter (*res);
w.writeBinary<pcl::PointXYZRGB>("../Exp_data/cloud_downsampled.bin",*res);
(...)


---------------------------------------

Białym śniegiem zimą
Górą i doliną
Mrozem i kolędą
Tym dla ciebie będę
Będę ciepłem lata
Lepszą stroną świata
Będę kiedy jesień
Babie lato niesie



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

Mauro Bellone
In reply to this post by y666
The part of code that I sent you is just an example that explain the behavior but in the complete application I don't save the cloud in the disk every time. Effectiveness the "in place" behavior is not well, but in my application I register many clouds and I update a complete map step by step. Having another cloud to use as a "sink" and to exchange them every iteration need time (and memory) and my application became slower.
What do you think?
M.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

Mauro Bellone
In reply to this post by clockwise9
In general the voxelGrid introduce quantization error (like every sampling process) and this will be reflected on the registration. From the mapping point of view this could be not too bad because the object look like almost the same if the accuracy of the registration is good (the sampling process introduce a little bit of smoothing of the surfaces) but in case of localization the quantization error lead a loos of certainty in the position estimation (this is bad). Moreover I noticed that it increase during the steps of registration in case of many clouds.
I hope this will help.
M.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

y666
In reply to this post by Mauro Bellone
Use PointCloud<...>::Ptr and exchange pointers.
Also You dont really have any choice, VoxelGrid will not process the cloud in place.


W dniu 2012-03-28 10:58:30 użytkownik Mauro Bellone <[hidden email]> napisał:

> The part of code that I sent you is just an example that explain the behavior
> but in the complete application I don't save the cloud in the disk every
> time. Effectiveness the "in place" behavior is not well, but in my
> application I register many clouds and I update a complete map step by step.
> Having another cloud to use as a "sink" and to exchange them every iteration
> need time (and memory) and my application became slower.
> What do you think?
> M.
>
> --
> View this message in context: http://www.pcl-users.org/strange-effect-of-the-downsampling-tp3857829p3863960.html
> Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com.
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users
>

--
--------------------------------

Białym śniegiem zimą
Górą i doliną
Mrozem i kolędą
Tym dla ciebie będę
Będę ciepłem lata
Lepszą stroną świata
Będę kiedy jesień
Babie lato niesie
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

Mauro Bellone
It is exactly what I did ... it works good.
Thanks very much for your help.
Mauro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

dilyan
In reply to this post by y666


Hello,

in on of the tutorials - Applications -> Aligning object templates to a point cloud we have a section showing this in-place filtering with VoxelGrid:

  // ... and downsampling the point cloud
  const float voxel_grid_size = 0.005f;
  pcl::VoxelGrid<pcl::PointXYZ> vox_grid;
  vox_grid.setInputCloud (cloud);
  vox_grid.setLeafSize (voxel_grid_size, voxel_grid_size, voxel_grid_size);
  vox_grid.filter (*cloud);

.... in this section. Maybe this should be changed in the tutorial? I use the last PCL version and I just added:

  pcl::PointCloud<pcl::PointXYZ>::Ptr newCloud (new pcl::PointCloud<pcl::PointXYZ>);
  vox_grid.filter (*newCloud);
  cloud = newCloud;

... and now it works.



y666 wrote
You cant filter cloud in place with VoxelGrid. You - in general -
shouldnt use "in-place" behaviour, unless documentation specifically
states its allowed.

Use something like this:

(...)
pcl::PointCloud<pcl::PointXYZRGB>::Ptr res(new pcl::PointCloud<pcl::PointXYZRGB>);
ds.setInputCloud (image_cloud);
ds.setLeafSize (0.01, 0.01, 0.01);
ds.filter (*res);
w.writeBinary<pcl::PointXYZRGB>("../Exp_data/cloud_downsampled.bin",*res);
(...)


---------------------------------------

Białym śniegiem zimą
Górą i doliną
Mrozem i kolędą
Tym dla ciebie będę
Będę ciepłem lata
Lepszą stroną świata
Będę kiedy jesień
Babie lato niesie

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

Steph
This post has NOT been accepted by the mailing list yet.
Thanks dilyan, you have given me the answer I was looking for since a few days : http://www.pcl-users.org/template-alignment-assert-problem-td3946775.html. I don't know why nobody answered my question, maybe my English is not very good... Anyway, thanks a lot!

This turorial should really be corrected for new users like me.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

Radu B Rusu
Administrator
In reply to this post by dilyan
That sounds like a great idea! Can you please submit a patch that fixes the tutorial? Thanks in advance.

Cheers,
Radu.

On 05/01/2012 05:30 AM, dilyan wrote:

>
>
> Hello,
>
> in on of the tutorials - Applications ->  Aligning object templates to a
> point cloud we have a section showing this in-place filtering with
> VoxelGrid:
>
>    // ... and downsampling the point cloud
>    const float voxel_grid_size = 0.005f;
>    pcl::VoxelGrid<pcl::PointXYZ>  vox_grid;
>    vox_grid.setInputCloud (cloud);
>    vox_grid.setLeafSize (voxel_grid_size, voxel_grid_size, voxel_grid_size);
>    vox_grid.filter (*cloud);
>
> .... in this section. Maybe this should be changed in the tutorial? I use
> the last PCL version and I just added:
>
>    pcl::PointCloud<pcl::PointXYZ>::Ptr newCloud (new
> pcl::PointCloud<pcl::PointXYZ>);
>    vox_grid.filter (*newCloud);
>    cloud = newCloud;
>
> ... and now it works.
>
>
>
>
> y666 wrote
>>
>> You cant filter cloud in place with VoxelGrid. You - in general -
>> shouldnt use "in-place" behaviour, unless documentation specifically
>> states its allowed.
>>
>> Use something like this:
>>
>> (...)
>> pcl::PointCloud<pcl::PointXYZRGB>::Ptr res(new
>> pcl::PointCloud<pcl::PointXYZRGB>);
>> ds.setInputCloud (image_cloud);
>> ds.setLeafSize (0.01, 0.01, 0.01);
>> ds.filter (*res);
>> w.writeBinary<pcl::PointXYZRGB>("../Exp_data/cloud_downsampled.bin",*res);
>> (...)
>>
>>
>> ---------------------------------------
>>
>> Białym śniegiem zimą
>> Górą i doliną
>> Mrozem i kolędą
>> Tym dla ciebie będę
>> Będę ciepłem lata
>> Lepszą stroną świata
>> Będę kiedy jesień
>> Babie lato niesie
>>
>> _______________________________________________
>> PCL-users@ / http://pointclouds.org
>> http://pointclouds.org/mailman/listinfo/pcl-users
>>
>
>
> --
> View this message in context: http://www.pcl-users.org/strange-effect-of-the-downsampling-tp3857829p3952833.html
> Sent from the Point Cloud Library (PCL) Users mailing list archive at Nabble.com.
> _______________________________________________
> [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
|  
Report Content as Inappropriate

Re: strange effect of the downsampling

ZhengYoChen
This post has NOT been accepted by the mailing list yet.
In reply to this post by Mauro Bellone
I faced this problem before,
now I am using ApproximateVoxelGrid instead,and it works well
Loading...