NaN in point cloud

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

NaN in point cloud

bluechill
Hi,

I have a point cloud possibly with NaN values. RemoveNaNFromPointClouds() does not seem to work to remove the NaN values. Now, I want to copy the point cloud values to another cloud, only without the NaN values. So that I can work with the new cloud. For that I need to check for NaN values. How do I do that ?

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

Re: NaN in point cloud

Bálint Kriván
Hey, I'm using removeNaN and it works at my side. Isn't it possible you're doing something in a magic-way? :)


On Tue, Apr 1, 2014 at 8:06 PM, bluechill <[hidden email]> wrote:
Hi,

I have a point cloud possibly with NaN values. RemoveNaNFromPointClouds()
does not seem to work to remove the NaN values. Now, I want to copy the
point cloud values to another cloud, only without the NaN values. So that I
can work with the new cloud. For that I need to check for NaN values. How do
I do that ?

Thanks in advance.



--
View this message in context: http://www.pcl-users.org/NaN-in-point-cloud-tp4033209.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



--
Üdv,
Kriván Bálint

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

Re: NaN in point cloud

JMRuizAb
This post was updated on .
In reply to this post by bluechill
I had that problem too, so I created a routine to copy each value (except* ​​NAN values) in another cloud

That works for me but I like to meet other solution (more efficient)
Reply | Threaded
Open this post in threaded view
|

Re: NaN in point cloud

bluechill
Thanks, I am doing the same thing. But in order to copy the values other than the NaN, you have to know how to check that NaN. So how do you check it in "if" condition ?
Thanks in advance.


On Wed, Apr 2, 2014 at 1:04 AM, JMRuizAb [via Point Cloud Library (PCL) Users mailing list] <[hidden email]> wrote:
I had that problem too, so I created a routine to copy each (other values NAN) in another cloud

That worked for me but I like to meet other solution (more efficient)


If you reply to this email, your message will be added to the discussion below:
http://www.pcl-users.org/NaN-in-point-cloud-tp4033209p4033211.html
To unsubscribe from NaN in point cloud, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: NaN in point cloud

Artur Maligo
Hi,

You can use the macro pcl_isfinite. You should check the code of the
function removeNaNFromPointCloud, this could help you understand why
it's not working in your case, and could also provide an example of how
pcl_isfinite can be used.

Cheers,
Artur Maligo
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: NaN in point cloud

JMRuizAb
In reply to this post by bluechill
bluechill wrote
Thanks, I am doing the same thing. But in order to copy the values other
than the NaN, you have to know how to check that NaN. So how do you check
it in "if" condition ?
Thanks in advance.
Yes, to validate NAN values You must use a if condition: if(!isnan(value)) Check: http://www.boost.org/doc/libs/1_41_0/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fpclass.html

Artur Maligo wrote
Hi,

You can use the macro pcl_isfinite. You should check the code of the
function removeNaNFromPointCloud, this could help you understand why
it's not working in your case, and could also provide an example of how
pcl_isfinite can be used.

Cheers,
Artur Maligo
Sounds good I'll test it, thanks a lot!!
Reply | Threaded
Open this post in threaded view
|

Re: NaN in point cloud

nizar sallem
pcl provides two methods :
pcl::isFinite (const PointT& p) to check validity of point and
specialized for almost all of them (default behavior is to check x, y
and z validity).
or pcl_isfinite (const float& value) which checks individual fields.

For your particular issue, PCL provides non valid points filtering
method pcl::removeNaNFromPointCloud. This is done in a bunch of tutorials.
Here is an example :
http://pointclouds.org/documentation/tutorials/pairwise_incremental_registration.php

pcl::io::loadPCDFile (argv[i], *m.cloud);
//remove NAN points from the cloud
std::vector<int> indices;
pcl::removeNaNFromPointCloud(*m.cloud,*m.cloud, indices);

Best,
--
Nizar
On 02/04/2014 17:32, JMRuizAb wrote:

> bluechill wrote
>> Thanks, I am doing the same thing. But in order to copy the values other
>> than the NaN, you have to know how to check that NaN. So how do you check
>> it in "if" condition ?
>> Thanks in advance.
> Yes, to validate NAN values You must use a if condition: if(!isnan(value))
> Check:
> http://www.boost.org/doc/libs/1_41_0/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fpclass.html
>
>
> Artur Maligo wrote
>> Hi,
>>
>> You can use the macro pcl_isfinite. You should check the code of the
>> function removeNaNFromPointCloud, this could help you understand why
>> it's not working in your case, and could also provide an example of how
>> pcl_isfinite can be used.
>>
>> Cheers,
>> Artur Maligo
> Sounds good I'll test it, thanks a lot!!
>
>
>
>
> --
> View this message in context: http://www.pcl-users.org/NaN-in-point-cloud-tp4033209p4033234.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: NaN in point cloud

bluechill
Thanks a lot everyone. :) Its solved !


On Thu, Apr 3, 2014 at 3:14 PM, nizar sallem [via Point Cloud Library (PCL) Users mailing list] <[hidden email]> wrote:
pcl provides two methods :
pcl::isFinite (const PointT& p) to check validity of point and
specialized for almost all of them (default behavior is to check x, y
and z validity).
or pcl_isfinite (const float& value) which checks individual fields.

For your particular issue, PCL provides non valid points filtering
method pcl::removeNaNFromPointCloud. This is done in a bunch of tutorials.
Here is an example :
http://pointclouds.org/documentation/tutorials/pairwise_incremental_registration.php

pcl::io::loadPCDFile (argv[i], *m.cloud);
//remove NAN points from the cloud
std::vector<int> indices;
pcl::removeNaNFromPointCloud(*m.cloud,*m.cloud, indices);

Best,
--
Nizar
On 02/04/2014 17:32, JMRuizAb wrote:

> bluechill wrote
>> Thanks, I am doing the same thing. But in order to copy the values other
>> than the NaN, you have to know how to check that NaN. So how do you check
>> it in "if" condition ?
>> Thanks in advance.
> Yes, to validate NAN values You must use a if condition: if(!isnan(value))
> Check:
> http://www.boost.org/doc/libs/1_41_0/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fpclass.html
>

>
> Artur Maligo wrote
>> Hi,
>>
>> You can use the macro pcl_isfinite. You should check the code of the
>> function removeNaNFromPointCloud, this could help you understand why
>> it's not working in your case, and could also provide an example of how
>> pcl_isfinite can be used.
>>
>> Cheers,
>> Artur Maligo
> Sounds good I'll test it, thanks a lot!!
>
>
>
>
> --
> View this message in context: http://www.pcl-users.org/NaN-in-point-cloud-tp4033209p4033234.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



If you reply to this email, your message will be added to the discussion below:
http://www.pcl-users.org/NaN-in-point-cloud-tp4033209p4033253.html
To unsubscribe from NaN in point cloud, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: NaN in point cloud

Sergey
Administrator
Hi guys,

Just to summarize, was anything wrong with the function? If not then what was the problem originally? It's a very common operation to do, so perhaps it's worth improving the documentation so that other people don't waste time.

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

Re: NaN in point cloud

nizar sallem
Hi Sergey,

May be we should put more accent on it or just make sure algorithms that
are nan sensitive performs the nan removal step, what do you think ?

--
Nizar
On 05/04/2014 12:10, Sergey wrote:

> Hi guys,
>
> Just to summarize, was anything wrong with the function? If not then what
> was the problem originally? It's a very common operation to do, so perhaps
> it's worth improving the documentation so that other people don't waste
> time.
>
> Regards,
> Sergey
>
>
>
> --
> View this message in context: http://www.pcl-users.org/NaN-in-point-cloud-tp4033209p4033321.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: NaN in point cloud

Sergey
Administrator
Nizar,

I do not think this is the right way to include NaN removal in every
algorithm. That it the responsibility of a user to make sure that her
clouds are NaN-free or that she provides cloud + indices to the finite
points.

On the other hand the documentation should indeed emphasize more
that the user needs to do NaN-pre-processing.

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

Re: NaN in point cloud

nizar sallem
That was my first thought as well.
We should probably put it in the preamble of PCL documentation and
tutorials of NaN sensitive algorithms.

--
Nizar
On 06/04/2014 12:19, Sergey wrote:

> Nizar,
>
> I do not think this is the right way to include NaN removal in every
> algorithm. That it the responsibility of a user to make sure that her
> clouds are NaN-free or that she provides cloud + indices to the finite
> points.
>
> On the other hand the documentation should indeed emphasize more
> that the user needs to do NaN-pre-processing.
>
> Regards,
> Sergey
>
>
>
> --
> View this message in context: http://www.pcl-users.org/NaN-in-point-cloud-tp4033209p4033331.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: NaN in point cloud

Artur Maligo
Does this mean that not all algorithms in PCL are robust to NaN points?
I thought the established convention was that an algorithm must handle
both dense and non-dense point clouds, like the algorithms in the
'features' module do. When the input point is NaN, the output (the
feature, in this case) is set to NaN too. So maybe this is not the
convention in other modules (segmentation, registration, ...)?
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: NaN in point cloud

nizar sallem
Hi Artur,

We are not really discussing the output here. It is more related to the
search functions for instance where, usually we test against non valid
points before doing the search but sometimes this is left unchecked.

--
Nizar
On 07/04/2014 11:07, Artur Maligo wrote:
> Does this mean that not all algorithms in PCL are robust to NaN
> points? I thought the established convention was that an algorithm
> must handle both dense and non-dense point clouds, like the algorithms
> in the 'features' module do. When the input point is NaN, the output
> (the feature, in this case) is set to NaN too. So maybe this is not
> the convention in other modules (segmentation, registration, ...)?
> _______________________________________________
> [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: NaN in point cloud

Artur Maligo
I see. Thanks for the info, it's good to know that!
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users