pcl::CropBox getRemovedIndices returns empty

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

pcl::CropBox getRemovedIndices returns empty

nenadpol
This post was updated on .
Hi,

Windows7, vs2010, pcl 1.5.1

I have tried pcl::CropBox and it works fine but function getRemovedIndices return empty.

This is part of the code:

pcl::CropHull<PointT> crop_filter;
crop_filter.setInputCloud (GS_PCL::GSPCLBase<PointT>::getInputCloud());
crop_filter.setIndices(GS_PCL::GSPCLBase<PointT>::getIndices());
crop_filter.setHullCloud(hull);
crop_filter.setHullIndices(polygons);
crop_filter.setDim(dim);
crop_filter.setCropOutside(false);
crop_filter.filter (*cloudOut);
 
 removed_indices.reset(new pcl::PointIndices);
 removed_indices->indices=*crop_filter.getRemovedIndices();

In the picture below yuo can see result of pcl::CropBox




so everything works fine exept getRemovedIndices.

pcl::PassThrough has same function and it works fine there

Thanks,
Nenad


Reply | Threaded
Open this post in threaded view
|

Re: pcl::CropBox getRemovedIndices returns empty

Sergey
Administrator
Hi,

As far as I can see, this functionality is not implemented (crop_box.hpp), although it should be trivial to add. You just need to augment every "continue" in the source code with pushing the index of the current point to removed_indices_.

You could either submit a feature request or your patch (if you decide to implement it yourself) at dev.pointclouds.org.

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

Re: pcl::CropBox getRemovedIndices returns empty

nenadpol
Hi,

Ok, thanks
I do not want to change source code, so I think I will just use "setCropOutside" to get points
inside or outside of cropHull. This is the same thing, right?

Cheers,
Nenad
Reply | Threaded
Open this post in threaded view
|

Re: pcl::CropBox getRemovedIndices returns empty

JoaoFaria
In reply to this post by Sergey
Sergey wrote
Hi,

As far as I can see, this functionality is not implemented (crop_box.hpp), although it should be trivial to add. You just need to augment every "continue" in the source code with pushing the index of the current point to removed_indices_.

You could either submit a feature request or your patch (if you decide to implement it yourself) at dev.pointclouds.org.

Cheers,
Sergey
crop_box.hpp seems to be well implemented. You can see that if the point is not added to the new cloud, it is appended to the removed_indices_ variable. However, when calling getRemovedIndices(), the output is an empty vector...
Does anyone have a clue on what's wrong here?

Cheers,
Joao
Reply | Threaded
Open this post in threaded view
|

Re: pcl::CropBox getRemovedIndices returns empty

william.nguatem
Hello folks,
I believe I muss be missing something, cropBox or cropHull both work only when then user defined box is axis aligned ?

In my case, I have a cloud far away from my axis and my box, defined by 4 points is not axis aligned what am I really missing ? I want to extract all the points within this box thus a subset of my cloud. Actually it seems very simple to implement using sets of 3 planes bounding the box, however, needless for me to reinvent the wheel.

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

Re: pcl::CropBox getRemovedIndices returns empty

nenadpol
Hi,
You are missing cropBox public member functions:


void setTranslation (const Eigen::Vector3f &translation)
void setRotation (const Eigen::Vector3f &rotation)
void setTransform (const Eigen::Affine3f &transform)

Cheers,
Nenad
Reply | Threaded
Open this post in threaded view
|

Re: pcl::CropBox getRemovedIndices returns empty

william.nguatem
Thanks!

Will give it a try.

Regards
William
Reply | Threaded
Open this post in threaded view
|

Re: pcl::CropBox getRemovedIndices returns empty

JoaoFaria
In reply to this post by JoaoFaria
My bad, I was using CropHull. That one is not right, but I've fixed it.