Refining a noisy plane

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

Refining a noisy plane

Shawarma
Hello,

I have been using a stereo camera to reconstruct an object that should look like a flat plane, but due to sensor noise I instead get a wavy representation. Could someone please point me to existing implementations in PCL that help handle the smoothing to ensure that I get a better representation?

This picture explains what I mean: http://flowgallery.stanford.edu/imgs/research/contrails2.png

The first image is relatively "nice", but what I get is something similar to the bottom one (third). Unfortunately, it is really hard to fit a plane to 3D data of that sort. Is there any way that I can use a averaging window and stabilize the wavy points?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Refining a noisy plane

nizar sallem
You could use gaussian smoothing through pcl/filters/Convolution
Also a plane segmentation through RANSAC will do what you need if you
relax your threshold.

Cheers,
--
Nizar

On 27/11/2013 19:46, Shawarma wrote:

> Hello,
>
> I have been using a stereo camera to reconstruct an object that should look
> like a flat plane, but due to sensor noise I instead get a wavy
> representation. Could someone please point me to existing implementations in
> PCL that help handle the smoothing to ensure that I get a better
> representation?
>
> This picture explains what I mean:
> http://flowgallery.stanford.edu/imgs/research/contrails2.png
>
> The first image is relatively "nice", but what I get is something similar to
> the bottom one (third). Unfortunately, it is really hard to fit a plane to
> 3D data of that sort. Is there any way that I can use a averaging window and
> stabilize the wavy points?
>
> Thanks!
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Refining-a-noisy-plane-tp4030990.html
> Sent from the Point Cloud Library (PCL) Users mailing list 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
|

Re: Refining a noisy plane

Shawarma
Hello Nizar,

Thank you for taking the time to reply. In addition to what you have suggested, I tried out MLS smoothing, but didn't notice much improvement. Next, I tried the Gaussion smoothing, but run into an implementation error. The error I get is:

 'point_idx' : index variable in OpenMP 'for' statement must have signed integral type
Which comes from this part of the code in convolution_3d.hpp
  for (std::size_t point_idx = 0; point_idx < surface_->size (); ++point_idx)
  {
    const PointInT& point_in = surface_->points [point_idx];
    PointOutT& point_out = output [point_idx];
    if (isFinite (point_in) &&
        tree_->radiusSearch (point_in, search_radius_, nn_indices, nn_distances))
I disabled OpenMP and then, I'm able to run the code, but with OpenMP enabled I face this issue. Do you know why this might be? Initially, I haven't noticed much difference with Gaussian smoothing as well. I have been varying the search radius definitely but I believe I need to dig into the documentation more closely.

I also tried RANSAC plane segmentation, varying the setAxis, maximumDistance threshold parameters etc. but will look into this some more as well. Why do you think this will allow for refinement Nizar? Isn't this just for segmentation? Additionally, is it really robust to noisy data? When you say relaxing the parameters, did you have any specific one's in mind?

Thanks again ...
Reply | Threaded
Open this post in threaded view
|

Re: Refining a noisy plane

james
Administrator
Hi,

As Nizar said, you count try RANSAC. By using a relatively large distance threshold you should be able to capture all the parts as part of the plane (producing coefficients and inliers). Then, once RANSAC as produced a best-fit plane model, you could project all of the inliers onto the plane model using the coefficients.

Regards,
James
Reply | Threaded
Open this post in threaded view
|

Re: Refining a noisy plane

nizar sallem
In reply to this post by Shawarma
I am afraid you are running a windows machine and there OpenMP works
only with int so just replace "std::size_t" point_idx with "int point_idx".
I will fix this in the trunk.

Cheers,
--
Nizar

On 27/11/2013 23:48, Shawarma wrote:

> Hello Nizar,
>
> Thank you for taking the time to reply. In addition to what you have
> suggested, I tried out MLS smoothing, but didn't notice much improvement.
> Next, I tried the Gaussion smoothing, but run into an implementation error.
> The error I get is:
>
>
>>   'point_idx' : index variable in OpenMP 'for' statement must have signed
>> integral type
>
> Which comes from this part of the code in convolution_3d.hpp
>
>>    for (std::size_t point_idx = 0; point_idx < surface_->size ();
>> ++point_idx)
>>    {
>>      const PointInT& point_in = surface_->points [point_idx];
>>      PointOutT& point_out = output [point_idx];
>>      if (isFinite (point_in) &&
>>          tree_->radiusSearch (point_in, search_radius_, nn_indices,
>> nn_distances))
>
> I disabled OpenMP and then, I'm able to run the code, but with OpenMP
> enabled I face this issue. Do you know why this might be? Initially, I
> haven't noticed much difference with Gaussian smoothing as well. I have been
> varying the search radius definitely but I believe I need to dig into the
> documentation more closely.
>
> I also tried RANSAC plane segmentation, varying the setAxis, maximumDistance
> threshold parameters etc. but will look into this some more as well. Why do
> you think this will allow for refinement Nizar? Isn't this just for
> segmentation? Additionally, is it really robust to noisy data? When you say
> relaxing the parameters, did you have any specific one's in mind?
>
> Thanks again ...
>
>
>
>
> --
> View this message in context: http://www.pcl-users.org/Refining-a-noisy-plane-tp4030990p4030995.html
> Sent from the Point Cloud Library (PCL) Users mailing list 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