![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Fast Marching algorithm for planar facets extraction (qFacets plugin) More...
#include <fastMarchingForFacetExtraction.h>
Classes | |
| class | PlanarCell |
| A Fast Marching grid cell for planar facets extraction. More... | |
Public Member Functions | |
| FastMarchingForFacetExtraction () | |
| Default constructor. More... | |
| virtual | ~FastMarchingForFacetExtraction () |
| Destructor. More... | |
| int | init (ccGenericPointCloud *cloud, cloudViewer::DgmOctree *theOctree, unsigned char gridLevel, ScalarType maxError, cloudViewer::DistanceComputationTools::ERROR_MEASURES errorMeasure, bool useRetroProjectionError, cloudViewer::GenericProgressCallback *progressCb=0) |
| Initializes the grid with a point cloud (and ist corresponding octree) More... | |
| unsigned | updateFlagsTable (ccGenericPointCloud *theCloud, std::vector< unsigned char > &flags, unsigned facetIndex) |
| Updates a list of point flags, indicating the points alreay processed. More... | |
| void | setPropagateCallback (cloudViewer::GenericProgressCallback *propagateProgressCb) |
| Sets the propagation progress callback. More... | |
| virtual int | propagate () override |
| Propagates the front. More... | |
| virtual bool | setSeedCell (const Tuple3i &pos) override |
| Sets a given cell as "seed". More... | |
Public Member Functions inherited from cloudViewer::FastMarching | |
| FastMarching () | |
| Default constructor. More... | |
| virtual | ~FastMarching () |
| Destructor. More... | |
| virtual void | cleanLastPropagation () |
| virtual float | getTime (Tuple3i &pos, bool absoluteCoordinates=false) const |
| Returns the front arrival time at a given cell. More... | |
| virtual void | setExtendedConnectivity (bool state) |
| Sets extended connectivity mode. More... | |
Static Public Member Functions | |
| static int | ExtractPlanarFacets (ccPointCloud *theCloud, unsigned char octreeLevel, ScalarType maxError, cloudViewer::DistanceComputationTools::ERROR_MEASURES errorMeasure, bool useRetroProjectionError=true, cloudViewer::GenericProgressCallback *progressCb=0, cloudViewer::DgmOctree *_theOctree=0) |
| Static entry point (helper) More... | |
Protected Member Functions | |
| virtual float | computeTCoefApprox (cloudViewer::FastMarching::Cell *currentCell, cloudViewer::FastMarching::Cell *neighbourCell) const override |
| Computes the front acceleration between two cells. More... | |
| virtual int | step () override |
| Propagates the front (one step) More... | |
| virtual void | initTrialCells () override |
| Initializes the TRIAL cells list. More... | |
| virtual bool | instantiateGrid (unsigned size) override |
| Instantiates grid in memory. More... | |
| ScalarType | addCellToCurrentFacet (unsigned index) |
Protected Member Functions inherited from cloudViewer::FastMarching | |
| unsigned | pos2index (const Tuple3i &pos) const |
| virtual int | initGridWithOctree (DgmOctree *octree, unsigned char gridLevel) |
| virtual int | initGrid (float step, unsigned dim[3]) |
| Intializes the grid with a given step and dimensions. More... | |
| virtual int | initOther () |
| virtual float | computeT (unsigned index) |
| Computes the front arrival time at a given cell. More... | |
| template<class T > | |
| bool | instantiateGridTpl (unsigned size) |
| Grid instantiation helper. More... | |
| virtual void | addTrialCell (unsigned index) |
| Add a cell to the TRIAL cells list. More... | |
| virtual void | addActiveCell (unsigned index) |
| Add a cell to the ACTIVE cells list. More... | |
| virtual void | addIgnoredCell (unsigned index) |
| Add a cell to the IGNORED cells list. More... | |
| virtual unsigned | getNearestTrialCell () |
| Returns the TRIAL cell with the smallest front arrival time. More... | |
| void | resetCells (std::vector< unsigned > &list) |
| Resets the state of cells in a given list. More... | |
Protected Attributes | |
| cloudViewer::ReferenceCloud * | m_currentFacetPoints |
| Current facet points. More... | |
| ScalarType | m_currentFacetError |
| Current facet error. More... | |
| ScalarType | m_maxError |
| Max facet error. More... | |
| cloudViewer::DistanceComputationTools::ERROR_MEASURES | m_errorMeasure |
| Error measrue. More... | |
| bool | m_useRetroProjectionError |
| Whether to use retro-projection error in propagation. More... | |
| cloudViewer::GenericProgressCallback * | m_propagateProgressCb |
| Propagation progress callback. More... | |
| unsigned | m_propagateProgress |
| Propagation progress. More... | |
Protected Attributes inherited from cloudViewer::FastMarching | |
| std::vector< unsigned > | m_activeCells |
| ACTIVE cells list. More... | |
| std::vector< unsigned > | m_trialCells |
| TRIAL cells list. More... | |
| std::vector< unsigned > | m_ignoredCells |
| IGNORED cells lits. More... | |
| bool | m_initialized |
| Specifiies whether structure is initialized or not. More... | |
| unsigned | m_dx |
| Grid size along the X dimension. More... | |
| unsigned | m_dy |
| Grid size along the Y dimension. More... | |
| unsigned | m_dz |
| Grid size along the Z dimension. More... | |
| unsigned | m_rowSize |
| Shift for cell access acceleration (Y dimension) More... | |
| unsigned | m_sliceSize |
| Shift for cell access acceleration (Z dimension) More... | |
| unsigned | m_indexShift |
| First index of innerbound grid. More... | |
| unsigned | m_gridSize |
| Grid size. More... | |
| Cell ** | m_theGrid |
| Grid used to process Fast Marching. More... | |
| DgmOctree * | m_octree |
| Associated octree. More... | |
| unsigned char | m_gridLevel |
| Equivalent octree subdivision level. More... | |
| float | m_cellSize |
| Octree cell size at equivalent subdivision level. More... | |
| Tuple3i | m_minFillIndexes |
| Octree min fill indexes at 'm_gridLevel'. More... | |
| unsigned | m_numberOfNeighbours |
| Current number of neighbours (6 or 26) More... | |
| int | m_neighboursIndexShift [26] |
| Neighbours coordinates shifts in grid. More... | |
| float | m_neighboursDistance [26] |
| Neighbours distance weight. More... | |
Fast Marching algorithm for planar facets extraction (qFacets plugin)
Extends the FastMarching class.
| FastMarchingForFacetExtraction::FastMarchingForFacetExtraction | ( | ) |
Default constructor.
|
virtual |
Destructor.
References m_currentFacetPoints.
|
protected |
Adds a given cell's points to the current facet and returns the resulting RMS
References cloudViewer::ReferenceCloud::add(), cloudViewer::DgmOctree::associatedCloud(), FastMarchingForFacetExtraction::PlanarCell::cellCode, ComputeCellStats(), cloudViewer::DgmOctree::getPointsInCell(), m_currentFacetPoints, m_errorMeasure, cloudViewer::FastMarching::m_gridLevel, cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_octree, cloudViewer::FastMarching::m_theGrid, and cloudViewer::DgmOctree::MAX_OCTREE_LEVEL.
Referenced by setSeedCell(), and step().
|
overrideprotectedvirtual |
Computes the front acceleration between two cells.
| currentCell | the "central" cell |
| neighbourCell | the other cell |
oCell->planarError
Implements cloudViewer::FastMarching.
References cloudViewer::DgmOctree::associatedCloud(), FastMarchingForFacetExtraction::PlanarCell::C, FastMarchingForFacetExtraction::PlanarCell::cellCode, cloudViewer::DistanceComputationTools::ComputeCloud2PlaneDistance(), Vector3Tpl< Type >::dot(), cloudViewer::DgmOctree::getPointsInCell(), m_errorMeasure, cloudViewer::FastMarching::m_gridLevel, cloudViewer::FastMarching::m_octree, m_useRetroProjectionError, FastMarchingForFacetExtraction::PlanarCell::N, Vector3Tpl< Type >::norm2(), Vector3Tpl< Type >::normalize(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by initTrialCells().
|
static |
Static entry point (helper)
References cloudViewer::DgmOctree::build(), cloudViewer::FastMarching::cleanLastPropagation(), count, cloudViewer::PointCloudTpl< T >::enableScalarField(), CVLog::Error(), cloudViewer::PointCloudTpl< T >::getCurrentOutScalarField(), cloudViewer::PointCloudTpl< T >::getPoint(), cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint(), init(), octreeLevel, propagate(), result, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::PointCloudTpl< T >::setPointScalarValue(), setPropagateCallback(), setSeedCell(), cloudViewer::PointCloudTpl< T >::size(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), cloudViewer::GenericProgressCallback::update(), updateFlagsTable(), CVLog::Warning(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by qFacets::extractFacets().
| int FastMarchingForFacetExtraction::init | ( | ccGenericPointCloud * | cloud, |
| cloudViewer::DgmOctree * | theOctree, | ||
| unsigned char | gridLevel, | ||
| ScalarType | maxError, | ||
| cloudViewer::DistanceComputationTools::ERROR_MEASURES | errorMeasure, | ||
| bool | useRetroProjectionError, | ||
| cloudViewer::GenericProgressCallback * | progressCb = 0 |
||
| ) |
Initializes the grid with a point cloud (and ist corresponding octree)
The points should be associated to an (active) scalar field. The Fast Marching grid will have the same dimensions as the input octree considered at a given level of subdivision.
| cloud | the point cloud |
| theOctree | the associated octree |
| gridLevel | the level of subdivision |
| maxError | maximum error allowed by 'propagated' facet |
| errorMeasure | error measure |
| useRetroProjectionError | whether to use retro-projection error in propagation |
| progressCb | progeress callback |
References cloudViewer::DgmOctree::associatedCloud(), FastMarchingForFacetExtraction::PlanarCell::C, FastMarchingForFacetExtraction::PlanarCell::cellCode, ComputeCellStats(), cloudViewer::DgmOctree::getCellCodes(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::DgmOctree::getPointsInCell(), cloudViewer::FastMarching::initGridWithOctree(), m_errorMeasure, cloudViewer::FastMarching::m_initialized, m_maxError, cloudViewer::FastMarching::m_theGrid, m_useRetroProjectionError, FastMarchingForFacetExtraction::PlanarCell::N, nProgress, cloudViewer::NormalizedProgress::oneStep(), FastMarchingForFacetExtraction::PlanarCell::planarError, cloudViewer::FastMarching::pos2index(), result, cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::GenericProgressCallback::start(), cloudViewer::GenericProgressCallback::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), and cloudViewer::GenericProgressCallback::update().
Referenced by ExtractPlanarFacets().
|
overrideprotectedvirtual |
Initializes the TRIAL cells list.
See the Fast Marching algorithm theory for more information
Reimplemented from cloudViewer::FastMarching.
References cloudViewer::FastMarching::addTrialCell(), computeTCoefApprox(), cloudViewer::FastMarching::Cell::FAR_CELL, cloudViewer::FastMarching::m_activeCells, m_currentFacetError, m_maxError, cloudViewer::FastMarching::m_neighboursDistance, cloudViewer::FastMarching::m_neighboursIndexShift, cloudViewer::FastMarching::m_numberOfNeighbours, cloudViewer::FastMarching::m_theGrid, cloudViewer::FastMarching::Cell::state, and cloudViewer::FastMarching::Cell::T.
Referenced by propagate().
|
inlineoverrideprotectedvirtual |
Instantiates grid in memory.
Grid is also filled with zeros.
| size | grid size |
Implements cloudViewer::FastMarching.
References size.
|
overridevirtual |
Propagates the front.
The seeds should have already been initialized
Implements cloudViewer::FastMarching.
References initTrialCells(), cloudViewer::GenericProgressCallback::isCancelRequested(), m_propagateProgressCb, result, and step().
Referenced by ExtractPlanarFacets().
|
inline |
Sets the propagation progress callback.
References m_propagateProgress, and m_propagateProgressCb.
Referenced by ExtractPlanarFacets().
|
overridevirtual |
Sets a given cell as "seed".
| pos | the cell position in the grid (3 integer coordinates) |
Reimplemented from cloudViewer::FastMarching.
References addCellToCurrentFacet(), cloudViewer::DgmOctree::associatedCloud(), m_currentFacetError, m_currentFacetPoints, cloudViewer::FastMarching::m_octree, m_propagateProgress, cloudViewer::FastMarching::pos2index(), cloudViewer::FastMarching::setSeedCell(), and cloudViewer::ReferenceCloud::size().
Referenced by ExtractPlanarFacets().
|
overrideprotectedvirtual |
Propagates the front (one step)
Implements cloudViewer::FastMarching.
References cloudViewer::FastMarching::Cell::ACTIVE_CELL, cloudViewer::FastMarching::addActiveCell(), addCellToCurrentFacet(), cloudViewer::FastMarching::addIgnoredCell(), cloudViewer::FastMarching::addTrialCell(), cloudViewer::FastMarching::computeT(), cloudViewer::FastMarching::Cell::FAR_CELL, cloudViewer::ReferenceCloud::getAssociatedCloud(), cloudViewer::FastMarching::getNearestTrialCell(), m_currentFacetError, m_currentFacetPoints, cloudViewer::FastMarching::m_initialized, m_maxError, cloudViewer::FastMarching::m_neighboursIndexShift, cloudViewer::FastMarching::m_numberOfNeighbours, m_propagateProgress, m_propagateProgressCb, cloudViewer::FastMarching::m_theGrid, cloudViewer::ReferenceCloud::resize(), cloudViewer::GenericCloud::size(), cloudViewer::ReferenceCloud::size(), cloudViewer::FastMarching::Cell::state, cloudViewer::FastMarching::Cell::T, cloudViewer::FastMarching::Cell::T_INF(), cloudViewer::FastMarching::Cell::TRIAL_CELL, and cloudViewer::GenericProgressCallback::update().
Referenced by propagate().
| unsigned FastMarchingForFacetExtraction::updateFlagsTable | ( | ccGenericPointCloud * | theCloud, |
| std::vector< unsigned char > & | flags, | ||
| unsigned | facetIndex | ||
| ) |
Updates a list of point flags, indicating the points alreay processed.
References cloudViewer::DgmOctree::associatedCloud(), FastMarchingForFacetExtraction::PlanarCell::cellCode, cloudViewer::ReferenceCloud::clear(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), cloudViewer::DgmOctree::getPointsInCell(), cloudViewer::FastMarching::m_activeCells, m_currentFacetPoints, cloudViewer::FastMarching::m_gridLevel, cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_octree, cloudViewer::FastMarching::m_theGrid, cloudViewer::GenericCloud::setPointScalarValue(), and cloudViewer::ReferenceCloud::size().
Referenced by ExtractPlanarFacets().
|
protected |
Current facet error.
Referenced by initTrialCells(), setSeedCell(), and step().
|
protected |
Current facet points.
Referenced by addCellToCurrentFacet(), setSeedCell(), step(), updateFlagsTable(), and ~FastMarchingForFacetExtraction().
|
protected |
Error measrue.
Referenced by addCellToCurrentFacet(), computeTCoefApprox(), and init().
|
protected |
Max facet error.
Referenced by init(), initTrialCells(), and step().
|
protected |
Propagation progress.
Referenced by setPropagateCallback(), setSeedCell(), and step().
|
protected |
Propagation progress callback.
Referenced by propagate(), setPropagateCallback(), and step().
|
protected |
Whether to use retro-projection error in propagation.
Referenced by computeTCoefApprox(), and init().