<div dir="ltr">Hi, Rebeca,<div><br></div><div>I do not see where you pass the &#39;cloud&#39; variable to &#39;detectPlanes&#39; function, is a global variable?</div><div><br></div><div>Anyway, is it necessary that you use the PCL library? Because in my component mapper3Drgbd [1], I use RANSAC to detect and extract planes from a point cloud; it may be helpful for your case. If you need more details, write me an email.</div><div><br></div><div>Best regards,</div><div>Juan</div><div><br></div><div>[1] <a href="http://svn.jderobot.org/users/jnbosgos/pfc-teleco/trunk/components/mapper3Drgbd/">http://svn.jderobot.org/users/jnbosgos/pfc-teleco/trunk/components/mapper3Drgbd/</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-02 23:10 GMT+02:00 rsaezd <span dir="ltr">&lt;<a href="mailto:rebeca.92.saez@gmail.com" target="_blank">rebeca.92.saez@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I&#39;m trying to detect planes in my cloud of points with PCL.<br>
I am using the following code to the official documentation of PCL:<br>
*<br>
void Gui::detectPlanes(Mat imageColor, Mat imageD){<br>
    PointCloudT::Ptr output(new PointCloudT);<br>
    pcl::ModelCoefficients::Ptr coefficients (new pcl::ModelCoefficients);<br>
    pcl::PointIndices::Ptr inliers (new pcl::PointIndices);<br>
    pcl::ExtractIndices&lt;pcl::PointXYZRGBA&gt; indice_extractor;<br>
    //Create the segmentation object<br>
    pcl::SACSegmentation&lt;pcl::PointXYZRGBA&gt; seg;<br>
    seg.setOptimizeCoefficients(true);<br>
    seg.setModelType(pcl::SACMODEL_PLANE);<br>
    seg.setMethodType(pcl::SAC_RANSAC);<br>
    int size= imageD.cols * imageD.rows;<br>
    seg.setMaxIterations(size);<br>
    seg.setDistanceThreshold(0.01);<br>
<br>
    int i = 0, nr_points = (int) cloud-&gt;points.size();<br>
    //While 30% of the original cloud is still there<br>
    while (cloud-&gt;points.size () &gt; 0.3 * nr_points){<br>
         //Segment the largest planar component from the remaining cloud<br>
        seg.setInputCloud(cloud);<br>
        seg.segment(*inliers, *coefficients);<br>
        //Extract the inliers<br>
        indice_extractor.setInputCloud(cloud);<br>
        indice_extractor.setIndices(inliers);<br>
        //Create the filtering object<br>
        indice_extractor.setNegative (true);<br>
        indice_extractor.filter (*output);<br>
        cloud.swap (output);<br>
        i++;<br>
    }<br>
<br>
    viewer-&gt;updatePointCloud(output, &quot;cloud&quot;);<br>
    qvtkWidget-&gt;update();<br>
}*<br>
<br>
But when I run my program, I do not visualize the segmented point cloud.<br>
Also, my program hangs.<br>
I looked documentation and several examples, but don&#39;t understand how I can<br>
do this,<br>
<br>
Can someone help me?<br>
<br>
Thanks and regards<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://jderobot-developer-list.2315034.n4.nabble.com/Detect-planes-with-pcl-tp4642655.html" target="_blank">http://jderobot-developer-list.2315034.n4.nabble.com/Detect-planes-with-pcl-tp4642655.html</a><br>
Sent from the Jderobot Developer List mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Jde-developers mailing list<br>
<a href="mailto:Jde-developers@gsyc.es">Jde-developers@gsyc.es</a><br>
<a href="http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers" target="_blank">http://gsyc.escet.urjc.es/cgi-bin/mailman/listinfo/jde-developers</a><br>
</blockquote></div><br></div>