Quantcast

Problem with linemod sample

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

Problem with linemod sample

Zyrkiel
This post has NOT been accepted by the mailing list yet.
Hi,

I'm a french student in internship in the augmented reality field. I'm studying a way to detect 3D objects from an OBJ file and a simple RGB camera, with a time-real method. In this way I'm trying to find a way to reproduce results equivalent to this paper's ones:
Stefan Hinterstoisser, Cedric Cagniart, Slobodan Ilic, Peter F. Sturm, Nassir Navab, Pascal Fua, Vincent Lepetit: Gradient Response Maps for Real-Time Detection of Textureless Objects. IEEE Trans. Pattern Anal. Mach. Intell. 34(5): 876-888 (2012)

http://infoscience.epfl.ch/record/176304/files/top.pdf

A collegue suggested me to use the linemod method in PCL. Since it's inspired of this paper and it's better than the opencv linemod method, according to him.

So I have installed Visual Studio 2010, and after some building problems, I have built the 1.7.0 release version of the git in 32 bit debug. I run my programms in 32 bit debug and link the debug library. My OS is Windows 7 64 bit. (just for information)

I found out a method to convert my OBJ file in a PCD one. I'm using the obj2vtk.cpp and the vtk2pcd.cpp of PCL. I put them in a Converter.cpp file.

Then I'm trying to follow the following sample:
http://kfls2.googlecode.com/svn/trunk/tools/train_linemod_template.cpp

It would compute templates from the PCD file. I have removed the min_depth, max_depth, max_height arguments. I'm also trying to only use the color_gradient_modality since I don't have deth datas. But I'm quiet sure that it's not the cause of my problem.



The problem is the following one:

While running my programm I'm meeting an out of range problem. After Debugging my code, it happened it comes from the following method in convolution.hpp line 554:
template <typename PointIn, typename PointOut> void
pcl::filters::Convolution<PointIn, PointOut>::convolve_cols (PointCloudOut& output)


It's trying to access a 2nd dimension of PointCloutOut, whereas it's a 1D vector.
This method is called from
template <typename PointIn, typename PointOut> inline void
pcl::filters::Convolution<PointIn, PointOut>::convolveCols (PointCloudOut& output)

which is called from
template <typename PointIn, typename PointOut> inline void
pcl::filters::Convolution<PointIn, PointOut>::convolve (PointCloud<PointOut>& output)

which is called from
template <typename PointInT>
void
pcl::ColorGradientModality<PointInT>::
processInputData ()

which is called from
void
trainTemplate (const PointCloudXYZRGBA::ConstPtr & input, const std::vector<bool> &foreground_mask,
               pcl::LINEMOD & linemod)
of the sample I'm using.

I have checked that it doesn't come from the PCD file by using bun0.pcd which is in the test folder in PCL and I have the same problem.


I hope I have been clear enough and that you will able to advice me.

Regards,

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with linemod sample

Midazc
This post has NOT been accepted by the mailing list yet.
Might I suggest to take a look at the issue I posted @ https://github.com/PointCloudLibrary/pcl/issues/691 ? Does this one concern you as well? I will be posting a fix as soon as I can free up some time but a workaround would be to make sure you are using samples with width/height values being a multiple of 16.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with linemod sample

Zyrkiel
This post has NOT been accepted by the mailing list yet.
This post was updated on .
I don't think it concerns me.

For testing the sample I'm using the file bun0.pcd which is located in the test folder of PCL. Here id the header of the file with the first points of the cloud.


# .PCD v.5 - Point Cloud Data file format
VERSION .5
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1 1 1
WIDTH 397
HEIGHT 1
POINTS 397
DATA ascii
0.0054216 0.11349 0.040749
-0.0017447 0.11425 0.041273
-0.010661 0.11338 0.040916
0.026422 0.11499 0.032623
...

The problem is, I think, that it creates a PointCloud with a width of 397 and a height of 1, and in the processInputData of pcl::ColorGradientModality<pcl::PointXYZRGBA>  the pcl::filters::Convolution<PointIn, PointOut>::convolve_cols (PointCloudOut& output) method is called. It is trying to access to a 2D and a 3D dimension of the pointCloud. Whereas its height is only 1.
I think it wants to access the RGB channel of the points, but since it is the adress of the array of points passed through the method, there is an out of range error.

Hope I've been clear enough.

Regards,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with linemod sample

Midazc
This post has NOT been accepted by the mailing list yet.

Linemod uses structured pointclouds, so make sure you do not lose that.

Am 26.08.2014 10:00 schrieb "Zyrkiel [via Point Cloud Library (PCL) Developers mailing list]" <[hidden email]>:
I don't think it concerns me.

For testing the sample I'm using the file bun0.pcd which is located in the test folder of PCL. Here id the header of the file with the first points of the cloud.


# .PCD v.5 - Point Cloud Data file format
VERSION .5
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1 1 1
WIDTH 397
HEIGHT 1
POINTS 397
DATA ascii
0.0054216 0.11349 0.040749
-0.0017447 0.11425 0.041273
-0.010661 0.11338 0.040916
0.026422 0.11499 0.032623
...

The problem is, I think, that it creates a PointCloud with a width of 397 and a height of 1, and in the processInputData of pcl::ColorGradientModality<pcl::PointXYZRGBA>  the pcl::filters::Convolution<PointIn, PointOut>::convolve_cols (PointCloudOut& output) method is called. It is trying to access to a 2D and a 3D dimension of the pointCloud. Whereas its height is only 1.
I think it wants to access the RGB channel of the points, but since it is the adress of the array of points passed through the method, there is an out of range error.

Hope, I've been clear enough.

Regards,



If you reply to this email, your message will be added to the discussion below:
http://www.pcl-developers.org/Problem-with-linemod-sample-tp5709621p5709640.html
To unsubscribe from Problem with linemod sample, click here.
NAML
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with linemod sample

Zyrkiel
This post has NOT been accepted by the mailing list yet.
Here is my cloud after loading the file in the main:



Here is the input in the trainTemplate method:



Still the same datas.

Now we enter in the PCL code.
Here is the input in the processInputData method:



The input datas are passed into rgb_input datas.

Few methods later, in the convolution method:



Datas are the same as in the processInputData method. And the error comes when j=1.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with linemod sample

Zyrkiel
This post has NOT been accepted by the mailing list yet.
I just tried to build in release instead of debug, and I got an other error...

In the computeMaxColorGradientsSobel method, after the convolve method in processInputData() :





There is a problem during the affectation I could not explain... It causes an error during the resize of color_gradients_.points.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with linemod sample

pclbel
This post has NOT been accepted by the mailing list yet.
Just to complete this thread, just in case someone has the same problem with the linemod sample...

Linemod template training uses the PCL convolution filter. As stated in the documentation (see http://docs.pointclouds.org/1.7.0/classpcl_1_1filters_1_1_convolution.html) the applied filter to  the pointcloud is only allowed on ORGANIZED pointclouds (height > 1).

So if you use unorganized point clouds "Linemod template training" will run in "out of range"-Exception while processing the data for the color modality just because it uses the convolution filter.

So I suggest to make sure you use only ORGANIZED pointclouds.
Maybe I will make a pull request for PCL, so that in the future it is checked before processing if ity organized.
Loading...