![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Context-based feature. More...
#include <ContextBasedFeature.h>


Public Types | |
| enum | ContextBasedFeatureType { Invalid = 0 , DZ , DH } |
| typedef QSharedPointer< ContextBasedFeature > | Shared |
Public Types inherited from masc::Feature | |
| enum class | Type { PointFeature , NeighborhoodFeature , ContextBasedFeature , DualCloudFeature , Invalid } |
| Feature type. More... | |
| enum | Stat { NO_STAT , MEAN , MODE , MEDIAN , STD , RANGE , SKEW } |
| enum | Operation { NO_OPERATION , MINUS , PLUS , DIVIDE , MULTIPLY } |
| typedef QSharedPointer< Feature > | Shared |
| Shared type. More... | |
| typedef std::vector< Shared > | Set |
| Set of features. More... | |
Public Member Functions | |
| ContextBasedFeature (ContextBasedFeatureType p_type, int p_kNN=1, double p_scale=std::numeric_limits< double >::quiet_NaN(), int p_ctxClassLabel=0) | |
| Default constructor. More... | |
| virtual Type | getType () const override |
| Returns the type (must be reimplemented by child struct) More... | |
| virtual Feature::Shared | clone () const override |
| Clones this feature. More... | |
| virtual bool | prepare (const CorePoints &corePoints, QString &error, cloudViewer::GenericProgressCallback *progressCb=nullptr, SFCollector *generatedScalarFields=nullptr) override |
| Prepares the feature (compute the scalar field, etc.) More... | |
| virtual bool | finish (const CorePoints &corePoints, QString &error) override |
| Finishes the feature preparation (update the scalar field, etc.) More... | |
| virtual bool | checkValidity (QString corePointRole, QString &error) const override |
| Checks the feature definition validity. More... | |
| virtual QString | toString () const override |
| Returns the formatted description. More... | |
| bool | computeValue (cloudViewer::DgmOctree::NeighboursSet &pointsInNeighbourhood, const CCVector3 &queryPoint, ScalarType &outputValue) const |
| Compute the feature value on a set of points. More... | |
Public Member Functions inherited from masc::Feature | |
| Feature (double p_scale=std::numeric_limits< double >::quiet_NaN(), Source::Type p_source=Source::ScalarField, QString p_sourceName=QString()) | |
| Default constructor. More... | |
| virtual | ~Feature () |
| Destructor. More... | |
| bool | scaled () const |
| Returns whether the feature has an associated scale. More... | |
Static Public Member Functions | |
| static QString | ToString (ContextBasedFeatureType type) |
| static ContextBasedFeatureType | FromString (const QString &token) |
| static ContextBasedFeatureType | FromUpperString (const QString &token) |
Static Public Member Functions inherited from masc::Feature | |
| static QString | StatToString (Stat stat) |
| static QString | OpToString (Operation op) |
| static bool | ExtractSources (const Set &features, Source::Set &sources) |
| Extracts the set of 'sources' from a set of features. More... | |
| static bool | SaveSources (const Source::Set &sources, QString filename) |
| Saves a set of 'sources' to a file. More... | |
| static bool | LoadSources (Source::Set &sources, QString filename) |
| Loads a set of 'sources' from a file. More... | |
| static bool | CheckSFExistence (ccPointCloud *cloud, const char *resultSFName) |
| static cloudViewer::ScalarField * | PrepareSF (ccPointCloud *cloud, const char *resultSFName, SFCollector *generatedScalarFields, SFCollector::Behavior behavior) |
| static ScalarType | PerformMathOp (double s1, double s2, Operation op) |
| Performs a mathematical operation between two scalars. More... | |
| static bool | PerformMathOp (cloudViewer::ScalarField *sf1, const cloudViewer::ScalarField *sf2, Operation op) |
| static bool | PerformMathOp (const IScalarFieldWrapper &sf1, const IScalarFieldWrapper &sf2, Operation op, cloudViewer::ScalarField *outSF) |
Public Attributes | |
| ContextBasedFeatureType | type |
| Neighborhood feature type. More... | |
| int | kNN |
| int | ctxClassLabel |
| Context class (label) More... | |
| cloudViewer::ScalarField * | sf |
| The computed scalar. More... | |
Public Attributes inherited from masc::Feature | |
| double | scale |
| Scale (diameter) More... | |
| ccPointCloud * | cloud1 |
| ccPointCloud * | cloud2 |
| QString | cloud1Label |
| QString | cloud2Label |
| Source | source |
| Stat | stat |
| Operation | op |
| bool | sf1WasAlreadyExisting |
| bool | sf2WasAlreadyExisting |
Context-based feature.
Definition at line 32 of file ContextBasedFeature.h.
| typedef QSharedPointer<ContextBasedFeature> masc::ContextBasedFeature::Shared |
Definition at line 34 of file ContextBasedFeature.h.
| Enumerator | |
|---|---|
| Invalid | |
| DZ | |
| DH | |
Definition at line 36 of file ContextBasedFeature.h.
|
inline |
Default constructor.
Definition at line 67 of file ContextBasedFeature.h.
References masc::Feature::scale.
Referenced by clone().
|
overridevirtual |
Checks the feature definition validity.
Reimplemented from masc::Feature.
Definition at line 25 of file ContextBasedFeature.cpp.
References masc::Feature::checkValidity(), masc::Feature::cloud1, masc::Feature::cloud1Label, error(), masc::Tools::GetClassificationSF(), Invalid, kNN, masc::Feature::scaled(), cloudViewer::PointCloudTpl< T >::size(), and type.
Referenced by prepare().
|
inlineoverridevirtual |
Clones this feature.
Implements masc::Feature.
Definition at line 81 of file ContextBasedFeature.h.
References ContextBasedFeature().
| bool ContextBasedFeature::computeValue | ( | cloudViewer::DgmOctree::NeighboursSet & | pointsInNeighbourhood, |
| const CCVector3 & | queryPoint, | ||
| ScalarType & | outputValue | ||
| ) | const |
Compute the feature value on a set of points.
Definition at line 284 of file ContextBasedFeature.cpp.
References masc::Feature::cloud1, ctxClassLabel, DH, DZ, Vector3Tpl< double >::fromArray(), cloudViewer::PointCloudTpl< T >::getPointScalarValue(), NAN_VALUE, type, Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
overridevirtual |
Finishes the feature preparation (update the scalar field, etc.)
Reimplemented from masc::Feature.
Definition at line 323 of file ContextBasedFeature.cpp.
References cloudViewer::ScalarField::computeMinAndMax(), corePoints, error(), cloudViewer::ScalarField::getName(), and sf.
|
inlinestatic |
Definition at line 53 of file ContextBasedFeature.h.
References FromUpperString().
|
inlinestatic |
Definition at line 56 of file ContextBasedFeature.h.
References DH, DZ, and Invalid.
Referenced by CreateFeaturesFromCommand(), and FromString().
|
inlineoverridevirtual |
Returns the type (must be reimplemented by child struct)
Implements masc::Feature.
Definition at line 80 of file ContextBasedFeature.h.
References masc::Feature::ContextBasedFeature.
|
overridevirtual |
Prepares the feature (compute the scalar field, etc.)
Implements masc::Feature.
Definition at line 65 of file ContextBasedFeature.cpp.
References cloudViewer::PointCloudTpl< T >::addPoint(), SFCollector::CAN_REMOVE, masc::Feature::CheckSFExistence(), checkValidity(), masc::Feature::cloud1, masc::Feature::cloud1Label, cloudViewer::ScalarField::computeMinAndMax(), ccGenericPointCloud::computeOctree(), corePoints, ctxClassLabel, DH, DZ, Vector3Tpl< double >::fromArray(), masc::Tools::GetClassificationSF(), cloudViewer::ScalarField::getName(), cloudViewer::GenericIndexedCloud::getPoint(), cloudViewer::PointCloudTpl< T >::getPoint(), cloudViewer::ReferenceCloud::getPoint(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), cloudViewer::ScalarField::getValue(), kNN, max(), cloudViewer::DgmOctree::MAX_OCTREE_LEVEL, masc::Feature::Source::name, NAN_VALUE, nProgress, octreeLevel, cloudViewer::NormalizedProgress::oneStep(), masc::Feature::PrepareSF(), CVLog::Print(), ccPointCloud::reserve(), masc::Feature::scale, masc::Feature::scaled(), cloudViewer::PointCloudTpl< T >::setCurrentOutScalarField(), cloudViewer::GenericProgressCallback::setInfo(), cloudViewer::GenericProgressCallback::setMethodTitle(), cloudViewer::ScalarField::setValue(), sf, masc::Feature::sf1WasAlreadyExisting, cloudViewer::GenericCloud::size(), cloudViewer::PointCloudTpl< T >::size(), masc::Feature::source, cloudViewer::GenericProgressCallback::stop(), ToString(), type, Tuple3Tpl< Type >::u, CVLog::Warning(), Tuple3Tpl< Type >::x, Tuple3Tpl< Type >::y, and Tuple3Tpl< Type >::z.
|
overridevirtual |
Returns the formatted description.
Implements masc::Feature.
Definition at line 350 of file ContextBasedFeature.cpp.
References masc::Feature::cloud1Label, ctxClassLabel, kNN, masc::Feature::scale, masc::Feature::scaled(), ToString(), and type.
|
inlinestatic |
Definition at line 38 of file ContextBasedFeature.h.
References DH, DZ, Invalid, and type.
Referenced by CreateFeaturesFromCommand(), prepare(), and toString().
| int masc::ContextBasedFeature::ctxClassLabel |
Context class (label)
Definition at line 109 of file ContextBasedFeature.h.
Referenced by computeValue(), prepare(), and toString().
| int masc::ContextBasedFeature::kNN |
Definition at line 107 of file ContextBasedFeature.h.
Referenced by checkValidity(), prepare(), and toString().
| cloudViewer::ScalarField* masc::ContextBasedFeature::sf |
The computed scalar.
Definition at line 111 of file ContextBasedFeature.h.
| ContextBasedFeatureType masc::ContextBasedFeature::type |
Neighborhood feature type.
Definition at line 104 of file ContextBasedFeature.h.
Referenced by checkValidity(), computeValue(), prepare(), toString(), and ToString().