# [OpenNI-dev] Get Kinect to ignore floor

23 messages
12
Open this post in threaded view
|

## [OpenNI-dev] Get Kinect to ignore floor

 Hi, I am working on a project where I am using the Kinect to plot a cloud of points, which I then apply feature recognition to. However at the moment I think the Kinect may be recording co-ordinates of the ground, which I would like to ignore. I thought all these points might be at a fixed negative y-value in the real world co-ordinates, but this doesn't seem to be the case. Has anyone got any ideas/had any experience with this? I have seen a a 'GetFloor' function mentioned but can't seem to find anything where it has been used to then ignore the floor? Thanks for your help! Emmi -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.
Open this post in threaded view
|

## Re: [OpenNI-dev] Get Kinect to ignore floor

 You need a Scene Analyzer node to compute that:xn::SceneAnalyzer xn_scene;[...]    /// Create a Scene Analyzer node    nRetVal = xn_scene.Create(context);     if (nRetVal != XN_STATUS_OK)    {        cerr << "Failed to create scene analyzer: " << xnGetStatusString(                nRetVal) << endl;    }            XnPlane3D floorCoords;             XnPoint3D floorPoint;            xnGetFloor(xn_scene, &floorCoords);            floorPoint = floorCoords.ptPoint;            cout << floorCoords.vNormal.X << " " << floorCoords.vNormal.Y << " " << floorCoords.vNormal.Z << endl;             cout << floorCoords.ptPoint.X << " " << floorCoords.ptPoint.Y << " " << floorCoords.ptPoint.Z  << "\n" << endl;You get the floor as Normal + Point on the floor. CarmeloVELARDO www.velardo.org On Thu, Apr 21, 2011 at 5:35 PM, emmatsu wrote: Hi, I am working on a project where I am using the Kinect to plot a cloud of points, which I then apply feature recognition to. However at the moment I think the Kinect may be recording co-ordinates of the ground, which I would like to ignore. I thought all these points might be at a fixed negative y-value in the real world co-ordinates, but this doesn't seem to be the case. Has anyone got any ideas/had any experience with this? I have seen a a 'GetFloor' function mentioned but can't seem to find anything where it has been used to then ignore the floor? Thanks for your help! Emmi -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en. -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.
Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

 Hi Carmelo, Thanks for your very quick reply! Just to double check I understand you correctly, floorCoords.vNormal describes the angle/function of the floor line, and floorPoint (floorCoords.ptPoint) describes a start point somewhere along the floor? Thanks again On Apr 21, 4:42 pm, CARMELO VELARDO <[hidden email]> wrote: > You need a Scene Analyzer node to compute that: > > xn::SceneAnalyzer xn_scene; > > [...] > >     /// Create a Scene Analyzer node >     nRetVal = xn_scene.Create(context); >     if (nRetVal != XN_STATUS_OK) >     { >         cerr << "Failed to create scene analyzer: " << xnGetStatusString( >                 nRetVal) << endl; >     } > >             XnPlane3D floorCoords; >             XnPoint3D floorPoint; > >             xnGetFloor(xn_scene, &floorCoords); > >             floorPoint = floorCoords.ptPoint; > >             cout << floorCoords.vNormal.X << " " << floorCoords.vNormal.Y << > " " << floorCoords.vNormal.Z << endl; >             cout << floorCoords.ptPoint.X << " " << floorCoords.ptPoint.Y << > " " << floorCoords.ptPoint.Z  << "\n" << endl; > > You get the floor as Normal + Point on the floor. > > CarmeloVELARDO* > * > > *www.velardo.org* > > On Thu, Apr 21, 2011 at 5:35 PM, emmatsu <[hidden email]> wrote: > > Hi, > > I am working on a project where I am using the Kinect to plot a cloud > > of points, which I then apply feature recognition to. However at the > > moment I think the Kinect may be recording co-ordinates of the ground, > > which I would like to ignore. I thought all these points might be at a > > fixed negative y-value in the real world co-ordinates, but this > > doesn't seem to be the case. > > > Has anyone got any ideas/had any experience with this? I have seen a a > > 'GetFloor' function mentioned but can't seem to find anything where it > > has been used to then ignore the floor? > > > Thanks for your help! > > Emmi > > > -- > > You received this message because you are subscribed to the Google Groups > > "OpenNI" group. > > To post to this group, send email to [hidden email]. > > To unsubscribe from this group, send email to > > [hidden email]. > > For more options, visit this group at > >http://groups.google.com/group/openni-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.
Open this post in threaded view
|

## Re: [OpenNI-dev] Re: Get Kinect to ignore floor

 Mmm,In a more formal mathematical (actually geometry) languageto define a plane you can use a form called Normal + Point.The Normal is just a vector at the origin that indicates the orientation of the plane (yep, call it angle) the point is just one point that lies in the specific plane.Fusing together both information you have the equation of the plane in the canonic formax + by + cz = dMore info here http://goo.gl/p5FHV On Thu, Apr 21, 2011 at 11:09 PM, emmatsu wrote: Hi Carmelo, Thanks for your very quick reply! Just to double check I understand you correctly, floorCoords.vNormal describes the angle/function of the floor line, and floorPoint (floorCoords.ptPoint) describes a start point somewhere along the floor? Thanks again On Apr 21, 4:42 pm, CARMELO VELARDO <[hidden email]> wrote: > You need a Scene Analyzer node to compute that: > > xn::SceneAnalyzer xn_scene; > > [...] > >     /// Create a Scene Analyzer node >     nRetVal = xn_scene.Create(context); >     if (nRetVal != XN_STATUS_OK) >     { >         cerr << "Failed to create scene analyzer: " << xnGetStatusString( >                 nRetVal) << endl; >     } > >             XnPlane3D floorCoords; >             XnPoint3D floorPoint; > >             xnGetFloor(xn_scene, &floorCoords); > >             floorPoint = floorCoords.ptPoint; > >             cout << floorCoords.vNormal.X << " " << floorCoords.vNormal.Y << > " " << floorCoords.vNormal.Z << endl; >             cout << floorCoords.ptPoint.X << " " << floorCoords.ptPoint.Y << > " " << floorCoords.ptPoint.Z  << "\n" << endl; > > You get the floor as Normal + Point on the floor. > > CarmeloVELARDO* > * > > *www.velardo.org* > > On Thu, Apr 21, 2011 at 5:35 PM, emmatsu <[hidden email]> wrote: > > Hi, > > I am working on a project where I am using the Kinect to plot a cloud > > of points, which I then apply feature recognition to. However at the > > moment I think the Kinect may be recording co-ordinates of the ground, > > which I would like to ignore. I thought all these points might be at a > > fixed negative y-value in the real world co-ordinates, but this > > doesn't seem to be the case. > > > Has anyone got any ideas/had any experience with this? I have seen a a > > 'GetFloor' function mentioned but can't seem to find anything where it > > has been used to then ignore the floor? > > > Thanks for your help! > > Emmi > > > -- > > You received this message because you are subscribed to the Google Groups > > "OpenNI" group. > > To post to this group, send email to [hidden email]. > > To unsubscribe from this group, send email to > > [hidden email]. > > For more options, visit this group at > >http://groups.google.com/group/openni-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en. -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.
Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

 Great, so in the above a would be floorCoords.vNormal.X, x would be floorCoords.ptPoint.X etc? Also do you have any idea how accurate this function actually is? Thanks! Emmi On Apr 22, 12:04 am, CARMELO VELARDO <[hidden email]> wrote: > Mmm, > > In a more formal mathematical (actually geometry) language > to define a plane you can use a form called Normal + Point. > > The Normal is just a vector at the origin that indicates the orientation of > the plane (yep, call it angle) > the point is just one point that lies in the specific plane. > > Fusing together both information you have the equation of the plane in the > canonic form > > ax + by + cz = d > > More info herehttp://goo.gl/p5FHV* > * > > On Thu, Apr 21, 2011 at 11:09 PM, emmatsu <[hidden email]> wrote: > > Hi Carmelo, > > Thanks for your very quick reply! Just to double check I understand > > you correctly, floorCoords.vNormal describes the angle/function of the > > floor line, and floorPoint (floorCoords.ptPoint) describes a start > > point somewhere along the floor? > > > Thanks again > > > On Apr 21, 4:42 pm, CARMELO VELARDO <[hidden email]> wrote: > > > You need a Scene Analyzer node to compute that: > > > > xn::SceneAnalyzer xn_scene; > > > > [...] > > > >     /// Create a Scene Analyzer node > > >     nRetVal = xn_scene.Create(context); > > >     if (nRetVal != XN_STATUS_OK) > > >     { > > >         cerr << "Failed to create scene analyzer: " << xnGetStatusString( > > >                 nRetVal) << endl; > > >     } > > > >             XnPlane3D floorCoords; > > >             XnPoint3D floorPoint; > > > >             xnGetFloor(xn_scene, &floorCoords); > > > >             floorPoint = floorCoords.ptPoint; > > > >             cout << floorCoords.vNormal.X << " " << floorCoords.vNormal.Y > > << > > > " " << floorCoords.vNormal.Z << endl; > > >             cout << floorCoords.ptPoint.X << " " << floorCoords.ptPoint.Y > > << > > > " " << floorCoords.ptPoint.Z  << "\n" << endl; > > > > You get the floor as Normal + Point on the floor. > > > > CarmeloVELARDO* > > > * > > > > *www.velardo.org* > > > > On Thu, Apr 21, 2011 at 5:35 PM, emmatsu <[hidden email]> > > wrote: > > > > Hi, > > > > I am working on a project where I am using the Kinect to plot a cloud > > > > of points, which I then apply feature recognition to. However at the > > > > moment I think the Kinect may be recording co-ordinates of the ground, > > > > which I would like to ignore. I thought all these points might be at a > > > > fixed negative y-value in the real world co-ordinates, but this > > > > doesn't seem to be the case. > > > > > Has anyone got any ideas/had any experience with this? I have seen a a > > > > 'GetFloor' function mentioned but can't seem to find anything where it > > > > has been used to then ignore the floor? > > > > > Thanks for your help! > > > > Emmi > > > > > -- > > > > You received this message because you are subscribed to the Google > > Groups > > > > "OpenNI" group. > > > > To post to this group, send email to [hidden email]. > > > > To unsubscribe from this group, send email to > > > > [hidden email]. > > > > For more options, visit this group at > > > >http://groups.google.com/group/openni-dev?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "OpenNI" group. > > To post to this group, send email to [hidden email]. > > To unsubscribe from this group, send email to > > [hidden email]. > > For more options, visit this group at > >http://groups.google.com/group/openni-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.
Open this post in threaded view
|

## Re: [OpenNI-dev] Re: Get Kinect to ignore floor

 $n_x (x-x_0)+ n_y(y-y_0)+ n_z(z-z_0)=0,\,$where ni represents the normal components. With some math you get in the end:nx X + ny Y + nz Z = (nx x0 + ny y0 + nz z0)this is just an equation that represent the floor.In order to discard the floor you should get the Y parameters correspondent to a given pair of X and Z. You should get some values of Y in a spaced grid and in macro areas remove all the points that have that Y value (which lay on the floor). I don't know how much precise this is probably they try to fit a model, even if my experience with PCL and RANSAC tells me they compute an approximation.(Anyone of Primesense can disclose something about?) CarmeloVELARDO www.velardo.org On Fri, Apr 22, 2011 at 11:17 PM, emmatsu wrote: Great, so in the above a would be floorCoords.vNormal.X, x would be floorCoords.ptPoint.X etc? Also do you have any idea how accurate this function actually is? Thanks! Emmi On Apr 22, 12:04 am, CARMELO VELARDO <[hidden email]> wrote: > Mmm, > > In a more formal mathematical (actually geometry) language > to define a plane you can use a form called Normal + Point. > > The Normal is just a vector at the origin that indicates the orientation of > the plane (yep, call it angle) > the point is just one point that lies in the specific plane. > > Fusing together both information you have the equation of the plane in the > canonic form > > ax + by + cz = d > > More info herehttp://goo.gl/p5FHV* > * > > On Thu, Apr 21, 2011 at 11:09 PM, emmatsu <[hidden email]> wrote: > > Hi Carmelo, > > Thanks for your very quick reply! Just to double check I understand > > you correctly, floorCoords.vNormal describes the angle/function of the > > floor line, and floorPoint (floorCoords.ptPoint) describes a start > > point somewhere along the floor? > > > Thanks again > > > On Apr 21, 4:42 pm, CARMELO VELARDO <[hidden email]> wrote: > > > You need a Scene Analyzer node to compute that: > > > > xn::SceneAnalyzer xn_scene; > > > > [...] > > > >     /// Create a Scene Analyzer node > > >     nRetVal = xn_scene.Create(context); > > >     if (nRetVal != XN_STATUS_OK) > > >     { > > >         cerr << "Failed to create scene analyzer: " << xnGetStatusString( > > >                 nRetVal) << endl; > > >     } > > > >             XnPlane3D floorCoords; > > >             XnPoint3D floorPoint; > > > >             xnGetFloor(xn_scene, &floorCoords); > > > >             floorPoint = floorCoords.ptPoint; > > > >             cout << floorCoords.vNormal.X << " " << floorCoords.vNormal.Y > > << > > > " " << floorCoords.vNormal.Z << endl; > > >             cout << floorCoords.ptPoint.X << " " << floorCoords.ptPoint.Y > > << > > > " " << floorCoords.ptPoint.Z  << "\n" << endl; > > > > You get the floor as Normal + Point on the floor. > > > > CarmeloVELARDO* > > > * > > > > *www.velardo.org* > > > > On Thu, Apr 21, 2011 at 5:35 PM, emmatsu <[hidden email]> > > wrote: > > > > Hi, > > > > I am working on a project where I am using the Kinect to plot a cloud > > > > of points, which I then apply feature recognition to. However at the > > > > moment I think the Kinect may be recording co-ordinates of the ground, > > > > which I would like to ignore. I thought all these points might be at a > > > > fixed negative y-value in the real world co-ordinates, but this > > > > doesn't seem to be the case. > > > > > Has anyone got any ideas/had any experience with this? I have seen a a > > > > 'GetFloor' function mentioned but can't seem to find anything where it > > > > has been used to then ignore the floor? > > > > > Thanks for your help! > > > > Emmi > > > > > -- > > > > You received this message because you are subscribed to the Google > > Groups > > > > "OpenNI" group. > > > > To post to this group, send email to [hidden email]. > > > > To unsubscribe from this group, send email to > > > > [hidden email]. > > > > For more options, visit this group at > > > >http://groups.google.com/group/openni-dev?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "OpenNI" group. > > To post to this group, send email to [hidden email]. > > To unsubscribe from this group, send email to > > [hidden email]. > > For more options, visit this group at > >http://groups.google.com/group/openni-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en. -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.
Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## Re: [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## Re: [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## Re: [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## Re: [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## Re: [OpenNI-dev] Re: Get Kinect to ignore floor

Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

 Still not working. I also tried WaitOneUpdateAll(sceneAn) but still only returns 0s! I have set   nRetVal = xnGetFloor(sceneAn,&floorCoords) and then enter a while loop, repeating while nRetVal != XN_STATUS_OK. This repeats infinitely. I assume this means the xnGetFloor does not complete successfully? How can I print what nRetVal (an XnStatus) is? Thanks On May 3, 6:03 pm, CARMELO VELARDO <[hidden email]> wrote: > I use > >     nRetVal = context.Wait*And*UpdateAll(); > > On Tue, May 3, 2011 at 6:50 PM, emmatsu <[hidden email]> wrote: > > I initiate the Context,DepthGen,SceneAnalyser in my C++ file, and just > > use the provided OpenNI libraries. I see no mention of setting a node > > type. > > > I successfully create the scene analyzer node, then call > > >  nRetVal = context.WaitOneUpdateAll(depthGen); > > > Once I have completed reading the depthMap (which still operates > > correctly) I call; > > >  xnGetFloor(sceneAn,&floorCoords); > > > which still records all 0s. Any ideas? > > Thanks! > > > On May 3, 5:37 pm, CARMELO VELARDO <[hidden email]> wrote: > > > I initialize the Kinect via an XML file ( Still using the old drivers, > > it's > > > safer for the moment ). > > > >  CarmeloVELARDO* > > > * > > > > *www.velardo.org* > > > > On Tue, May 3, 2011 at 5:35 PM, emmatsu <[hidden email]> > > wrote: > > > > Sorry Carmelo, exactly which file are you talking about? > > > > I can't find a .xml file named anything similar to Kinect init... > > > > > On May 3, 1:54 pm, CARMELO VELARDO <[hidden email]> wrote: > > > > > You're welcome. > > > > > > In any case the MetaData are not of use for this example.* > > > > > *Do you have the* > > > > >       ** > > > > > * > > > > > >  into your XML Kinect init file? > > > > > > On Tue, May 3, 2011 at 12:23 PM, emmatsu <[hidden email]> > > > > wrote: > > > > > > Hmm ok I'm a bit useless so just want to double check. Have swapped > > > > > > the order so depth is generated first. > > > > > > > Then I do the following; > > > > > > >  xn_scene.GetMetaData(sc_metadata); > > > > > >  XnPlane3D floorCoords; > > > > > >  XnPoint3D floorPoint; > > > > > > >  nRetVal = xnGetFloor(xn_scene, &floorCoords); > > > > > > > However I'm clearly not using the Scene's Meta Data? Where should > > this > > > > > > be used? > > > > > > Thanks again for your prompt help Carmelo! > > > > > > > On May 3, 11:08 am, CARMELO VELARDO <[hidden email]> > > wrote: > > > > > > > mmm. > > > > > > > > I actually use it the opposite way. > > > > > > > I generate all the Depth information, and after I extract > > MetaData > > > > from > > > > > > the > > > > > > > image and extract floor information. > > > > > > > > On Tue, May 3, 2011 at 11:57 AM, emmatsu < > > [hidden email]> > > > > > > wrote: > > > > > > > > I am calling the function after my Context has Started > > Generating > > > > All, > > > > > > > > and has been updating. i.e. the Scene Analyzer part is done > > just > > > > > > > > before my Depth Generator gets the depth map. > > > > > > > > > Surely it should be able to see the floor then? > > > > > > > > > Thanks! > > > > > > > > > On May 3, 10:50 am, CARMELO VELARDO <[hidden email] > > > > > wrote: > > > > > > > > > You have to call that function everytime the kinect "see" the > > > > > > > > > scene. > > > > > > > > > If not it cannot analyze the ambient and decide where the > > floor > > > > is. > > > > > > > > > > That should be why you get 0 everywhere. > > > > > > > > > > CarmeloVELARDO* > > > > > > > > > * > > > > > > > > > > *www.velardo.org* > > > > > > > > > > On Tue, May 3, 2011 at 11:44 AM, emmatsu < > > > > [hidden email]> > > > > > > > > wrote: > > > > > > > > > > Sorry for the late reply, I have been unable to get to my > > > > Kinect > > > > > > for > > > > > > > > > > several days. > > > > > > > > > > > I have tried above as suggested, but always get 0 for all > > the > > > > > > > > > > floorCoords values (vNormals and ptPoints). The Kinect is > > > > > > definitely > > > > > > > > > > working correctly as it is still picking up other points. > > Here > > > > is > > > > > > my > > > > > > > > > > code for the Scene Analyzer part. > > > > > > > > > > > xn::SceneAnalyzer xn_scene; > > > > > > > > > > >  nRetVal = xn_scene.Create(m_context); > > > > > > > > > >   if(nRetVal != XN_STATUS_OK) { > > > > > > > > > >         perror("Failed to create Scene Analyzer.\n"); > > > > > > > > > >   } > > > > > > > > > >  XnPlane3D floorCoords; > > > > > > > > > >  XnPoint3D floorPoint; > > > > > > > > > > >  xnGetFloor(xn_scene, &floorCoords); > > > > > > > > > > >  floorPoint = floorCoords.ptPoint; > > > > > > > > > >   printf("Normal X:%f Y:%f Z:%f\n", floorCoords.vNormal.X, > > > > > > > > > > floorCoords.vNormal.Y, floorCoords.vNormal.Z); > > > > > > > > > >  printf("Point X:%f Y:%f Z:%f\n", floorCoords.ptPoint.X, > > > > > > > > > > floorCoords.ptPoint.Y, floorCoords.ptPoint.Z); > > > > > > > > > > > Any ideas? Thanks! > > > > > > > > > > > On Apr 22, 11:28 pm, CARMELO VELARDO < > > > > [hidden email]> > > > > > > > > > > wrote: > > > > > > > > > > > [image: n_x (x-x_0)+ n_y(y-y_0)+ n_z(z-z_0)=0,\,]where > > *ni* > > > > > > > > represents > > > > > > > > > > the > > > > > > > > > > > normal components. > > > > > > > > > > > With some math you get in the end: > > > > > > > > > > > > *nx* X + *ny* Y + *nz* Z = (*nx x0* + *ny y0* + *nz z0*) > > > > > > > > > > > > this is just an equation that represent the floor. > > > > > > > > > > > In order to discard the floor you should get the Y > > parameters > > > > > > > > > > correspondent > > > > > > > > > > > to a given pair of X and Z. You should get some values of > > Y > > > > in a > > > > > > > > spaced > > > > > > > > > > grid > > > > > > > > > > > and in macro areas remove all the points that have that Y > > > > value > > > > > > > > (which > > > > > > > > > > lay > > > > > > > > > > > on the floor). > > > > > > > > > > > > I don't know how much precise this is probably they try > > to > > > > fit a > > > > > > > > model, > > > > > > > > > > even > > > > > > > > > > > if my experience with PCL and RANSAC tells me they > > compute an > > > > > > > > > > approximation. > > > > > > > > > > > > (Anyone of Primesense can disclose something about?) > > > > > > > > > > > > CarmeloVELARDO* > > > > > > > > > > > * > > > > > > > > > > > > *www.velardo.org* > > > > > > > > > > > > On Fri, Apr 22, 2011 at 11:17 PM, emmatsu < > > > > > > [hidden email]> > > > > > > > > > > wrote: > > > > > > > > > > > > Great, so in the above a would be > > floorCoords.vNormal.X, x > > > > > > would be > > > > > > > > > > > > floorCoords.ptPoint.X etc? > > > > > > > > > > > > > Also do you have any idea how accurate this function > > > > actually > > > > > > is? > > > > > > > > > > > > > Thanks! > > > > > > > > > > > > Emmi > > > > > > > > > > > > > On Apr 22, 12:04 am, CARMELO VELARDO < > > > > > > [hidden email]> > > > > > > > > > > > > wrote: > > > > > > > > > > > > > Mmm, > > > > > > > > > > > > > > In a more formal mathematical (actually geometry) > > > > language > > > > > > > > > > > > > to define a plane you can use a form called Normal + > > > > Point. > > > > > > > > > > > > > > The Normal is just a vector at the origin that > > indicates > > > > the > > > > > > > > > > orientation > > > > > > > > > > > > of > > > > > > > > > > > > > the plane (yep, call it angle) > > > > > > > > > > > > > the point is just one point that lies in the specific > > > > plane. > > > > > > > > > > > > > > Fusing together both information you have the > > equation of > > > > the > > > > > > > > plane > > > > > > > > > > in > > > > > > > > > > > > the > > > > > > > > > > > > > canonic form > > > > > > > > > > > > > > ax + by + cz = d > > > > > > > > > > > > > > More info herehttp://goo.gl/p5FHV* > > > > > > > > > > > > > * > > > > > > > > > > > > > > On Thu, Apr 21, 2011 at 11:09 PM, emmatsu < > > > > > > > > [hidden email]> > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > Hi Carmelo, > > > > > > > > > > > > > > Thanks for your very quick reply! Just to double > > check > > > > I > > > > > > > > understand > > > > > > > > > > > > > > you correctly, floorCoords.vNormal describes the > > > > > > angle/function > > > > > > > > of > > > > > > > > > > the > > > > > > > > > > > > > > floor line, and floorPoint (floorCoords.ptPoint) > > > > describes > > > > > > a > > > > > > > > start > > > > > > > > > > > > > > point somewhere along the floor? > > > > > > > > > > > > > > > Thanks again > > > > > > > > > > > > > > > On Apr 21, 4:42 pm, CARMELO VELARDO < > > > > > > [hidden email] > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > You need a Scene Analyzer node to compute that: > > > > > > > > > > > > > > > > xn::SceneAnalyzer xn_scene; > > > > > > > > > > > > > > > > [...] > > > > > > > > > > > > > > > >     /// Create a Scene Analyzer node > > > > > > > > > > > > > > >     nRetVal = xn_scene.Create(context); > > > > > > > > > > > > > > >     if (nRetVal != XN_STATUS_OK) > > > > > > > > > > > > > > >     { > > > > > > > > > > > > > > >         cerr << "Failed to create scene analyzer: > > " > > > > << > > > > > > > > > > > > xnGetStatusString( > > > > > > > > > > > > > > >                 nRetVal) << endl; > > > > > > > > > > > > > > >     } > > > > > > > > > > > > > > > >             XnPlane3D floorCoords; > > > > > > > > > > > > > > >             XnPoint3D floorPoint; > > > > > > > > > > > > > > > >             xnGetFloor(xn_scene, &floorCoords); > > > > > > > > > > > > > > > >             floorPoint = floorCoords.ptPoint; > > > > > > > > > > > > > > > >             cout << floorCoords.vNormal.X << " " > > << > > > > > > > > > > > > floorCoords.vNormal.Y > > > > > > > > > > > > > > << > > > > > > > > > > > > > > > " " << floorCoords.vNormal.Z << endl; > > > > > > > > > > > > > > >             cout << floorCoords.ptPoint.X << " " > > << > > > > > > > > > > > > floorCoords.ptPoint.Y > > > > > > > > > > > > > > << > > > > > > > > > > > > > > > " " << floorCoords.ptPoint.Z  << "\n" << endl; > > > > > > > > > > > > > > > > You get the floor as Normal + Point on the floor. > > > > > > > > > > > > > > > > CarmeloVELARDO* > > > > > > > > > > > > > > > * > > > > > > > > > > > > > > > > *www.velardo.org* > > > > > > > > > > > > > > > > On Thu, Apr 21, 2011 at 5:35 PM, emmatsu < > > > > > > > > > > [hidden email]> > > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > I am working on a project where I am using > > ... > > read more » -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.
Open this post in threaded view
|

## [OpenNI-dev] Re: Get Kinect to ignore floor

 Any help or ideas would really be appreciated as I am coming to the deadline now and still can't find a way to get the Kinect not to detect the floor!!! Thanks On May 3, 6:35 pm, emmatsu <[hidden email]> wrote: > Still not working. I also tried WaitOneUpdateAll(sceneAn) but still > only returns 0s! > I have set >   nRetVal = xnGetFloor(sceneAn,&floorCoords) > and then enter a while loop, repeating while nRetVal != XN_STATUS_OK. > This repeats infinitely. > > I assume this means the xnGetFloor does not complete successfully? How > can I print what nRetVal (an XnStatus) is? > > Thanks > > On May 3, 6:03 pm, CARMELO VELARDO <[hidden email]> wrote: > > > I use > > >     nRetVal = context.Wait*And*UpdateAll(); > > > On Tue, May 3, 2011 at 6:50 PM, emmatsu <[hidden email]> wrote: > > > I initiate the Context,DepthGen,SceneAnalyser in my C++ file, and just > > > use the provided OpenNI libraries. I see no mention of setting a node > > > type. > > > > I successfully create the scene analyzer node, then call > > > >  nRetVal = context.WaitOneUpdateAll(depthGen); > > > > Once I have completed reading the depthMap (which still operates > > > correctly) I call; > > > >  xnGetFloor(sceneAn,&floorCoords); > > > > which still records all 0s. Any ideas? > > > Thanks! > > > > On May 3, 5:37 pm, CARMELO VELARDO <[hidden email]> wrote: > > > > I initialize the Kinect via an XML file ( Still using the old drivers, > > > it's > > > > safer for the moment ). > > > > >  CarmeloVELARDO* > > > > * > > > > > *www.velardo.org* > > > > > On Tue, May 3, 2011 at 5:35 PM, emmatsu <[hidden email]> > > > wrote: > > > > > Sorry Carmelo, exactly which file are you talking about? > > > > > I can't find a .xml file named anything similar to Kinect init... > > > > > > On May 3, 1:54 pm, CARMELO VELARDO <[hidden email]> wrote: > > > > > > You're welcome. > > > > > > > In any case the MetaData are not of use for this example.* > > > > > > *Do you have the* > > > > > >       ** > > > > > > * > > > > > > >  into your XML Kinect init file? > > > > > > > On Tue, May 3, 2011 at 12:23 PM, emmatsu <[hidden email]> > > > > > wrote: > > > > > > > Hmm ok I'm a bit useless so just want to double check. Have swapped > > > > > > > the order so depth is generated first. > > > > > > > > Then I do the following; > > > > > > > >  xn_scene.GetMetaData(sc_metadata); > > > > > > >  XnPlane3D floorCoords; > > > > > > >  XnPoint3D floorPoint; > > > > > > > >  nRetVal = xnGetFloor(xn_scene, &floorCoords); > > > > > > > > However I'm clearly not using the Scene's Meta Data? Where should > > > this > > > > > > > be used? > > > > > > > Thanks again for your prompt help Carmelo! > > > > > > > > On May 3, 11:08 am, CARMELO VELARDO <[hidden email]> > > > wrote: > > > > > > > > mmm. > > > > > > > > > I actually use it the opposite way. > > > > > > > > I generate all the Depth information, and after I extract > > > MetaData > > > > > from > > > > > > > the > > > > > > > > image and extract floor information. > > > > > > > > > On Tue, May 3, 2011 at 11:57 AM, emmatsu < > > > [hidden email]> > > > > > > > wrote: > > > > > > > > > I am calling the function after my Context has Started > > > Generating > > > > > All, > > > > > > > > > and has been updating. i.e. the Scene Analyzer part is done > > > just > > > > > > > > > before my Depth Generator gets the depth map. > > > > > > > > > > Surely it should be able to see the floor then? > > > > > > > > > > Thanks! > > > > > > > > > > On May 3, 10:50 am, CARMELO VELARDO <[hidden email] > > > > > > wrote: > > > > > > > > > > You have to call that function everytime the kinect "see" the > > > > > > > > > > scene. > > > > > > > > > > If not it cannot analyze the ambient and decide where the > > > floor > > > > > is. > > > > > > > > > > > That should be why you get 0 everywhere. > > > > > > > > > > > CarmeloVELARDO* > > > > > > > > > > * > > > > > > > > > > > *www.velardo.org* > > > > > > > > > > > On Tue, May 3, 2011 at 11:44 AM, emmatsu < > > > > > [hidden email]> > > > > > > > > > wrote: > > > > > > > > > > > Sorry for the late reply, I have been unable to get to my > > > > > Kinect > > > > > > > for > > > > > > > > > > > several days. > > > > > > > > > > > > I have tried above as suggested, but always get 0 for all > > > the > > > > > > > > > > > floorCoords values (vNormals and ptPoints). The Kinect is > > > > > > > definitely > > > > > > > > > > > working correctly as it is still picking up other points. > > > Here > > > > > is > > > > > > > my > > > > > > > > > > > code for the Scene Analyzer part. > > > > > > > > > > > > xn::SceneAnalyzer xn_scene; > > > > > > > > > > > >  nRetVal = xn_scene.Create(m_context); > > > > > > > > > > >   if(nRetVal != XN_STATUS_OK) { > > > > > > > > > > >         perror("Failed to create Scene Analyzer.\n"); > > > > > > > > > > >   } > > > > > > > > > > >  XnPlane3D floorCoords; > > > > > > > > > > >  XnPoint3D floorPoint; > > > > > > > > > > > >  xnGetFloor(xn_scene, &floorCoords); > > > > > > > > > > > >  floorPoint = floorCoords.ptPoint; > > > > > > > > > > >   printf("Normal X:%f Y:%f Z:%f\n", floorCoords.vNormal.X, > > > > > > > > > > > floorCoords.vNormal.Y, floorCoords.vNormal.Z); > > > > > > > > > > >  printf("Point X:%f Y:%f Z:%f\n", floorCoords.ptPoint.X, > > > > > > > > > > > floorCoords.ptPoint.Y, floorCoords.ptPoint.Z); > > > > > > > > > > > > Any ideas? Thanks! > > > > > > > > > > > > On Apr 22, 11:28 pm, CARMELO VELARDO < > > > > > [hidden email]> > > > > > > > > > > > wrote: > > > > > > > > > > > > [image: n_x (x-x_0)+ n_y(y-y_0)+ n_z(z-z_0)=0,\,]where > > > *ni* > > > > > > > > > represents > > > > > > > > > > > the > > > > > > > > > > > > normal components. > > > > > > > > > > > > With some math you get in the end: > > > > > > > > > > > > > *nx* X + *ny* Y + *nz* Z = (*nx x0* + *ny y0* + *nz z0*) > > > > > > > > > > > > > this is just an equation that represent the floor. > > > > > > > > > > > > In order to discard the floor you should get the Y > > > parameters > > > > > > > > > > > correspondent > > > > > > > > > > > > to a given pair of X and Z. You should get some values of > > > Y > > > > > in a > > > > > > > > > spaced > > > > > > > > > > > grid > > > > > > > > > > > > and in macro areas remove all the points that have that Y > > > > > value > > > > > > > > > (which > > > > > > > > > > > lay > > > > > > > > > > > > on the floor). > > > > > > > > > > > > > I don't know how much precise this is probably they try > > > to > > > > > fit a > > > > > > > > > model, > > > > > > > > > > > even > > > > > > > > > > > > if my experience with PCL and RANSAC tells me they > > > compute an > > > > > > > > > > > approximation. > > > > > > > > > > > > > (Anyone of Primesense can disclose something about?) > > > > > > > > > > > > > CarmeloVELARDO* > > > > > > > > > > > > * > > > > > > > > > > > > > *www.velardo.org* > > > > > > > > > > > > > On Fri, Apr 22, 2011 at 11:17 PM, emmatsu < > > > > > > > [hidden email]> > > > > > > > > > > > wrote: > > > > > > > > > > > > > Great, so in the above a would be > > > floorCoords.vNormal.X, x > > > > > > > would be > > > > > > > > > > > > > floorCoords.ptPoint.X etc? > > > > > > > > > > > > > > Also do you have any idea how accurate this function > > > > > actually > > > > > > > is? > > > > > > > > > > > > > > Thanks! > > > > > > > > > > > > > Emmi > > > > > > > > > > > > > > On Apr 22, 12:04 am, CARMELO VELARDO < > > > > > > > [hidden email]> > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > Mmm, > > > > > > > > > > > > > > > In a more formal mathematical (actually geometry) > > > > > language > > > > > > > > > > > > > > to define a plane you can use a form called Normal + > > > > > Point. > > > > > > > > > > > > > > > The Normal is just a vector at the origin that > > > indicates > > > > > the > > > > > > > > > > > orientation > > > > > > > > > > > > > of > > > > > > > > > > > > > > the plane (yep, call it angle) > > > > > > > > > > > > > > the point is just one point that lies in the specific > > > > > plane. > > > > > > > > > > > > > > > Fusing together both information you have the > > > equation of > > > > > the > > > > > > > > > plane > > > > > > > > > > > in > > > > > > > > > > > > > the > > > > > > > > > > > > > > canonic form > > > > > > > > > > > > > > > ax + by + cz = d > > > > > > > > > > > > > > > More info herehttp://goo.gl/p5FHV* > > > > > > > > > > > > > > * > > > > > > > > > > > > > > > On Thu, Apr 21, 2011 at 11:09 PM, emmatsu < > > > > > > > > > [hidden email]> > > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > Hi Carmelo, > > > > > > > > > > > > > > > Thanks for your very quick reply! Just to double > > > check > > > > > I > > > > > > > > > understand > > > > > > > > > > > > > > > you correctly, floorCoords.vNormal describes the > > > > > > > angle/function > > > > > > > > > of > > > > > > > > > > > the > > > > > > > > > > > > > > > floor line, and floorPoint (floorCoords.ptPoint) > > > > > describes > > > > > > > a > > > > > > > > > start > > > > > > > > > > > > > > > point somewhere along the floor? > > > > > > > > > > > > > > > > Thanks again > > > > > > > > > > > > > > > > On Apr 21, 4:42 pm, CARMELO VELARDO < > > > > > > > [hidden email] > > > > > > > > > > > > wrote: > > > > > > > > > > > > > > > > You need a Scene Analyzer node to compute that: > > > > > > > > > > > > > > > > > xn::SceneAnalyzer xn_scene; > > > > > > > > > > > > > > > > > [...] > > > > > > > > > > > > > > > > >     /// Create a Scene Analyzer node > > > > > > > > > > > > > > > >     nRetVal = xn_scene.Create(context); > > > > > > > > > > > > > > > >     if (nRetVal != XN_STATUS_OK) > > > > > > > > > > > > > > > >     { > > > > > > > > > > > > > > > >         cerr << "Failed to create scene analyzer: > > > " > > > > > << > > > > > > > > > > > > > xnGetStatusString( > > > > > > > > > > > > > > > >                 nRetVal) << endl; > > > > > > > > > > > > > > > >     } > > > > > > > > > > > > > > > > >             XnPlane3D floorCoords; > > > > > > > > > > > > > > > >             XnPoint3D floorPoint; > > ... > > read more » -- You received this message because you are subscribed to the Google Groups "OpenNI" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/openni-dev?hl=en.
Open this post in threaded view
|