From pcl-users-bounces@code.ros.org  Tue Jul 26 14:38:23 2011
Return-Path: <pcl-users-bounces@code.ros.org>
X-Original-To: www-data@code.ros.org
Delivered-To: www-data@code.ros.org
Received: from pub5.willowgarage.com (localhost [127.0.0.1])
	by pub5.willowgarage.com (Postfix) with ESMTP id 5BD4B680C6;
	Tue, 26 Jul 2011 14:38:23 -0700 (PDT)
X-Original-To: pcl-users@code.ros.org
Delivered-To: pcl-users@code.ros.org
Received: from mail-gy0-f174.google.com (mail-gy0-f174.google.com
	[209.85.160.174])
	by pub5.willowgarage.com (Postfix) with ESMTPS id 47A0525C851
	for <pcl-users@code.ros.org>; Tue, 26 Jul 2011 14:38:22 -0700 (PDT)
Received: by gyh3 with SMTP id 3so787794gyh.5
	for <pcl-users@code.ros.org>; Tue, 26 Jul 2011 14:38:21 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.142.249.30 with SMTP id w30mr3919448wfh.122.1311716300716;
	Tue, 26 Jul 2011 14:38:20 -0700 (PDT)
Received: by 10.143.66.2 with HTTP; Tue, 26 Jul 2011 14:38:20 -0700 (PDT)
In-Reply-To: <4E2F2ABD.9010507@willowgarage.com>
References: <DUB108-W470D5C2F991003A571EA8EC14C0@phx.gbl>
	<4E26FC04.3060509@willowgarage.com>
	<DUB108-W3FF4A8A225407136EDCA3C14C0@phx.gbl>
	<4E274CC5.9020306@willowgarage.com>
	<DUB108-W36EDF5194A560EEBC42E99C14E0@phx.gbl>
	<4E2F262D.3000808@willowgarage.com>
	<CAEAyoY+FB74vVgVz9xEdu4LY+HjTLWpqTfERnr=G352b1yPfBg@mail.gmail.com>
	<4E2F2ABD.9010507@willowgarage.com>
Date: Tue, 26 Jul 2011 14:38:20 -0700
Message-ID: <CAGR68qao4FSUHSspJH1_82MgZpXnJu9g5mCrdsp9=BapNE212A@mail.gmail.com>
From: Suat Gedikli <gedikli@willowgarage.com>
To: "Radu B. Rusu" <rusu@willowgarage.com>,
 "Point Cloud Library (PCL) mailing list" <pcl-users@code.ros.org>
Subject: Re: [PCL-users] Segment planes perpendicular to axis Z
X-BeenThere: pcl-users@code.ros.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: "Point Cloud Library \(PCL\) mailing list" <pcl-users@code.ros.org>
List-Id: "Point Cloud Library \(PCL\) mailing list" <pcl-users.code.ros.org>
List-Unsubscribe: <https://code.ros.org/mailman/listinfo/pcl-users>,
	<mailto:pcl-users-request@code.ros.org?subject=unsubscribe>
List-Archive: </lurker/list/pcl-users.html>
List-Post: <mailto:pcl-users@code.ros.org>
List-Help: <mailto:pcl-users-request@code.ros.org?subject=help>
List-Subscribe: <https://code.ros.org/mailman/listinfo/pcl-users>,
	<mailto:pcl-users-request@code.ros.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============6941896306109514497=="
Mime-version: 1.0
Sender: pcl-users-bounces@code.ros.org
Errors-To: pcl-users-bounces@code.ros.org

--===============6941896306109514497==
Content-Type: multipart/alternative; boundary=001636ed6ac5267b9f04a8ffc088

--001636ed6ac5267b9f04a8ffc088
Content-Type: text/plain; charset=ISO-8859-1

Just a short question: do you want to use RANSAC for that? since thats not
required if you know that the planes are perpendicular to the z-axis. All
points with similar z-values lie on a plane => you need just a clustering in
the 1-dimensional array consisting of the z-values of all points. The plane
parameters are then (0, 0, 1, -Zavg), with Zavg being the average of all
z-values within the cluster.
By programming this explicitly its should be much faster than any SAC
method, and also deterministic (depending on the clustering method used).

Or did i miss the point?

-Suat

On Tue, Jul 26, 2011 at 1:59 PM, Radu B. Rusu <rusu@willowgarage.com> wrote:

> Aaron,
>
> Sure. If I'm not mistaken, r1893 and r1894 are relevant:
>
> http://dev.pointclouds.org/projects/pcl/repository/revisions/1893
> http://dev.pointclouds.org/projects/pcl/repository/revisions/1894
>
> Cheers,
> Radu.
> --
> Point Cloud Library (PCL) - http://pointclouds.org
>
> On 07/26/2011 01:58 PM, Aaron O'Toole <airuno2L@gmail.com> wrote:
> > Radu,
> >
> > Would you mind letting me know which files you changed in response to
> this?
> >
> > Thanks,
> >
> >
> > On Tue, Jul 26, 2011 at 4:40 PM, Radu B. Rusu <rusu@willowgarage.com<mailto:
> rusu@willowgarage.com>> wrote:
> >
> >     Ruben,
> >
> >     I believe I fixed this in trunk and all branches. Can you please give
> it a try again?
> >
> >     Thank you in advance.
> >
> >     Cheers,
> >     Radu.
> >     --
> >     Point Cloud Library (PCL) - http://pointclouds.org
> >
> >     On 07/22/2011 07:01 AM, Ruben Ares wrote:
> >      > I've tried with a point cloud with 100 points, all of them with
> z=1.
> >      >
> >      > The next code (with eps angle corrected) doesn't find any plane.
> >      >
> >      > g.setModelType (pcl::SACMODEL_PERPENDICULAR_PLANE);
> >      > seg.setMethodType (pcl::SAC_RANSAC);
> >      > seg.setMaxIterations(1000);
> >      > seg.setDistanceThreshold (0.1);
> >      > seg.setAxis(Eigen::Vector3f(0,0,1));
> >      > seg.setEpsAngle (0.1);
> >      >
> >      > I'm going to create an issue on the tracker.
> >      >
> >      > Thanks for the help.
> >      > > Date: Wed, 20 Jul 2011 14:46:45 -0700
> >      > > From: rusu@willowgarage.com <mailto:rusu@willowgarage.com>
> >      > > To: pcl-users@code.ros.org <mailto:pcl-users@code.ros.org>
> >      > > CC: bladecsp@hotmail.com <mailto:bladecsp@hotmail.com>
> >      > > Subject: Re: [PCL-users] Segment planes perpendicular to axis Z
> >      > >
> >      > > Ruben,
> >      > >
> >      > >
> >      > >
> >      > > On 07/20/2011 02:26 PM, Ruben Ares wrote:
> >      > > > Are there any restrictions in the segmentation module about
> the coordinate system? I'm only need planes
> >      > perpendicular to
> >      > > > my Z-axis and I don't understad why the coordinate system must
> be relevant.
> >      > >
> >      > > Nope, there are no restrictions. Ok, so you want planes
> perpendicular to your camera's Z. That's easy.
> >      > >
> >      > > > The scene has that kind of planes but the next code doesn't
> find any of them.
> >      > > >
> >      > > > seg.setModelType (pcl::SACMODEL_PERPENDICULAR_PLANE);
> >      > > > seg.setMethodType (pcl::SAC_RANSAC);
> >      > > > seg.setMaxIterations(1000);
> >      > > > seg.setDistanceThreshold (0.05);
> >      > > > seg.setAxis(Eigen::Vector3f(0,0,1));
> >      > > > seg.setEpsAngle (0);
> >      > >
> >      > > I think the last call might be the reason for that. You specify
> an absolute threshold of "0" radians, which
> >     means you
> >      > > want the plane to be perfect. We seem to have introduced a
> condition that says that the angle has to be larger
> >     than 0
> >      > > here (check sac_model_perpendicular_plane.hpp, line 85 in
> trunk), which could be both a bug and a feature :)
> >     (meaning
> >      > > that we're flexible with respect to changing this condition).
> >      > >
> >      > > As far as I remember the reason for this check is that we need a
> bit of wiggle room for the sample consensus
> >     methods in
> >      > > terms of getting their samples, otherwise we risk at spending
> more time in the loop (overconstraining the
> >     system). This
> >      > > should not affect the end results, meaning that if your plane is
> perfectly perpendicular you will still get it.
> >     The only
> >      > > time this assumption would break is if you would have 2 planes
> within that tolerance threshold with the exact
> >     number of
> >      > > points, and for some reason you want to differentiate between
> them.
> >      > >
> >      > > So basically you need so specify a small tolerance (0.01 radians
> is good enough if you know for a fact that
> >     your plane's
> >      > > equation is perfectly perpendicular to Z) in order for this to
> kick in. I just updated the documentation to
> >     point this
> >      > > thing. Sorry for not mentioning this earlier.
> >      > >
> >      > > If you still have problems with this, can you please create an
> issue on our tracker
> >     (http://dev.pointclouds.org) with a
> >      > > simple dataset and a minimal code example so we can reproduce
> the error and try to fix it? Thanks.
> >      > >
> >      > > Cheers,
> >      > > Radu.
> >      >
> >      >
> >      > _______________________________________________
> >      > PCL-users@code.ros.org <mailto:PCL-users@code.ros.org> /
> http://pointclouds.org
> >      > https://code.ros.org/mailman/listinfo/pcl-users
> >     _______________________________________________
> >     PCL-users@code.ros.org <mailto:PCL-users@code.ros.org> /
> http://pointclouds.org
> >     https://code.ros.org/mailman/listinfo/pcl-users
> >
> >
> >
> >
> > --
> > - Aaron O'Toole
> _______________________________________________
> PCL-users@code.ros.org / http://pointclouds.org
> https://code.ros.org/mailman/listinfo/pcl-users
>

--001636ed6ac5267b9f04a8ffc088
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Just a short question: do you want to use RANSAC for that? since thats not =
required if you know that the planes are perpendicular to the z-axis. All p=
oints with similar z-values lie on a plane =3D&gt; you need just a clusteri=
ng in the 1-dimensional array consisting of the z-values of all points. The=
 plane parameters are then (0, 0, 1, -Zavg), with Zavg being the average of=
 all z-values within the cluster.<div>
By programming this=A0explicitly=A0its should be much faster than any SAC m=
ethod, and also deterministic (depending on the clustering method used).<di=
v><br></div><div>Or did i miss the point?</div><div><br></div><div>-Suat</d=
iv>
<div><br><div class=3D"gmail_quote">On Tue, Jul 26, 2011 at 1:59 PM, Radu B=
. Rusu <span dir=3D"ltr">&lt;<a href=3D"mailto:rusu@willowgarage.com">rusu@=
willowgarage.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Aaron,<br>
<br>
Sure. If I&#39;m not mistaken, r1893 and r1894 are relevant:<br>
<br>
<a href=3D"http://dev.pointclouds.org/projects/pcl/repository/revisions/189=
3" target=3D"_blank">http://dev.pointclouds.org/projects/pcl/repository/rev=
isions/1893</a><br>
<a href=3D"http://dev.pointclouds.org/projects/pcl/repository/revisions/189=
4" target=3D"_blank">http://dev.pointclouds.org/projects/pcl/repository/rev=
isions/1894</a><br>
<div class=3D"im"><br>
Cheers,<br>
Radu.<br>
--<br>
Point Cloud Library (PCL) - <a href=3D"http://pointclouds.org" target=3D"_b=
lank">http://pointclouds.org</a><br>
<br>
</div><div class=3D"im">On 07/26/2011 01:58 PM, Aaron O&#39;Toole &lt;<a hr=
ef=3D"mailto:airuno2L@gmail.com">airuno2L@gmail.com</a>&gt; wrote:<br>
&gt; Radu,<br>
&gt;<br>
&gt; Would you mind letting me know which files you changed in response to =
this?<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt;<br>
</div><div class=3D"im">&gt; On Tue, Jul 26, 2011 at 4:40 PM, Radu B. Rusu =
&lt;<a href=3D"mailto:rusu@willowgarage.com">rusu@willowgarage.com</a> &lt;=
mailto:<a href=3D"mailto:rusu@willowgarage.com">rusu@willowgarage.com</a>&g=
t;&gt; wrote:<br>

&gt;<br>
&gt; =A0 =A0 Ruben,<br>
&gt;<br>
&gt; =A0 =A0 I believe I fixed this in trunk and all branches. Can you plea=
se give it a try again?<br>
&gt;<br>
&gt; =A0 =A0 Thank you in advance.<br>
&gt;<br>
&gt; =A0 =A0 Cheers,<br>
&gt; =A0 =A0 Radu.<br>
&gt; =A0 =A0 --<br>
&gt; =A0 =A0 Point Cloud Library (PCL) - <a href=3D"http://pointclouds.org"=
 target=3D"_blank">http://pointclouds.org</a><br>
&gt;<br>
&gt; =A0 =A0 On 07/22/2011 07:01 AM, Ruben Ares wrote:<br>
&gt; =A0 =A0 =A0&gt; I&#39;ve tried with a point cloud with 100 points, all=
 of them with z=3D1.<br>
&gt; =A0 =A0 =A0&gt;<br>
&gt; =A0 =A0 =A0&gt; The next code (with eps angle corrected) doesn&#39;t f=
ind any plane.<br>
&gt; =A0 =A0 =A0&gt;<br>
&gt; =A0 =A0 =A0&gt; g.setModelType (pcl::SACMODEL_PERPENDICULAR_PLANE);<br=
>
&gt; =A0 =A0 =A0&gt; seg.setMethodType (pcl::SAC_RANSAC);<br>
&gt; =A0 =A0 =A0&gt; seg.setMaxIterations(1000);<br>
&gt; =A0 =A0 =A0&gt; seg.setDistanceThreshold (0.1);<br>
&gt; =A0 =A0 =A0&gt; seg.setAxis(Eigen::Vector3f(0,0,1));<br>
&gt; =A0 =A0 =A0&gt; seg.setEpsAngle (0.1);<br>
&gt; =A0 =A0 =A0&gt;<br>
&gt; =A0 =A0 =A0&gt; I&#39;m going to create an issue on the tracker.<br>
&gt; =A0 =A0 =A0&gt;<br>
&gt; =A0 =A0 =A0&gt; Thanks for the help.<br>
&gt; =A0 =A0 =A0&gt; &gt; Date: Wed, 20 Jul 2011 14:46:45 -0700<br>
</div>&gt; =A0 =A0 =A0&gt; &gt; From: <a href=3D"mailto:rusu@willowgarage.c=
om">rusu@willowgarage.com</a> &lt;mailto:<a href=3D"mailto:rusu@willowgarag=
e.com">rusu@willowgarage.com</a>&gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; To: <a href=3D"mailto:pcl-users@code.ros.org">pcl=
-users@code.ros.org</a> &lt;mailto:<a href=3D"mailto:pcl-users@code.ros.org=
">pcl-users@code.ros.org</a>&gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; CC: <a href=3D"mailto:bladecsp@hotmail.com">blade=
csp@hotmail.com</a> &lt;mailto:<a href=3D"mailto:bladecsp@hotmail.com">blad=
ecsp@hotmail.com</a>&gt;<br>
<div><div></div><div class=3D"h5">&gt; =A0 =A0 =A0&gt; &gt; Subject: Re: [P=
CL-users] Segment planes perpendicular to axis Z<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; Ruben,<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; On 07/20/2011 02:26 PM, Ruben Ares wrote:<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; Are there any restrictions in the segmentati=
on module about the coordinate system? I&#39;m only need planes<br>
&gt; =A0 =A0 =A0&gt; perpendicular to<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; my Z-axis and I don&#39;t understad why the =
coordinate system must be relevant.<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; Nope, there are no restrictions. Ok, so you want =
planes perpendicular to your camera&#39;s Z. That&#39;s easy.<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; The scene has that kind of planes but the ne=
xt code doesn&#39;t find any of them.<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; seg.setModelType (pcl::SACMODEL_PERPENDICULA=
R_PLANE);<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; seg.setMethodType (pcl::SAC_RANSAC);<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; seg.setMaxIterations(1000);<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; seg.setDistanceThreshold (0.05);<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; seg.setAxis(Eigen::Vector3f(0,0,1));<br>
&gt; =A0 =A0 =A0&gt; &gt; &gt; seg.setEpsAngle (0);<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; I think the last call might be the reason for tha=
t. You specify an absolute threshold of &quot;0&quot; radians, which<br>
&gt; =A0 =A0 means you<br>
&gt; =A0 =A0 =A0&gt; &gt; want the plane to be perfect. We seem to have int=
roduced a condition that says that the angle has to be larger<br>
&gt; =A0 =A0 than 0<br>
&gt; =A0 =A0 =A0&gt; &gt; here (check sac_model_perpendicular_plane.hpp, li=
ne 85 in trunk), which could be both a bug and a feature :)<br>
&gt; =A0 =A0 (meaning<br>
&gt; =A0 =A0 =A0&gt; &gt; that we&#39;re flexible with respect to changing =
this condition).<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; As far as I remember the reason for this check is=
 that we need a bit of wiggle room for the sample consensus<br>
&gt; =A0 =A0 methods in<br>
&gt; =A0 =A0 =A0&gt; &gt; terms of getting their samples, otherwise we risk=
 at spending more time in the loop (overconstraining the<br>
&gt; =A0 =A0 system). This<br>
&gt; =A0 =A0 =A0&gt; &gt; should not affect the end results, meaning that i=
f your plane is perfectly perpendicular you will still get it.<br>
&gt; =A0 =A0 The only<br>
&gt; =A0 =A0 =A0&gt; &gt; time this assumption would break is if you would =
have 2 planes within that tolerance threshold with the exact<br>
&gt; =A0 =A0 number of<br>
&gt; =A0 =A0 =A0&gt; &gt; points, and for some reason you want to different=
iate between them.<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; So basically you need so specify a small toleranc=
e (0.01 radians is good enough if you know for a fact that<br>
&gt; =A0 =A0 your plane&#39;s<br>
&gt; =A0 =A0 =A0&gt; &gt; equation is perfectly perpendicular to Z) in orde=
r for this to kick in. I just updated the documentation to<br>
&gt; =A0 =A0 point this<br>
&gt; =A0 =A0 =A0&gt; &gt; thing. Sorry for not mentioning this earlier.<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; If you still have problems with this, can you ple=
ase create an issue on our tracker<br>
&gt; =A0 =A0 (<a href=3D"http://dev.pointclouds.org" target=3D"_blank">http=
://dev.pointclouds.org</a>) with a<br>
&gt; =A0 =A0 =A0&gt; &gt; simple dataset and a minimal code example so we c=
an reproduce the error and try to fix it? Thanks.<br>
&gt; =A0 =A0 =A0&gt; &gt;<br>
&gt; =A0 =A0 =A0&gt; &gt; Cheers,<br>
&gt; =A0 =A0 =A0&gt; &gt; Radu.<br>
&gt; =A0 =A0 =A0&gt;<br>
&gt; =A0 =A0 =A0&gt;<br>
&gt; =A0 =A0 =A0&gt; _______________________________________________<br>
</div></div>&gt; =A0 =A0 =A0&gt; <a href=3D"mailto:PCL-users@code.ros.org">=
PCL-users@code.ros.org</a> &lt;mailto:<a href=3D"mailto:PCL-users@code.ros.=
org">PCL-users@code.ros.org</a>&gt; / <a href=3D"http://pointclouds.org" ta=
rget=3D"_blank">http://pointclouds.org</a><br>

<div class=3D"im">&gt; =A0 =A0 =A0&gt; <a href=3D"https://code.ros.org/mail=
man/listinfo/pcl-users" target=3D"_blank">https://code.ros.org/mailman/list=
info/pcl-users</a><br>
&gt; =A0 =A0 _______________________________________________<br>
</div>&gt; =A0 =A0 <a href=3D"mailto:PCL-users@code.ros.org">PCL-users@code=
.ros.org</a> &lt;mailto:<a href=3D"mailto:PCL-users@code.ros.org">PCL-users=
@code.ros.org</a>&gt; / <a href=3D"http://pointclouds.org" target=3D"_blank=
">http://pointclouds.org</a><br>

<div class=3D"im">&gt; =A0 =A0 <a href=3D"https://code.ros.org/mailman/list=
info/pcl-users" target=3D"_blank">https://code.ros.org/mailman/listinfo/pcl=
-users</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; - Aaron O&#39;Toole<br>
</div><div><div></div><div class=3D"h5">___________________________________=
____________<br>
<a href=3D"mailto:PCL-users@code.ros.org">PCL-users@code.ros.org</a> / <a h=
ref=3D"http://pointclouds.org" target=3D"_blank">http://pointclouds.org</a>=
<br>
<a href=3D"https://code.ros.org/mailman/listinfo/pcl-users" target=3D"_blan=
k">https://code.ros.org/mailman/listinfo/pcl-users</a><br>
</div></div></blockquote></div><br></div></div>

--001636ed6ac5267b9f04a8ffc088--

--===============6941896306109514497==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
PCL-users@code.ros.org / http://pointclouds.org
https://code.ros.org/mailman/listinfo/pcl-users

--===============6941896306109514497==--

