![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Fast Marching algorithm for normals direction resolution. More...
#include <ecvFastMarchingForNormsDirection.h>


Classes | |
| class | DirectionCell |
| A Fast Marching grid cell for normals direction resolution. More... | |
Public Member Functions | |
| ccFastMarchingForNormsDirection () | |
| Default constructor. More... | |
| int | init (ccGenericPointCloud *cloud, NormsIndexesTableType *theNorms, ccOctree *theOctree, unsigned char gridLevel) |
| Initializes the grid with a point cloud (and ist corresponding octree) More... | |
| unsigned | updateResolvedTable (ccGenericPointCloud *theCloud, std::vector< unsigned char > &resolved, NormsIndexesTableType *theNorms) |
| Updates a list of point flags, indicating the points already processed. More... | |
| int | propagate () override |
| Propagates the front. More... | |
Public Member Functions inherited from cloudViewer::FastMarching | |
| FastMarching () | |
| Default constructor. More... | |
| virtual | ~FastMarching () |
| Destructor. More... | |
| virtual bool | setSeedCell (const Tuple3i &pos) |
| Sets a given cell as "seed". 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 | OrientNormals (ccPointCloud *theCloud, unsigned char octreeLevel, ecvProgressDialog *progressCb=nullptr) |
| Static entry point (helper) More... | |
Protected Member Functions | |
| float | computeTCoefApprox (cloudViewer::FastMarching::Cell *currentCell, cloudViewer::FastMarching::Cell *neighbourCell) const override |
| Computes the front acceleration between two cells. More... | |
| int | step () override |
| Propagates the front (one step) More... | |
| void | initTrialCells () override |
| Initializes the TRIAL cells list. More... | |
| bool | instantiateGrid (unsigned size) override |
| Instantiates grid in memory. More... | |
| float | computePropagationConfidence (DirectionCell *originCell, DirectionCell *destCell) const |
| Computes relative 'confidence' between two cells (orientations) More... | |
| void | resolveCellOrientation (unsigned index) |
| Resolves the direction of a given cell (once and for all) More... | |
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... | |
Additional Inherited Members | |
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 normals direction resolution.
Extends the FastMarching class.
Definition at line 28 of file ecvFastMarchingForNormsDirection.h.
| ccFastMarchingForNormsDirection::ccFastMarchingForNormsDirection | ( | ) |
Default constructor.
Definition at line 24 of file ecvFastMarchingForNormsDirection.cpp.
|
protected |
Computes relative 'confidence' between two cells (orientations)
Definition at line 107 of file ecvFastMarchingForNormsDirection.cpp.
References ccFastMarchingForNormsDirection::DirectionCell::C, Vector3Tpl< Type >::dot(), ccFastMarchingForNormsDirection::DirectionCell::N, and Vector3Tpl< Type >::normalize().
Referenced by computeTCoefApprox(), and resolveCellOrientation().
|
overrideprotectedvirtual |
Computes the front acceleration between two cells.
| currentCell | the "central" cell |
| neighbourCell | the other cell |
Implements cloudViewer::FastMarching.
Definition at line 239 of file ecvFastMarchingForNormsDirection.cpp.
References computePropagationConfidence(), and ccFastMarchingForNormsDirection::DirectionCell::signConfidence.
Referenced by initTrialCells().
| int ccFastMarchingForNormsDirection::init | ( | ccGenericPointCloud * | cloud, |
| NormsIndexesTableType * | theNorms, | ||
| ccOctree * | theOctree, | ||
| unsigned char | gridLevel | ||
| ) |
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 |
| theNorms | the normals array |
| theOctree | the associated octree |
| gridLevel | the level of subdivision |
Definition at line 62 of file ecvFastMarchingForNormsDirection.cpp.
References cloudViewer::DgmOctree::associatedCloud(), ccFastMarchingForNormsDirection::DirectionCell::C, ccFastMarchingForNormsDirection::DirectionCell::cellCode, ComputeRobustAverageNorm(), cloudViewer::DgmOctree::getCellCodes(), cloudViewer::DgmOctree::getCellPos(), cloudViewer::Neighbourhood::getGravityCenter(), cloudViewer::DgmOctree::getPointsInCell(), cloudViewer::FastMarching::initGridWithOctree(), cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_theGrid, ccFastMarchingForNormsDirection::DirectionCell::N, cloudViewer::FastMarching::pos2index(), and result.
Referenced by OrientNormals().
|
overrideprotectedvirtual |
Initializes the TRIAL cells list.
See the Fast Marching algorithm theory for more information
Reimplemented from cloudViewer::FastMarching.
Definition at line 306 of file ecvFastMarchingForNormsDirection.cpp.
References cloudViewer::FastMarching::addTrialCell(), computeTCoefApprox(), cloudViewer::FastMarching::Cell::FAR_CELL, cloudViewer::FastMarching::m_activeCells, cloudViewer::FastMarching::m_neighboursDistance, cloudViewer::FastMarching::m_neighboursIndexShift, cloudViewer::FastMarching::m_numberOfNeighbours, cloudViewer::FastMarching::m_theGrid, ccFastMarchingForNormsDirection::DirectionCell::signConfidence, 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.
Definition at line 103 of file ecvFastMarchingForNormsDirection.h.
References size.
|
static |
Static entry point (helper)
Definition at line 339 of file ecvFastMarchingForNormsDirection.cpp.
References ccPointCloud::addScalarField(), cloudViewer::FastMarching::cleanLastPropagation(), ccScalarField::computeMinAndMax(), ccGenericPointCloud::computeOctree(), count, ccPointCloud::deleteScalarField(), cloudViewer::PointCloudTpl< T >::enableScalarField(), CVLog::Error(), ccPointCloud::getCurrentDisplayedScalarField(), ccPointCloud::getCurrentDisplayedScalarFieldIndex(), ccObject::getName(), ccGenericPointCloud::getOctree(), cloudViewer::PointCloudTpl< T >::getPoint(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), cloudViewer::DgmOctree::getTheCellPosWhichIncludesThePoint(), init(), name, ccPointCloud::normals(), octree, octreeLevel, propagate(), result, ccPointCloud::setCurrentDisplayedScalarField(), cloudViewer::PointCloudTpl< T >::setCurrentScalarField(), ecvProgressDialog::setInfo(), ecvProgressDialog::setMethodTitle(), cloudViewer::FastMarching::setSeedCell(), ccDrawableObject::sfShown(), ccDrawableObject::showNormals(), ccDrawableObject::showSF(), cloudViewer::PointCloudTpl< T >::size(), ecvProgressDialog::start(), ecvProgressDialog::stop(), cloudViewer::GenericProgressCallback::textCanBeEdited(), ecvProgressDialog::update(), updateResolvedTable(), CVLog::Warning(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
Referenced by ccPointCloud::orientNormalsWithFM().
|
overridevirtual |
Propagates the front.
The seeds should have already been initialized
Implements cloudViewer::FastMarching.
Definition at line 250 of file ecvFastMarchingForNormsDirection.cpp.
References initTrialCells(), result, and step().
Referenced by OrientNormals().
|
protected |
Resolves the direction of a given cell (once and for all)
Definition at line 125 of file ecvFastMarchingForNormsDirection.cpp.
References cloudViewer::FastMarching::Cell::ACTIVE_CELL, computePropagationConfidence(), Vector3Tpl< Type >::dot(), cloudViewer::FastMarching::m_neighboursIndexShift, cloudViewer::FastMarching::m_numberOfNeighbours, cloudViewer::FastMarching::m_theGrid, ccFastMarchingForNormsDirection::DirectionCell::N, ccFastMarchingForNormsDirection::DirectionCell::signConfidence, and cloudViewer::FastMarching::Cell::state.
Referenced by step().
|
overrideprotectedvirtual |
Propagates the front (one step)
Implements cloudViewer::FastMarching.
Definition at line 184 of file ecvFastMarchingForNormsDirection.cpp.
References cloudViewer::FastMarching::Cell::ACTIVE_CELL, cloudViewer::FastMarching::addActiveCell(), cloudViewer::FastMarching::addIgnoredCell(), cloudViewer::FastMarching::addTrialCell(), cloudViewer::FastMarching::computeT(), cloudViewer::FastMarching::Cell::FAR_CELL, cloudViewer::FastMarching::getNearestTrialCell(), cloudViewer::FastMarching::m_activeCells, cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_neighboursIndexShift, cloudViewer::FastMarching::m_numberOfNeighbours, cloudViewer::FastMarching::m_theGrid, resolveCellOrientation(), scalar, cloudViewer::FastMarching::Cell::state, cloudViewer::FastMarching::Cell::T, cloudViewer::FastMarching::Cell::T_INF(), and cloudViewer::FastMarching::Cell::TRIAL_CELL.
Referenced by propagate().
| unsigned ccFastMarchingForNormsDirection::updateResolvedTable | ( | ccGenericPointCloud * | theCloud, |
| std::vector< unsigned char > & | resolved, | ||
| NormsIndexesTableType * | theNorms | ||
| ) |
Updates a list of point flags, indicating the points already processed.
Definition at line 262 of file ecvFastMarchingForNormsDirection.cpp.
References cloudViewer::DgmOctree::associatedCloud(), ccFastMarchingForNormsDirection::DirectionCell::cellCode, count, Vector3Tpl< Type >::dot(), ccNormalVectors::GetNormal(), ccNormalVectors::GetNormIndex(), cloudViewer::ReferenceCloud::getPointGlobalIndex(), cloudViewer::DgmOctree::getPointsInCell(), ccArray< Type, N, ComponentType >::getValue(), cloudViewer::FastMarching::m_activeCells, cloudViewer::FastMarching::m_gridLevel, cloudViewer::FastMarching::m_initialized, cloudViewer::FastMarching::m_octree, cloudViewer::FastMarching::m_theGrid, cloudViewer::DgmOctree::MAX_OCTREE_LEVEL, ccFastMarchingForNormsDirection::DirectionCell::N, cloudViewer::GenericCloud::setPointScalarValue(), ccArray< Type, N, ComponentType >::setValue(), cloudViewer::ReferenceCloud::size(), and cloudViewer::FastMarching::Cell::T.
Referenced by OrientNormals().