Organized Segmentation unresolved external sybol

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

Organized Segmentation unresolved external sybol

sjc266
Hi all

I'm trying to use the OrganizedConnectedComponentSegmentation class:

pcl::EuclideanClusterComparator<pcl::PointXYZ, pcl::Normal, pcl::PointXYZL>::Ptr
    comparator(new pcl::EuclideanClusterComparator<pcl::PointXYZ, pcl::Normal, pcl::PointXYZL>());
comparator->setDistanceThreshold(0.03, false);
comparator->setInputCloud(cloud);
               
pcl::OrganizedConnectedComponentSegmentation<pcl::PointXYZ, pcl::PointXYZL> segmenter(comparator);
segmenter.setInputCloud(cloud);
               
std::vector<pcl::PointIndices> labelsIndices;
pcl::PointCloud<pcl::PointXYZL> labels;
segmenter.segment(labels, labelsIndices);


The code compiles but I get at linking error (in VS2010):
error LNK2001: unresolved external symbol "public: void __thiscall pcl::OrganizedConnectedComponentSegmentation<struct pcl::PointXYZ,struct pcl::PointXYZL>::segment(...)

I've just compiled pcl from the source and have had no problems using various other modules. I'm linking in pcl_segmentation_release.lib. Any ideas what is going wrong?

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

Re: Organized Segmentation unresolved external sybol

Alex Trevor
Hi Sam,

It looks like I failed to instantiate this class for all point label types (such as pcl::PointXYZL), only pcl::Label is currently instantiated.  I'll fix this shortly, but for now you can just include the hpp file.  Sorry for the inconvenience!

Cheers,
Alex

On Wed, Apr 11, 2012 at 2:35 AM, sjc266 <[hidden email]> wrote:
Hi all

I'm trying to use the OrganizedConnectedComponentSegmentation class:

/pcl::EuclideanClusterComparator<pcl::PointXYZ, pcl::Normal,
pcl::PointXYZL>::Ptr
   comparator(new pcl::EuclideanClusterComparator<pcl::PointXYZ,
pcl::Normal, pcl::PointXYZL>());
comparator->setDistanceThreshold(0.03, false);
comparator->setInputCloud(cloud);

pcl::OrganizedConnectedComponentSegmentation<pcl::PointXYZ, pcl::PointXYZL>
segmenter(comparator);
segmenter.setInputCloud(cloud);

std::vector<pcl::PointIndices> labelsIndices;
pcl::PointCloud<pcl::PointXYZL> labels;
segmenter.segment(labels, labelsIndices);/

The code compiles but I get at linking error (in VS2010):
/error LNK2001: unresolved external symbol "public: void __thiscall
pcl::OrganizedConnectedComponentSegmentation<struct pcl::PointXYZ,struct
pcl::PointXYZL>::segment(...)/

I've just compiled pcl from the source and have had no problems using
various other modules. I'm linking in pcl_segmentation_release.lib. Any
ideas what is going wrong?

Cheers
Sam

--
View this message in context: http://www.pcl-users.org/Organized-Segmentation-unresolved-external-sybol-tp3901719p3901719.html
Sent from the Point Cloud Library (PCL) Users 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
|  
Report Content as Inappropriate

Re: Organized Segmentation unresolved external sybol

sjc266
Thanks Alex

I didn't actually see the pcl::Label type, there was no particular reason why I was using PointXYZL instead. I'll use pcl::Label now.

Cheers
Sam

On Thu, Apr 12, 2012 at 4:48 AM, Alex Trevor [via Point Cloud Library (PCL) Users] <[hidden email]> wrote:
Hi Sam,

It looks like I failed to instantiate this class for all point label types (such as pcl::PointXYZL), only pcl::Label is currently instantiated.  I'll fix this shortly, but for now you can just include the hpp file.  Sorry for the inconvenience!

Cheers,
Alex

On Wed, Apr 11, 2012 at 2:35 AM, sjc266 <[hidden email]> wrote:
Hi all

I'm trying to use the OrganizedConnectedComponentSegmentation class:

/pcl::EuclideanClusterComparator<pcl::PointXYZ, pcl::Normal,
pcl::PointXYZL>::Ptr
   comparator(new pcl::EuclideanClusterComparator<pcl::PointXYZ,
pcl::Normal, pcl::PointXYZL>());
comparator->setDistanceThreshold(0.03, false);
comparator->setInputCloud(cloud);

pcl::OrganizedConnectedComponentSegmentation<pcl::PointXYZ, pcl::PointXYZL>
segmenter(comparator);
segmenter.setInputCloud(cloud);

std::vector<pcl::PointIndices> labelsIndices;
pcl::PointCloud<pcl::PointXYZL> labels;
segmenter.segment(labels, labelsIndices);/

The code compiles but I get at linking error (in VS2010):
/error LNK2001: unresolved external symbol "public: void __thiscall
pcl::OrganizedConnectedComponentSegmentation<struct pcl::PointXYZ,struct
pcl::PointXYZL>::segment(...)/

I've just compiled pcl from the source and have had no problems using
various other modules. I'm linking in pcl_segmentation_release.lib. Any
ideas what is going wrong?

Cheers
Sam

--
View this message in context: http://www.pcl-users.org/Organized-Segmentation-unresolved-external-sybol-tp3901719p3901719.html
Sent from the Point Cloud Library (PCL) Users 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/Organized-Segmentation-unresolved-external-sybol-tp3901719p3903106.html
To unsubscribe from Organized Segmentation unresolved external sybol, click here.
NAML

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

Re: Organized Segmentation unresolved external sybol

sjc266
In reply to this post by Alex Trevor
What sort of performance should I expect to get using OrganizedConnectedComponentSegmentation on a point cloud from the Kinect? It's currently taking 3-9 seconds per frame on my about-average machine, even when the comparator function simply tests the difference in z-values of the points.

Cheers
Sam

On Thu, Apr 12, 2012 at 8:04 AM, Sam Corbett-Davies <[hidden email]> wrote:
Thanks Alex

I didn't actually see the pcl::Label type, there was no particular reason why I was using PointXYZL instead. I'll use pcl::Label now.

Cheers
Sam


On Thu, Apr 12, 2012 at 4:48 AM, Alex Trevor [via Point Cloud Library (PCL) Users] <[hidden email]> wrote:
Hi Sam,

It looks like I failed to instantiate this class for all point label types (such as pcl::PointXYZL), only pcl::Label is currently instantiated.  I'll fix this shortly, but for now you can just include the hpp file.  Sorry for the inconvenience!

Cheers,
Alex

On Wed, Apr 11, 2012 at 2:35 AM, sjc266 <[hidden email]> wrote:
Hi all

I'm trying to use the OrganizedConnectedComponentSegmentation class:

/pcl::EuclideanClusterComparator<pcl::PointXYZ, pcl::Normal,
pcl::PointXYZL>::Ptr
   comparator(new pcl::EuclideanClusterComparator<pcl::PointXYZ,
pcl::Normal, pcl::PointXYZL>());
comparator->setDistanceThreshold(0.03, false);
comparator->setInputCloud(cloud);

pcl::OrganizedConnectedComponentSegmentation<pcl::PointXYZ, pcl::PointXYZL>
segmenter(comparator);
segmenter.setInputCloud(cloud);

std::vector<pcl::PointIndices> labelsIndices;
pcl::PointCloud<pcl::PointXYZL> labels;
segmenter.segment(labels, labelsIndices);/

The code compiles but I get at linking error (in VS2010):
/error LNK2001: unresolved external symbol "public: void __thiscall
pcl::OrganizedConnectedComponentSegmentation<struct pcl::PointXYZ,struct
pcl::PointXYZL>::segment(...)/

I've just compiled pcl from the source and have had no problems using
various other modules. I'm linking in pcl_segmentation_release.lib. Any
ideas what is going wrong?

Cheers
Sam

--
View this message in context: http://www.pcl-users.org/Organized-Segmentation-unresolved-external-sybol-tp3901719p3901719.html
Sent from the Point Cloud Library (PCL) Users 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/Organized-Segmentation-unresolved-external-sybol-tp3901719p3903106.html
To unsubscribe from Organized Segmentation unresolved external sybol, click here.
NAML


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

Re: Organized Segmentation unresolved external sybol

Radu B Rusu
Administrator
You've probably compiled in Debug mode. Compile in Release and you should see anything from 20FPS to 30FPS.

Cheers,
Radu.

On 04/11/2012 03:26 PM, sjc266 wrote:

> What sort of performance should I expect to get using
> OrganizedConnectedComponentSegmentation on a point cloud from the Kinect?
> It's currently taking 3-9 seconds per frame on my about-average machine,
> even when the comparator function simply tests the difference in z-values
> of the points.
>
> Cheers
> Sam
>
> On Thu, Apr 12, 2012 at 8:04 AM, Sam Corbett-Davies<
> [hidden email]>  wrote:
>
>> Thanks Alex
>>
>> I didn't actually see the pcl::Label type, there was no particular reason
>> why I was using PointXYZL instead. I'll use pcl::Label now.
>>
>> Cheers
>> Sam
>>
>>
>> On Thu, Apr 12, 2012 at 4:48 AM, Alex Trevor [via Point Cloud Library
>> (PCL) Users]<[hidden email]>  wrote:
>>
>>> Hi Sam,
>>>
>>> It looks like I failed to instantiate this class for all point label
>>> types (such as pcl::PointXYZL), only pcl::Label is currently instantiated.
>>>   I'll fix this shortly, but for now you can just include the hpp file.
>>>   Sorry for the inconvenience!
>>>
>>> Cheers,
>>> Alex
>>>
>>> On Wed, Apr 11, 2012 at 2:35 AM, sjc266<[hidden email]<http://user/SendEmail.jtp?type=node&node=3903106&i=0>
>>>> wrote:
>>>
>>>> Hi all
>>>>
>>>> I'm trying to use the OrganizedConnectedComponentSegmentation class:
>>>>
>>>> /pcl::EuclideanClusterComparator<pcl::PointXYZ, pcl::Normal,
>>>> pcl::PointXYZL>::Ptr
>>>>     comparator(new pcl::EuclideanClusterComparator<pcl::PointXYZ,
>>>> pcl::Normal, pcl::PointXYZL>());
>>>> comparator->setDistanceThreshold(0.03, false);
>>>> comparator->setInputCloud(cloud);
>>>>
>>>> pcl::OrganizedConnectedComponentSegmentation<pcl::PointXYZ,
>>>> pcl::PointXYZL>
>>>> segmenter(comparator);
>>>> segmenter.setInputCloud(cloud);
>>>>
>>>> std::vector<pcl::PointIndices>  labelsIndices;
>>>> pcl::PointCloud<pcl::PointXYZL>  labels;
>>>> segmenter.segment(labels, labelsIndices);/
>>>>
>>>> The code compiles but I get at linking error (in VS2010):
>>>> /error LNK2001: unresolved external symbol "public: void __thiscall
>>>> pcl::OrganizedConnectedComponentSegmentation<struct pcl::PointXYZ,struct
>>>> pcl::PointXYZL>::segment(...)/
>>>>
>>>> I've just compiled pcl from the source and have had no problems using
>>>> various other modules. I'm linking in pcl_segmentation_release.lib. Any
>>>> ideas what is going wrong?
>>>>
>>>> Cheers
>>>> Sam
>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.pcl-users.org/Organized-Segmentation-unresolved-external-sybol-tp3901719p3901719.html
>>>> Sent from the Point Cloud Library (PCL) Users mailing list archive at
>>>> Nabble.com.
>>>> _______________________________________________
>>>> [hidden email]<http://user/SendEmail.jtp?type=node&node=3903106&i=1>  /
>>>> http://pointclouds.org
>>>> http://pointclouds.org/mailman/listinfo/pcl-users
>>>>
>>>
>>>
>>> _______________________________________________
>>> [hidden email]<http://user/SendEmail.jtp?type=node&node=3903106&i=2>  /
>>> 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/Organized-Segmentation-unresolved-external-sybol-tp3901719p3903106.html
>>>   To unsubscribe from Organized Segmentation unresolved external sybol, click
>>> here<
>>> .
>>> NAML<
http://www.pcl-users.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>
>>
>
>
> --
> View this message in context: http://www.pcl-users.org/Organized-Segmentation-unresolved-external-sybol-tp3901719p3904017.html
> Sent from the Point Cloud Library (PCL) Users 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
|  
Report Content as Inappropriate

Re: Organized Segmentation unresolved external sybol

sjc266
I wish I was Radu! No I'm compiling in Release mode, running it on a Core2 Quad Q6600 2.4GHz, 4GB RAM.

I'm trying to group connected foreground components. First I identify the background for removal, but in order to keep the point cloud organized I set all background z values to NaN. I know this is a hack but I presumed organized clustering would be much faster than building an oct/Kdtree. I'm open to better solutions. I then run OrganizedConnectedComponentSegmentation, and the segment() function takes 5 seconds to run. Any ideas?

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

Re: Organized Segmentation unresolved external sybol

Alex Trevor
Hi Sam,

It definitely shouldn't take that long when built as release.  Could you provide a PCD file and/or your code so that I can try to reproduce this?  Thanks!

Cheers,
Alex

On Thu, Apr 12, 2012 at 9:06 PM, sjc266 <[hidden email]> wrote:
I wish I was Radu! No I'm compiling in Release mode, running it on a Core2
Quad Q6600 2.4GHz, 4GB RAM.

I'm trying to group connected foreground components. First I identify the
background for removal, but in order to keep the point cloud organized I set
all background z values to NaN. I know this is a hack but I presumed
organized clustering would be much faster than building an oct/Kdtree. I'm
open to better solutions. I then run
OrganizedConnectedComponentSegmentation, and the segment() function takes 5
seconds to run. Any ideas?

Cheers
Sam

--
View this message in context: http://www.pcl-users.org/Organized-Segmentation-unresolved-external-sybol-tp3901719p3906907.html
Sent from the Point Cloud Library (PCL) Users 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
|  
Report Content as Inappropriate

Re: Organized Segmentation unresolved external sybol

sjc266
This post was updated on .
Hi Alex

Attached (hope this works) is my c++ file. It uses the OpenNIGrabber framework from the tutorials. As I say, the segment() function takes between 3 and 9 seconds.

Currently I can see two issues:
- The segment function tests the entire cloud, not only those indices set by setIndices(). This could be a conscious decision but I can't work out why.
- I'm finding 200,000 segments every frame. This happens even when I use a trivial (always false) comparator. It still takes ages with this trivial comparator.

Do you know how segment() deals with points with NaN values?

Cheers
Sam

EDIT: I've also messed around with the threshold value but nothing seems to have much of an impact.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Organized Segmentation unresolved external sybol

Alex Trevor
Hi Sam,

Thanks for sending this.  I ran your code, and the call to segment takes about 25 milliseconds on my i7.  Could you double check that it really is built as release mode?  Also, I noticed that your benchmark macro reports time incorrectly on my machine.  If you #include <pcl/common/time.h> , you can use it instead as:

double start;
#define BENCHMARK(x) start = pcl::getTime(); {x} printf("Line %d took %lf to execute\n", __LINE__, double(pcl::getTime()-start));

You're correct that indices from setIndices() are not used.  I'm not sure it makes sense to process a subset of a frame, so I didn't include this.

Regarding the large number of segments, it sounds like you're using a comparison function such that no two pixels are ever considered part of the same segment.  NaNs are ignored (not part of any segment).  Have a look at the apps/src/pcl_organized_segmentation_demo.cpp for a working example.  Hope this helps!

Cheers,
Alex

On Fri, Apr 13, 2012 at 12:21 AM, sjc266 <[hidden email]> wrote:
Hi Alex

http://www.pcl-users.org/file/n3907137/main.cpp Attached  (hope this works)
is my c++ file. It uses the OpenNIGrabber framework from the tutorials. As I
say, the segment() function takes between 3 and 9 seconds.

Currently I can see two issues:
- The segment function tests the entire cloud, not only those indices set by
setIndices(). This could be a conscious decision but I can't work out why.
- I'm finding 200,000 segments every frame. This happens even when I use a
trivial (always false) comparator. It still takes ages with this trivial
comparator.

Do you know how segment() deals with points with NaN values?

Cheers
Sam

--
View this message in context: http://www.pcl-users.org/Organized-Segmentation-unresolved-external-sybol-tp3901719p3907137.html
Sent from the Point Cloud Library (PCL) Users 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
|  
Report Content as Inappropriate

Re: Organized Segmentation unresolved external sybol

sjc266
Hi Alex, thanks for your help on this.

I don't have Qt (and don't have time to get it) so I couldn't try pcl_organized_segmentation_demo.cpp. but I did try openni_organized_multi_plane_segmentation.cpp, which had similarly poor performance on Release mode (see screenshot).

Alex Trevor wrote
You're correct that indices from setIndices() are not used.  I'm not sure it makes sense to process a subset of a frame, so I didn't include this.
Fair enough.

BREAKTHROUGH: After heaps of debugging I think I have the solution. segment() only checks if the x component is NaN, so I changed my for loop to set the all xyz-components of background points to NaN, not just z. This sped it up dramatically (~20ms for a mostly background scene, ~800ms with my hand in the foreground). It's not great, and it still doesn't explain why you got 25ms without setting x to NaN. But it's a start.

Could it be that my processor has met it's match?

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

Re: Organized Segmentation unresolved external sybol

peter9606
Did you also compile your PCL with Release flag ?
Loading...