A class used to store a planar feature (Plane for short).
It is described with geometric features representing the shape and relative location of the patch (area, normal vector, elongation, 3D-convex hull, etc.) and radiometric features (the most representative color).
#include <mrpt/pbmap/Plane.h>
Public Member Functions | |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void | operator delete (void *ptr) throw () |
void | operator delete[] (void *ptr) throw () |
void | operator delete (void *memory, void *ptr) throw () |
void * | operator new (size_t size, const std::nothrow_t &) throw () |
void | operator delete (void *ptr, const std::nothrow_t &) throw () |
Plane () | |
void | forcePtsLayOnPlane () |
void | calcConvexHull (pcl::PointCloud< pcl::PointXYZRGBA >::Ptr &pointCloud, std::vector< size_t > &indices=DEFAULT_VECTOR) |
! Calculate the plane's convex hull with the monotone chain algorithm. More... | |
void | calcConvexHullandParams (pcl::PointCloud< pcl::PointXYZRGBA >::Ptr &pointCloud, std::vector< size_t > &indices=DEFAULT_VECTOR) |
float | compute2DPolygonalArea () |
Compute the area of a 2D planar polygon patch - using a given normal. More... | |
void | computeMassCenterAndArea () |
Compute the patch's convex-hull area and mass center. More... | |
void | calcElongationAndPpalDir () |
bool | isPlaneNearby (Plane &plane, const float distThreshold) |
bool | isSamePlane (Plane &plane, const float &cosAngleThreshold, const float &distThreshold, const float &proxThreshold) |
bool | isSamePlane (Eigen::Matrix4f &Rt, Plane &plane_, const float &cosAngleThreshold, const float &distThreshold, const float &proxThreshold) |
bool | hasSimilarDominantColor (Plane &plane, const float colorThreshold) |
void | mergePlane (Plane &plane) |
void | mergePlane2 (Plane &plane) |
void | transform (Eigen::Matrix4f &Rt) |
void | calcMainColor () |
void | calcMainColor2 () |
void | calcPlaneHistH () |
virtual mxArray * | writeToMatlab () const |
Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More... | |
CObject * | clone () const |
Cloning interface for smart pointers. More... | |
RTTI classes and functions | |
mrpt::utils::CObjectPtr | duplicateGetSmartPtr () const |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More... | |
Static Public Member Functions | |
static void * | operator new (size_t size, void *ptr) |
Public Attributes | |
unsigned | id |
! Parameters to allow the plane-based representation of the map by a graph More... | |
unsigned | numObservations |
unsigned | semanticGroup |
std::set< unsigned > | nearbyPlanes |
std::map< unsigned, unsigned > | neighborPlanes |
std::string | label |
std::string | label_object |
std::string | label_context |
Eigen::Vector3f | v3center |
! Geometric description More... | |
Eigen::Vector3f | v3normal |
float | d |
Eigen::Matrix4f | information |
float | curvature |
Eigen::Vector3f | v3PpalDir |
float | elongation |
float | areaVoxels |
float | areaHull |
bool | bFullExtent |
bool | bFromStructure |
unsigned | nFramesAreaIsStable |
Eigen::Vector3f | v3colorNrgb |
! Radiometric description More... | |
float | dominantIntensity |
bool | bDominantColor |
Eigen::Vector3f | v3colorNrgbDev |
Eigen::Vector3f | v3colorC1C2C3 |
std::vector< float > | hist_H |
std::vector< double > | prog_area |
std::vector< double > | prog_elongation |
std::vector< Eigen::Vector3f > | prog_C1C2C3 |
std::vector< Eigen::Vector3f > | prog_Nrgb |
std::vector< float > | prog_intensity |
std::vector< std::vector< float > > | prog_hist_H |
std::vector< int32_t > | inliers |
! Convex Hull More... | |
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr | polygonContourPtr |
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr | outerPolygonPtr |
pcl::PointCloud< pcl::PointXYZRGBA >::Ptr | planePointCloudPtr |
Static Public Attributes | |
static const mrpt::utils::TRuntimeClassId | classCObject |
RTTI stuff | |
static const mrpt::utils::TRuntimeClassId | classCSerializable |
Protected Member Functions | |
CSerializable virtual methods | |
void | writeToStream (mrpt::utils::CStream &out, int *getVersion) const |
*---------------------------------------------------------—— More... | |
void | readFromStream (mrpt::utils::CStream &in, int version) |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More... | |
Private Member Functions | |
void | getPlaneNrgb () |
void | getPlaneC1C2C3 () |
Private Attributes | |
std::vector< float > | r |
std::vector< float > | g |
std::vector< float > | b |
std::vector< float > | intensity |
std::vector< float > | c1 |
std::vector< float > | c2 |
std::vector< float > | c3 |
RTTI stuff | |
typedef PlanePtr | Ptr |
typedef PlanePtr | ConstPtr |
static mrpt::utils::CLASSINIT | _init_Plane |
static mrpt::utils::TRuntimeClassId | classPlane |
static const mrpt::utils::TRuntimeClassId * | classinfo |
static const mrpt::utils::TRuntimeClassId * | _GetBaseClass () |
virtual const mrpt::utils::TRuntimeClassId * | GetRuntimeClass () const |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::utils::CObject * | duplicate () const |
Returns a copy of the object, indepently of its class. More... | |
static mrpt::utils::CObject * | CreateObject () |
static PlanePtr | Create () |
typedef PlanePtr mrpt::pbmap::Plane::ConstPtr |
typedef PlanePtr mrpt::pbmap::Plane::Ptr |
|
staticprotected |
void Plane::calcConvexHull | ( | pcl::PointCloud< pcl::PointXYZRGBA >::Ptr & | pointCloud, |
std::vector< size_t > & | indices = DEFAULT_VECTOR |
||
) |
! Calculate the plane's convex hull with the monotone chain algorithm.
Definition at line 784 of file Plane.cpp.
References cross().
Referenced by mrpt::pbmap::PbMapMaker::detectPlanesCloud(), and mrpt::pbmap::PbMapMaker::mergePlanes().
void Plane::calcConvexHullandParams | ( | pcl::PointCloud< pcl::PointXYZRGBA >::Ptr & | pointCloud, |
std::vector< size_t > & | indices = DEFAULT_VECTOR |
||
) |
Definition at line 854 of file Plane.cpp.
References cross(), and mrpt::math::norm().
void Plane::calcElongationAndPpalDir | ( | ) |
Calculate plane's elongation and principal direction
Definition at line 413 of file Plane.cpp.
Referenced by mrpt::pbmap::PbMapMaker::detectPlanesCloud().
void Plane::calcMainColor | ( | ) |
Calculate plane's main color using "MeanShift" method
Definition at line 642 of file Plane.cpp.
References mrpt::pbmap::getHistogramMeanShift().
Referenced by mrpt::pbmap::PbMapMaker::detectPlanesCloud().
void Plane::calcMainColor2 | ( | ) |
Definition at line 583 of file Plane.cpp.
References concentrationThreshold, and mrpt::pbmap::getMultiDimMeanShift_color().
|
inlineinherited |
float Plane::compute2DPolygonalArea | ( | ) |
Compute the area of a 2D planar polygon patch - using a given normal.
Compute the area of a 2D planar polygon patch.
polygonContourPtr | the point cloud (planar) |
normal | the plane normal |
Definition at line 345 of file Plane.cpp.
Referenced by mrpt::pbmap::PbMapMaker::detectPlanesCloud().
void Plane::computeMassCenterAndArea | ( | ) |
Compute the patch's convex-hull area and mass center.
Definition at line 375 of file Plane.cpp.
Referenced by mrpt::pbmap::PbMapMaker::detectPlanesCloud(), and mrpt::pbmap::PbMapMaker::mergePlanes().
|
static |
|
static |
|
virtual |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
|
inlineinherited |
Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).
Definition at line 162 of file CObject.h.
References mrpt::utils::CObjectPtr.
Referenced by mrpt::obs::CRawlog::addActions(), mrpt::slam::CIncrementalMapPartitioner::addMapFrame(), and mrpt::obs::CRawlog::addObservations().
void Plane::forcePtsLayOnPlane | ( | ) |
Force the plane inliers to lay on the plane
Definition at line 321 of file Plane.cpp.
Referenced by mrpt::pbmap::PbMapMaker::mergePlanes().
|
private |
|
virtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::utils::CSerializable.
bool Plane::hasSimilarDominantColor | ( | Plane & | plane, |
const float | colorThreshold | ||
) |
Definition at line 1057 of file Plane.cpp.
References bDominantColor, and v3colorNrgb.
bool Plane::isPlaneNearby | ( | Plane & | plane_nearby, |
const float | distThreshold | ||
) |
Returns true when the closest distance between the patches "this" and "plane" is under distThreshold.
Returns true when the closest distance between the patches "this" and the input "plane_nearby" is under distThreshold. This function is approximated
Definition at line 976 of file Plane.cpp.
References mrpt::pbmap::diffPoints(), mrpt::pbmap::dist3D_Segment_to_Segment2(), mrpt::pbmap::getVector3fromPointXYZ(), polygonContourPtr, and v3center.
bool Plane::isSamePlane | ( | Plane & | plane_nearby, |
const float & | cosAngleThreshold, | ||
const float & | parallelDistThres, | ||
const float & | proxThreshold | ||
) |
bool Plane::isSamePlane | ( | Eigen::Matrix4f & | Rt, |
Plane & | plane_, | ||
const float & | cosAngleThreshold, | ||
const float & | parallelDistThres, | ||
const float & | proxThreshold | ||
) |
Check if the the input plane is the same than this plane for some given angle and distance thresholds. If the planes are the same they are merged in this and the function returns true. Otherwise it returns false.
Definition at line 1030 of file Plane.cpp.
References d, polygonContourPtr, v3center, and v3normal.
Merge the two input patches into "updatePlane". Recalculate center, normal vector, area, inlier points (filtered), convex hull, etc.
Merge the input "same_plane_patch" into "this". Recalculate center, normal vector, area, inlier points (filtered), convex hull, etc.
Definition at line 1072 of file Plane.cpp.
References inliers, planePointCloudPtr, polygonContourPtr, and v3normal.
Definition at line 1116 of file Plane.cpp.
References hist_H, inliers, planePointCloudPtr, polygonContourPtr, and v3normal.
|
inline |
|
inline |
|
protectedvirtual |
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any error, see CStream::ReadBuffer |
Implements mrpt::utils::CSerializable.
Definition at line 214 of file Plane.cpp.
References MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, and version.
|
inlinevirtualinherited |
Introduces a pure virtual method responsible for writing to a mxArray
Matlab object, typically a MATLAB struct
whose contents are documented in each derived class.
mxArray
(caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB. Definition at line 79 of file CSerializable.h.
|
protectedvirtual |
*---------------------------------------------------------——
*------------------------------------------------------------—
Implements mrpt::utils::CSerializable.
|
staticprotected |
float mrpt::pbmap::Plane::areaHull |
Definition at line 139 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::detectPlanesCloud(), mrpt::pbmap::SubgraphMatcher::evalBinaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry(), and mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D().
float mrpt::pbmap::Plane::areaVoxels |
bool mrpt::pbmap::Plane::bDominantColor |
Definition at line 149 of file Plane.h.
Referenced by hasSimilarDominantColor().
bool mrpt::pbmap::Plane::bFromStructure |
Definition at line 141 of file Plane.h.
Referenced by mrpt::pbmap::SubgraphMatcher::evalBinaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D(), and mrpt::pbmap::PlaneInferredInfo::searchTheFloor().
bool mrpt::pbmap::Plane::bFullExtent |
Definition at line 140 of file Plane.h.
Referenced by mrpt::pbmap::SubgraphMatcher::evalBinaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D(), and mrpt::pbmap::PlaneInferredInfo::isFullExtent().
|
private |
|
staticinherited |
|
staticinherited |
Definition at line 42 of file CSerializable.h.
|
static |
|
static |
float mrpt::pbmap::Plane::d |
Definition at line 133 of file Plane.h.
Referenced by mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D(), and isSamePlane().
float mrpt::pbmap::Plane::dominantIntensity |
Definition at line 148 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::viz_cb(), and mrpt::pbmap::PbMapMaker::watchProperties().
float mrpt::pbmap::Plane::elongation |
Definition at line 137 of file Plane.h.
Referenced by mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D(), and mrpt::pbmap::PbMapMaker::watchProperties().
std::vector<float> mrpt::pbmap::Plane::hist_H |
Definition at line 153 of file Plane.h.
Referenced by mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D(), mergePlane2(), and mrpt::pbmap::PbMapMaker::watchProperties().
unsigned mrpt::pbmap::Plane::id |
! Parameters to allow the plane-based representation of the map by a graph
Definition at line 117 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::checkProximity(), mrpt::pbmap::PbMapMaker::detectPlanesCloud(), mrpt::pbmap::SubgraphMatcher::evalBinaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D(), mrpt::pbmap::PbMap::MergeWith(), mrpt::pbmap::PbMap::readFromStream(), mrpt::pbmap::PbMapLocaliser::searchPlaneContext(), mrpt::pbmap::PlaneInferredInfo::searchTheFloor(), and mrpt::pbmap::PbMapMaker::watchProperties().
std::vector<int32_t> mrpt::pbmap::Plane::inliers |
! Convex Hull
Definition at line 166 of file Plane.h.
Referenced by mergePlane(), and mergePlane2().
std::string mrpt::pbmap::Plane::label |
Labels to store semantic attributes
Definition at line 124 of file Plane.h.
Referenced by mrpt::pbmap::PlaneInferredInfo::searchTheFloor().
std::string mrpt::pbmap::Plane::label_context |
std::string mrpt::pbmap::Plane::label_object |
std::set<unsigned> mrpt::pbmap::Plane::nearbyPlanes |
Definition at line 120 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::checkProximity(), and mrpt::pbmap::PbMapLocaliser::searchPlaneContext().
std::map<unsigned,unsigned> mrpt::pbmap::Plane::neighborPlanes |
Definition at line 121 of file Plane.h.
Referenced by mrpt::pbmap::PbMapLocaliser::searchPlaneContext().
unsigned mrpt::pbmap::Plane::nFramesAreaIsStable |
Definition at line 142 of file Plane.h.
Referenced by mrpt::pbmap::PlaneInferredInfo::isFullExtent().
unsigned mrpt::pbmap::Plane::numObservations |
Definition at line 118 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::watchProperties().
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr mrpt::pbmap::Plane::outerPolygonPtr |
Definition at line 168 of file Plane.h.
Referenced by mrpt::pbmap::PlaneInferredInfo::isSurroundingBackground().
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr mrpt::pbmap::Plane::planePointCloudPtr |
Definition at line 169 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::detectPlanesCloud(), mergePlane(), mergePlane2(), mrpt::pbmap::PbMapMaker::mergePlanes(), mrpt::pbmap::PbMap::MergeWith(), and mrpt::pbmap::PbMapMaker::viz_cb().
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr mrpt::pbmap::Plane::polygonContourPtr |
Definition at line 167 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::arePlanesNearby(), mrpt::pbmap::PbMapMaker::detectPlanesCloud(), isPlaneNearby(), isSamePlane(), mrpt::pbmap::PlaneInferredInfo::isSurroundingBackground(), mergePlane(), mergePlane2(), mrpt::pbmap::PbMapMaker::mergePlanes(), mrpt::pbmap::PbMap::MergeWith(), and mrpt::pbmap::PbMapMaker::viz_cb().
std::vector<double> mrpt::pbmap::Plane::prog_area |
Definition at line 155 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::watchProperties().
std::vector<Eigen::Vector3f> mrpt::pbmap::Plane::prog_C1C2C3 |
Definition at line 157 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::watchProperties().
std::vector<double> mrpt::pbmap::Plane::prog_elongation |
Definition at line 156 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::watchProperties().
std::vector<std::vector<float> > mrpt::pbmap::Plane::prog_hist_H |
Definition at line 160 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::watchProperties().
std::vector<float> mrpt::pbmap::Plane::prog_intensity |
Definition at line 159 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::watchProperties().
std::vector<Eigen::Vector3f> mrpt::pbmap::Plane::prog_Nrgb |
Definition at line 158 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::watchProperties().
Eigen::Vector3f mrpt::pbmap::Plane::v3center |
! Geometric description
Definition at line 131 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::arePlanesNearby(), mrpt::pbmap::PbMapMaker::areSamePlane(), mrpt::pbmap::PbMapMaker::detectPlanesCloud(), mrpt::pbmap::SubgraphMatcher::evalBinaryConstraints(), isPlaneNearby(), isSamePlane(), mrpt::pbmap::PlaneInferredInfo::isSurroundingBackground(), mrpt::pbmap::PbMap::MergeWith(), mrpt::pbmap::PlaneInferredInfo::searchTheFloor(), and mrpt::pbmap::PbMapMaker::viz_cb().
Eigen::Vector3f mrpt::pbmap::Plane::v3colorC1C2C3 |
Definition at line 152 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::watchProperties().
Eigen::Vector3f mrpt::pbmap::Plane::v3colorNrgb |
! Radiometric description
Definition at line 147 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::detectPlanesCloud(), hasSimilarDominantColor(), mrpt::pbmap::PbMapMaker::viz_cb(), and mrpt::pbmap::PbMapMaker::watchProperties().
Eigen::Vector3f mrpt::pbmap::Plane::v3normal |
Definition at line 132 of file Plane.h.
Referenced by mrpt::pbmap::PbMapMaker::arePlanesNearby(), mrpt::pbmap::PbMapMaker::areSamePlane(), mrpt::pbmap::PbMapMaker::detectPlanesCloud(), mrpt::pbmap::SubgraphMatcher::evalBinaryConstraints(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraints2D(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry(), mrpt::pbmap::SubgraphMatcher::evalUnaryConstraintsOdometry2D(), isSamePlane(), mrpt::pbmap::PlaneInferredInfo::isSurroundingBackground(), mergePlane(), mergePlane2(), mrpt::pbmap::PbMapMaker::mergePlanes(), mrpt::pbmap::PbMap::MergeWith(), mrpt::pbmap::PlaneInferredInfo::searchTheFloor(), and mrpt::pbmap::PbMapMaker::viz_cb().
Eigen::Vector3f mrpt::pbmap::Plane::v3PpalDir |
Definition at line 136 of file Plane.h.
Referenced by mrpt::pbmap::PbMap::MergeWith().
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |