IntegralImageNormalEstimation problem ?

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

IntegralImageNormalEstimation problem ?

vali
Hi,

I am using the following code with two similar Point Clouds (XYZRGB) both of which can be seen in a Viewer.
One of them works, the other one gives "vector subscript out of range error". Please find both .pcd files attached. Can anyone advise on what is causing this ?


#include "stdafx.h"
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
#include <pcl/features/integral_image_normal.h>
#include <pcl/visualization/cloud_viewer.h>

     int
     main ()
     {
             // load point cloud
             pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZRGB>);
             pcl::io::loadPCDFile ("cloud13XYZRGB.pcd", *cloud);

             // estimate normals
             pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal>);

             pcl::IntegralImageNormalEstimation<pcl::PointXYZRGB, pcl::Normal> ne;
             ne.setNormalEstimationMethod (ne.COVARIANCE_MATRIX);//(ne.COVARIANCE_MATRIX);//(ne.AVERAGE_3D_GRADIENT);
             ne.setMaxDepthChangeFactor(0.02f);
             ne.setNormalSmoothingSize(10.0f);
             ne.setInputCloud(cloud);
             ne.compute(*normals);

             // visualize normals
             pcl::visualization::PCLVisualizer viewer("PCL Viewer");
             viewer.setBackgroundColor (0.0, 0.0, 0.5);
             viewer.addPointCloudNormals<pcl::PointXYZRGB, pcl::Normal>(cloud, normals);

             while (!viewer.wasStopped ())
             {
               viewer.spinOnce ();
             }
             return 0;
     }





cloud0XYZRGBProb.rar
cloud13XYZRGB.rar
Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

Jochen Sprickerhof
Administrator
Hi Valentin,

* vali <[hidden email]> [2013-10-25 08:54]:
> I am using the following code with two similar Point Clouds (XYZRGB) both of
> which can be seen in a Viewer.
> One of them works, the other one gives "vector subscript out of range
> error". Please find both .pcd files attached. Can anyone advise on what is
> causing this ?

I've tested this using both clouds using the current git master on
Debian unstable 64bit without problems. Can you give some details on
your environment?

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

Re: IntegralImageNormalEstimation problem ?

vali
Hi,

I am using Microsoft Visual C++ 2010 with PCL 1.6.0 (Windows MSVC 2010 (32bit) prebuilt binaries) on a windows 7 64 bit OS. The programming environment solution is set in debug Win32 platform. This has never been an issue before and have used PCL on a number of different tasks before.

Many Thanks,

Valentin Gheorghe
Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

vali
In reply to this post by Jochen Sprickerhof
Also, I have downloaded the 64bit library and changed/configured everything for debug x64 build. I get exactly the same error for the same point Cloud :((
Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

vali
In reply to this post by Jochen Sprickerhof
More recently I have changed everything to build in release mode x64 and instead of "vector subscript out of range" I get error as in the following image. So there is obviously something wrong with the cloud although I am able to visualize it properly inside a viewer.


Any suggestion for a work around would be very appreciated. The cluster causing the problem can be found as attachment in the original post/question. Also here is a picture with it inside the visualiser:


Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

vali
This post was updated on .
In reply to this post by Jochen Sprickerhof
Am I really going to have to get another OS to simply compute integralimage normals for a perfectly valid pointcloud ? I have tried virtually anything humanly possible with windows 7 :(((((((

I have even compiled the 1.7 version from source files and used everything in x64 release mode...
Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

Jochen Sprickerhof
Administrator
Hi Valentin,

I think there are two points here:
- PCL 1.6 is really old, so it could be that this is fixed in newer
  versions already.
- Almost all of our developers are using Linux. We are trying our best
  to make it work on other systems, but we don't have a fixed system to
  test.

So, instead of complaining, maybe you could try to debug your problem
and help us on the Windows front ;).

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

Re: IntegralImageNormalEstimation problem ?

nenadpol
In reply to this post by vali
Hi Valentin,

windows 7 64 bit OS
vs 2010prof
pcl 1.6 (32 bit)

When I try to run IntegralImageNormalEstimation with one of your files I get "vector out of range" exception.However, when I try to run same code with table_scene_mug_stereo_textured.pcd (from tutorial) I do not get exception at all but I do not get normal either.
My code is the same as in tutorial
http://pointclouds.org/documentation/tutorials/normal_estimation_using_integral_images.php#normal-estimation-using-integral-images

Can we try to find out what is wrong here?


Can you tell me what Boost version you have?


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

Re: IntegralImageNormalEstimation problem ?

vali
Hi Nenad,

Thank you very much for your interest in fixing this bug. I think at this stage it makes sense to try a different boost library to see if that changes anything because the input gets fed to the ne.compute() method via boost library pointer management. At the moment since I am using the pre-built binaries of PCL 1.6 32 bit I am including the boost \libs and \include files from the "\3rdPatry\boost\" content which appears to be shipped with 1.49 boost version. I will try to add dependencies from another boost version to see what's happening.

Regards,

Valentin
Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

vali
In reply to this post by nenadpol
Hi ,

Just tried it with the latest boost release (built from source) boost_1_54_0. Same error appears in both debug and release.

Regards,

Valentin
Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

nenadpol
Hi,
I had a lot of exceptions "Access violation...." when I used Boost 1.50

So far I did not manage to get any normal using this function.

I will try to debug problem and let you know if I find something.

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

Re: IntegralImageNormalEstimation problem ?

nenadpol
Hi,

This picture shows normal-values I am getting every time no metter what input values are.



Anybody, any ideas?

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

Re: IntegralImageNormalEstimation problem ?

vali
In reply to this post by Jochen Sprickerhof
Hi,

Can you please tell me what boost version you were using when you got both files working on Debian unstable 64bit. Many thanks.

P.S. I hope I can get to the bottom of this problem eventually.

Regards,

Valentin
Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

Jochen Sprickerhof
Administrator
Hi Valentin,

* vali <[hidden email]> [2013-11-01 11:46]:
> Can you please tell me what boost version you were using when you got both
> files working on Debian unstable 64bit. Many thanks.

1.54, but this all sounds like you are passing null pointers or
corrupted memory.

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

Re: IntegralImageNormalEstimation problem ?

nenadpol
In reply to this post by vali
Hi,
 I debugged problem and it is in organized.hpp file line 394  
if (!mask_ [idx])

As you can see from the picture mask size is 465750 but somehow idx is larger 465752 and  as result
you get vector out of range. Strangly, this does not happen with table_scene_mug_stereo_textured_organized.pcd file only with your file cloud0XYZRGBProb.pcd

When I use table_scene_mug_stereo_textured_organized.pcd file I get normals with no problem.



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

Re: IntegralImageNormalEstimation problem ?

vali
Hi,

Thanks very much for pointing that out. Now that is really some strange behavior. What could a possible workaround it solution be ?

Regards,

Valentin
Reply | Threaded
Open this post in threaded view
|

Re: IntegralImageNormalEstimation problem ?

nenadpol
Hi,

This one is beyond me.

Cheers
Nenad