Problem regarding SHOT descriptor

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

Problem regarding SHOT descriptor

ricogu
Dear PCLers:
     I recently came across a problem with SHOT descriptor implemented in PCL library. Whenever I set the normal estimation radius smaller than our descriptor radius (PCL code) the code exits with an error. Isn’t it that the normal estimation typically requires a radius that is smaller than the actual descriptor radius?

Error Message:

1;33m[pcl::SHOTEstimation::computeFeature] The local reference frame is not valid! Aborting description of point with index 15
coopmedia3d: /build/buildd/pcl-1.6-1.6.0/features/include/pcl/features/impl/shot.hpp:426: void pcl::SHOTEstimationBase<PointInT, PointNT, PointOutT, PointRFT>::interpolateSingleChannel(const std::vector<int>&, const std::vector<float>&, int, std::vector<double>&, int, Eigen::VectorXf&) [with PointInT = pcl::PointXYZ, PointNT = pcl::Normal, PointOutT = pcl::SHOT352, PointRFT = pcl::ReferenceFrame, Eigen::VectorXf = Eigen::Matrix<float, -0x00000000000000001, 1>]: Assertion `(desc_index - 1) * (nr_bins+1) + step_index >= 0 && (desc_index - 1) * (nr_bins+1) + step_index < descLength_' failed.
The program has unexpectedly finished.


BR
Rico
Reply | Threaded
Open this post in threaded view
|

Re: Problem regarding SHOT descriptor

Andreas Mützel
Hi,

is it possible that you set the normal estimation radius so low that you
sometimes get NaN values for the normals? You could try a k neighborhood for
the normals, with that you always get valid normals and can rule that
possibility.
(I vaguely remember a similar error, but I'm not sure if that is really the
same error since I filter out points with invalid normals before the SHOT
estimation.)

HTH
Andreas

On Friday 22 March 2013, 03:54:54 ricogu wrote:

> Dear PCLers:
>      I recently came across a problem with SHOT descriptor implemented in
> PCL library. Whenever I set the normal estimation radius smaller than our
> descriptor radius (PCL code) the code exits with an error. Isn’t it that the
> normal estimation typically requires a radius that is smaller than the
> actual descriptor radius?
>
> Error Message:
>
> 1;33m[pcl::SHOTEstimation::computeFeature] The local reference frame is not
> valid! Aborting description of point with index 15
> coopmedia3d:
> /build/buildd/pcl-1.6-1.6.0/features/include/pcl/features/impl/shot.hpp:426:
> void pcl::SHOTEstimationBase<PointInT, PointNT, PointOutT,
> PointRFT>::interpolateSingleChannel(const std::vector<int>&, const
> std::vector<float>&, int, std::vector<double>&, int, Eigen::VectorXf&) [with
> PointInT = pcl::PointXYZ, PointNT = pcl::Normal, PointOutT = pcl::SHOT352,
> PointRFT = pcl::ReferenceFrame, Eigen::VectorXf = Eigen::Matrix<float,
> -0x00000000000000001, 1>]: Assertion `(desc_index - 1) * (nr_bins+1) +
> step_index >= 0 && (desc_index - 1) * (nr_bins+1) + step_index <
> descLength_' failed.
> The program has unexpectedly finished.
>
>
> BR
> Rico
>
>
>
> --
> View this message in context:
> http://www.pcl-users.org/Problem-regarding-SHOT-descriptor-tp4026895.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: Problem regarding SHOT descriptor

Nicola Fioraio
In reply to this post by ricogu
Hi Rico,

The problem is related to the local reference frame computation.
I'm not able to look into that until tomorrow, in the meantime
can you post a code snippet so that we can better investigate the issue?

cheers
--Nicola


On Fri, Mar 22, 2013 at 11:54 AM, ricogu <[hidden email]> wrote:
Dear PCLers:
     I recently came across a problem with SHOT descriptor implemented in
PCL library. Whenever I set the normal estimation radius smaller than our
descriptor radius (PCL code) the code exits with an error. Isn’t it that the
normal estimation typically requires a radius that is smaller than the
actual descriptor radius?

Error Message:

1;33m[pcl::SHOTEstimation::computeFeature] The local reference frame is not
valid! Aborting description of point with index 15
 [0;mcoopmedia3d:
/build/buildd/pcl-1.6-1.6.0/features/include/pcl/features/impl/shot.hpp:426:
void pcl::SHOTEstimationBase<PointInT, PointNT, PointOutT,
PointRFT>::interpolateSingleChannel(const std::vector<int>&, const
std::vector<float>&, int, std::vector<double>&, int, Eigen::VectorXf&) [with
PointInT = pcl::PointXYZ, PointNT = pcl::Normal, PointOutT = pcl::SHOT352,
PointRFT = pcl::ReferenceFrame, Eigen::VectorXf = Eigen::Matrix<float,
-0x00000000000000001, 1>]: Assertion `(desc_index - 1) * (nr_bins+1) +
step_index >= 0 && (desc_index - 1) * (nr_bins+1) + step_index <
descLength_' failed.
The program has unexpectedly finished.


BR
Rico



--
View this message in context: http://www.pcl-users.org/Problem-regarding-SHOT-descriptor-tp4026895.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: Problem regarding SHOT descriptor

ricogu
Sorry i was sick for a week.

I have hereby attached the running code and dataset that will reproduce the problem.

Code : readPCL.cpp
dataset:seg_pcd_1_20.pcd

If i changed normal search radius from 0.5 to 1.0. The problem goes away

Rico
Reply | Threaded
Open this post in threaded view
|

Re: Problem regarding SHOT descriptor

fedassa
Hi Anas,

as expected the issue you are referring to is due to the fact that with the smaller normal radius (0.5) some normals are NaNs (there are no point in their neighborhood within a sphere of radius 0.5). This used to cause a problem with SHOT, but not anymore, since we fixed this issue a while ago and in the current version of PCL  SHOT is able to handle the presence of NaNs in the normals and will print out a warning everytime it will encounter one (but without crashing). Indeed, I get some warnings using radius=0.5 and no warnings with 1.0, which is the sign that with the bigger radius there's no normal == NaNs. Maybe you are running an old version of PCL? As an advice, another way to avoid NaN in the normal estimation stage, apart from increasing the normal radius, is setting a kNN search instead of a radius search: in that case, points that don't have neighbors in their close vicinity will anyway get the required number of elements from further away points to estimate the normal.

By the way, and just out of curiosity: why are you instantiating a class of SHOT descriptor and calling it "shapeContext"? Isn't it a bit confusing?

Fede
Reply | Threaded
Open this post in threaded view
|

Re: Problem regarding SHOT descriptor

ricogu
Dear Febe
    Thanks for the answer. Anas is my colleague working on the same project.
    The shapeContext, if i am not wrong, is a instance of pcl::SHOTEstimationOMP and so the descriptor. The descriptor is instantiated by statement  pcl::PointCloud<pcl::SHOT352>::Ptr SHOTDescriptor(new pcl::PointCloud<pcl::SHOT352>). Please correct my mistake :)

Rico
Reply | Threaded
Open this post in threaded view
|

Re: Problem regarding SHOT descriptor

fedassa
Hi Rico (and Anas)

to avoid confusion let's call here "describer" the agent that describes a set of keypoints and "descriptor" the vector associated to each keypoint (i.e. the output of a describer)

Hence, the SHOTEstimationOMP is the OMP-ed class of the SHOT describer, so an object of this class will compute SHOT descriptors (saved in an array of pcl::SHOT352 type). So the pcl::PointCloud<pcl::SHOT352>::Ptr SHOTDescriptor(new pcl::PointCloud<pcl::SHOT352>) instruction instantiates the array of descriptors which will be filled in by the SHOT describer.

The shape context describer is instead included in the "pcl::ShapeContext3DEstimation" class (http://docs.pointclouds.org/trunk/classpcl_1_1_shape_context3_d_estimation.html), and it's a different algorithm wrt. SHOT.

That's why i thought that calling "shapeContext" a SHOT describer instance could have been a bit misleading for your code users...

Best,
Federico