Fawkes API  Fawkes Development Version
fawkes::pcl_utils::PolygonComparison Class Reference

Check if point is inside or outside a given polygon. More...

#include <comparisons.h>

List of all members.

Public Types

typedef boost::shared_ptr
< PolygonComparison< PointT > > 
Ptr
 Shared pointer.
typedef boost::shared_ptr
< const PolygonComparison
< PointT > > 
ConstPtr
 Constant shared pointer.

Public Member Functions

 PolygonComparison (const pcl::PointCloud< PointT > &polygon, bool inside=true)
 Constructor.
virtual ~PolygonComparison ()
 Virtual empty destructor.
virtual bool evaluate (const PointT &point) const
 Evaluate for given pixel.

Protected Attributes

bool inside_
 Flag to determine whether to do inside or outside check.
const pcl::PointCloud< PointT > & polygon_
 The polygon to check against.

Detailed Description

Check if point is inside or outside a given polygon.

This comparison determines if a given point is inside or outside a given polygon. A flag can be set to have an inside or outside check. The class uses pcl::isPointIn2DPolygon() to determine if the point is inside the polygon. Not that we assume planar data, for example points projected into a segmented plane.

Author:
Tim Niemueller

Member Typedef Documentation

typedef boost::shared_ptr<const PolygonComparison<PointT> > fawkes::pcl_utils::PolygonComparison::ConstPtr

Constant shared pointer.

Definition at line 54 of file comparisons.h.

typedef boost::shared_ptr<PolygonComparison<PointT> > fawkes::pcl_utils::PolygonComparison::Ptr

Shared pointer.

Definition at line 52 of file comparisons.h.


Constructor & Destructor Documentation

fawkes::pcl_utils::PolygonComparison::PolygonComparison ( const pcl::PointCloud< PointT > &  polygon,
bool  inside = true 
) [inline]

Constructor.

Parameters:
polygonpolygon to compare against, it must have at least three points
insideif true filter points inside the polygon, false for outside

Definition at line 60 of file comparisons.h.

virtual fawkes::pcl_utils::PolygonComparison::~PolygonComparison ( ) [inline, virtual]

Virtual empty destructor.

Definition at line 66 of file comparisons.h.


Member Function Documentation

virtual bool fawkes::pcl_utils::PolygonComparison::evaluate ( const PointT &  point) const [inline, virtual]

Evaluate for given pixel.

Parameters:
pointpoint to compare
Returns:
true if the point is inside/outside (depending on constructor parameter) the polygon, false otherwise

Definition at line 73 of file comparisons.h.


Member Data Documentation

Flag to determine whether to do inside or outside check.

Definition at line 83 of file comparisons.h.

const pcl::PointCloud<PointT>& fawkes::pcl_utils::PolygonComparison::polygon_ [protected]

The polygon to check against.

Definition at line 85 of file comparisons.h.


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