CGR Localization
 All Classes Namespaces Files Functions Variables Macros Pages
PlanePolygon Class Reference

#include <plane_polygon.h>

Collaboration diagram for PlanePolygon:

Public Member Functions

 PlanePolygon ()
 Empty (default) constructor has nothing to do.
 
 PlanePolygon (vector< vector3f > points)
 Build polygon using given plane filtered points.
 
 PlanePolygon (vector< vector3f > points, vector< vector2i > _pixelLocs)
 Build polygon using given plane filtered points, and also saves the pixel locations.
 
 ~PlanePolygon ()
 Destructor.
 
double distFromPlane (vector3f p)
 Returns distance of specified point from the plane.
 
vector3f rayFromPlane (vector3f p)
 Returns ray perpendicular to the plane and pointing from the plane to the specified point p.
 
vector2f projectOnto (const vector3f &p) const
 Project 3D point onto the plane polygon and return corresponding 2D coordinates.
 
bool liesAlongside (const vector3f &p) const
 Returns true if the point, projected onto the plane, lies within the convex hull.
 
void merge (PlanePolygon &poly2)
 Merge this plane polygon with the one provided.
 
void merge (vector< PlanePolygon > &polygons)
 Merge this plane polygon with a set of other polygons.
 
void transform (vector3f translation, Quaternionf rotation)
 Transforms the plane polygon by the specified translation and rotation.
 
void transform (const GVector::matrix3d< float > &M)
 Transforms the plane polygon by the specified transformation matrix.
 
vector3f intersect (vector3f l0, vector3f l)
 Returns the point of intersection of the line =d*l+l0 and this plane.
 

Public Attributes

double numPoints
 Number of points used to build the polygon.
 
vector< vector2ipixelLocs
 Pixel locations of the points sampled from the depth image used to construct the polygon.
 
vector< vector3fvertices
 Vertices of the polygon.
 
vector< vector2fvertices2D
 Vertices projected onto the 2D basis vectors.
 
vector3f normal
 Normal to the plane.
 
vector3f p0
 Point on the plane corresponding to the centroid of the sampled points.
 
double offset
 Perpendicular offset of the plane from the origin.
 
vector3f b1
 Basis vectors on the plane. b1 corresponds to the major axis and b2 to the minor axis.
 
vector3f b2
 
double sum_xx
 Coefficients of the moments of the points.
 
double sum_yy
 
double sum_zz
 
double sum_xy
 
double sum_xz
 
double sum_yz
 
float width
 Rectangular dimensions of the polygon.
 
float height
 
vector2f min2D
 Rectangular extents of the polygon in 2D.
 
vector2f max2D
 
vector3f corners [4]
 Rectangular extents of the polygon in 3D.
 
bool validPolygon
 Indicates whether a valid convex plane polygon fit was copmuted or not.
 
double conditionNumber
 Ratio of the eigenvalues corresponding to the planar basis vectors.
 

Protected Member Functions

bool constructConvexPoly (vector< vector3f > &points)
 Construct boindary points to make a convex polygon.
 
bool computePlaneParameters (vector< vector3f > &points)
 Compute Plane normal, offset and scatter matrix coefficients from given points.
 

Protected Attributes

vector< vector2dnormals2D
 Normals to the edges. normals2D[i] is normal to the edge (vertices2D[i], vertices2D[i+1])
 
vector< vector2dedgeDir2D
 Unit vectors parallel to the edges. edgeDir2D[i] is parallel to the edge (vertices2D[i], vertices2D[i+1])
 
vector< double > edgeLengths
 Length of the edge (vertices2D[i], vertices2D[i+1])
 
vector< double > offsets2D
 Offsets to the edges such that for an interior point p, normals2D[i].dot(p)+offsets2D[i]> 0 for all i.
 
GrahamsScan grahamsScan
 Graham Scan class used to generate convex hull of the polygon.
 
Matrix3d m
 Matrices for computing optimal plane parameters.
 
Matrix3d eigenVectors
 
Vector3d eigenValues
 Eigenvectors of the plane scatter matrix.
 
SelfAdjointEigenSolver< Matrix3d > solver
 Solver to solve for optimal plane parameters.
 

Detailed Description

A class used to reprsesent a convex plane polygon with sampled points

Definition at line 48 of file plane_polygon.h.


The documentation for this class was generated from the following files: