ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccContourExtractor Class Reference

Controur extractor (with debug GUI) More...

#include <ecvContourExtractor.h>

Public Types

enum  ContourType { LOWER , UPPER , FULL }
 Contour type. More...
 

Static Public Member Functions

static ccPolylineExtractFlatContour (cloudViewer::GenericIndexedCloudPersist *points, bool allowMultiPass, PointCoordinateType maxEdgeLength=0, const PointCoordinateType *preferredNormDim=0, const PointCoordinateType *preferredUpDir=0, ContourType contourType=FULL, std::vector< unsigned > *originalPointIndexes=0, bool enableVisualDebugMode=false, double maxAngleDeg=0.0)
 Extracts a unique closed (2D) contour polyline of a point cloud. More...
 
static bool ExtractFlatContour (cloudViewer::GenericIndexedCloudPersist *points, bool allowMultiPass, PointCoordinateType maxEdgeLength, std::vector< ccPolyline * > &parts, bool allowSplitting=true, const PointCoordinateType *preferredNormDim=0, bool enableVisualDebugMode=false)
 

Static Protected Member Functions

static bool ExtractConcaveHull2D (std::vector< cloudViewer::PointProjectionTools::IndexedCCVector2 > &points, std::list< cloudViewer::PointProjectionTools::IndexedCCVector2 * > &hullPoints, ContourType contourType, bool allowMultiPass, PointCoordinateType maxSquareLength=0, bool enableVisualDebugMode=false, double maxAngleDeg=90.0)
 Determines the 'concave' hull of a set of points. More...
 

Detailed Description

Controur extractor (with debug GUI)

Definition at line 17 of file ecvContourExtractor.h.

Member Enumeration Documentation

◆ ContourType

Contour type.

Enumerator
LOWER 
UPPER 
FULL 

Definition at line 20 of file ecvContourExtractor.h.

Member Function Documentation

◆ ExtractConcaveHull2D()

bool ccContourExtractor::ExtractConcaveHull2D ( std::vector< cloudViewer::PointProjectionTools::IndexedCCVector2 > &  points,
std::list< cloudViewer::PointProjectionTools::IndexedCCVector2 * > &  hullPoints,
ContourType  contourType,
bool  allowMultiPass,
PointCoordinateType  maxSquareLength = 0,
bool  enableVisualDebugMode = false,
double  maxAngleDeg = 90.0 
)
staticprotected

Determines the 'concave' hull of a set of points.

Inspired from JIN-SEO PARK AND SE-JONG OH, "A New Concave Hull Algorithm and Concaveness Measure for n-dimensional Datasets", 2012 Calls extractConvexHull2D (see associated warnings).

Note
Almost the same method as cloudViewer::PointProjectionTools::ExtractConcaveHull2D but with partial contour support and visual debug mode.
Parameters
pointsinput set of points
hullPointsoutput points (on the convex hull)
contourTypetype of contour (above / below / full)
allowMultiPasswhether to allow multi-pass process (with longer edges potentially generated so as 'disturb' the initial guess)
maxSquareLengthmaximum square length (ignored if <= 0, in which case the method simply returns the convex hull!)
enableVisualDebugModewhether to display a (debug) window to represent the algorithm process
maxAngleDegmax angle between segments (angle between 0 and 180, in degrees)
Returns
success

at least one of the new segments must be smaller than the initial one!

Definition at line 189 of file ecvContourExtractor.cpp.

References ccHObject::addChild(), cc2DLabel::addPickedPoint(), cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::ReferenceCloud::addPointIndex(), ccContourExtractorDlg::addToDisplay(), ccPointCloud::clear(), cross(), ccContourExtractorDlg::displayMessage(), cloudViewer::PointProjectionTools::extractConvexHull2D(), FindNearestCandidate(), FULL, ccGenericPointCloud::getOwnBB(), cloudViewer::PointProjectionTools::IndexedCCVector2::index, ccContourExtractorDlg::init(), ccContourExtractorDlg::isSkipped(), Edge::itA, LOWER, M_PI, max(), min(), Edge::nearestPointIndex, Edge::nearestPointSquareDist, POINT_FROZEN, POINT_NOT_USED, POINT_USED, points, ecvColor::red(), ccContourExtractorDlg::refresh(), ccContourExtractorDlg::removFromDisplay(), cloudViewer::ReferenceCloud::reserve(), ccPointCloud::reserve(), cloudViewer::Polyline::setClosed(), ccPolyline::setColor(), cc2DLabel::setDisplayedIn2D(), ccObject::setEnabled(), ccGenericPointCloud::setPointSize(), ccDrawableObject::setSelected(), ccDrawableObject::setVisible(), std::swap(), Vector2Tpl< Type >::x, Vector2Tpl< Type >::y, and ccContourExtractorDlg::zoomOn().

Referenced by ExtractFlatContour().

◆ ExtractFlatContour() [1/2]

bool ccContourExtractor::ExtractFlatContour ( cloudViewer::GenericIndexedCloudPersist points,
bool  allowMultiPass,
PointCoordinateType  maxEdgeLength,
std::vector< ccPolyline * > &  parts,
bool  allowSplitting = true,
const PointCoordinateType preferredNormDim = 0,
bool  enableVisualDebugMode = false 
)
static

Extracts one or several parts of the (2D) contour polyline of a point cloud Projects the cloud on its best fitting LS plane first.

Warning
output polylines set (parts) may be empty if all the vertices are too far from each other!
Parameters
pointspoint cloud
allowMultiPasswhether to allow multi-pass process (with longer edges potentially generated so as 'disturb' the initial guess)
maxEdgeLengthmax edge length (ignored if 0, in which case the contour is the convex hull)
[out]partsoutput polyline parts
allowSplittingwhether the polyline can be split or not
preferredNormDimto specifiy a preferred (normal) direction for the polyline extraction
enableVisualDebugModewhether to display a (debug) window to represent the algorithm process
Returns
success

Definition at line 798 of file ecvContourExtractor.cpp.

References cloudViewer::Polyline::clear(), ExtractFlatContour(), FULL, points, and ccPolyline::split().

◆ ExtractFlatContour() [2/2]

ccPolyline * ccContourExtractor::ExtractFlatContour ( cloudViewer::GenericIndexedCloudPersist points,
bool  allowMultiPass,
PointCoordinateType  maxEdgeLength = 0,
const PointCoordinateType preferredNormDim = 0,
const PointCoordinateType preferredUpDir = 0,
ContourType  contourType = FULL,
std::vector< unsigned > *  originalPointIndexes = 0,
bool  enableVisualDebugMode = false,
double  maxAngleDeg = 0.0 
)
static

Extracts a unique closed (2D) contour polyline of a point cloud.

Projects the cloud on its best fitting LS plane first.

Parameters
pointspoint cloud
allowMultiPasswhether to allow multi-pass process (with longer edges potentially generated so as 'disturb' the initial guess)
maxEdgeLengthmax edge length (ignored if 0, in which case the contour is the convex hull)
preferredNormDimto specifiy a preferred (normal) direction for the polyline extraction
preferredUpDirto specifiy a preferred up direction for the polyline extraction (preferredNormDim must be defined as well and must be normal to this 'up' direction)
contourTypeto specify a type of contour (you should define a 'up' direction to get proper lower and upper contours)
[out]originalPointIndexesto get the indexes (relatively to the input cloud) of the output polyline vertices
enableVisualDebugModewhether to display a (debug) window to represent the algorithm process
maxAngleDegmax angle between segments (angle between 0 and 180, in degrees)
Returns
contour polyline (or 0 if an error occurred)

Definition at line 659 of file ecvContourExtractor.cpp.

References ccHObject::addChild(), cloudViewer::PointCloudTpl< T >::addPoint(), cloudViewer::ReferenceCloud::addPointIndex(), Vector3Tpl< Type >::cross(), CVLog::Error(), ExtractConcaveHull2D(), FULL, cloudViewer::Neighbourhood::None, points, cloudViewer::Neighbourhood::projectPointsOn2DPlane(), cloudViewer::ReferenceCloud::reserve(), ccPointCloud::reserve(), cloudViewer::Polyline::setClosed(), ccObject::setEnabled(), ccObject::setName(), ccDrawableObject::setVisible(), Tuple3Tpl< Type >::u, cloudViewer::Neighbourhood::UseOXYasBase, cloudViewer::Neighbourhood::UseYAsUpDir, Vector3Tpl< PointCoordinateType >::vdot(), Vector3Tpl< PointCoordinateType >::vnormalize(), CVLog::Warning(), X, and Tuple3Tpl< Type >::y.

Referenced by ExtractFlatContour().


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