![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Generic feature descriptor. More...
#include <FeaturesInterface.h>


Classes | |
| struct | Source |
| Sources of values for this feature. More... | |
Public Types | |
| 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 | |
| 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... | |
| virtual Type | getType () const =0 |
| Returns the type (must be reimplemented by child struct) More... | |
| virtual QString | toString () const =0 |
| Returns the formatted description. More... | |
| virtual Feature::Shared | clone () const =0 |
| Clones this feature. More... | |
| virtual bool | prepare (const CorePoints &corePoints, QString &error, cloudViewer::GenericProgressCallback *progressCb=nullptr, SFCollector *generatedScalarFields=nullptr)=0 |
| Prepares the feature (compute the scalar field, etc.) More... | |
| virtual bool | finish (const CorePoints &corePoints, QString &error) |
| Finishes the feature preparation (update the scalar field, etc.) More... | |
| bool | scaled () const |
| Returns whether the feature has an associated scale. More... | |
| virtual bool | checkValidity (QString corePointRole, QString &error) const |
| Checks the feature definition validity. More... | |
Static Public Member Functions | |
| 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 | |
| double | scale |
| Scale (diameter) More... | |
| ccPointCloud * | cloud1 |
| ccPointCloud * | cloud2 |
| QString | cloud1Label |
| QString | cloud2Label |
| Source | source |
| Stat | stat |
| Operation | op |
| bool | sf1WasAlreadyExisting |
| bool | sf2WasAlreadyExisting |
Generic feature descriptor.
Definition at line 46 of file FeaturesInterface.h.
| typedef std::vector<Shared> masc::Feature::Set |
Set of features.
Definition at line 52 of file FeaturesInterface.h.
| typedef QSharedPointer<Feature> masc::Feature::Shared |
Shared type.
Definition at line 49 of file FeaturesInterface.h.
| Enumerator | |
|---|---|
| NO_OPERATION | |
| MINUS | |
| PLUS | |
| DIVIDE | |
| MULTIPLY | |
Definition at line 95 of file FeaturesInterface.h.
| enum masc::Feature::Stat |
| Enumerator | |
|---|---|
| NO_STAT | |
| MEAN | |
| MODE | |
| MEDIAN | |
| STD | |
| RANGE | |
| SKEW | |
Definition at line 65 of file FeaturesInterface.h.
|
strong |
Feature type.
Definition at line 56 of file FeaturesInterface.h.
|
inline |
Default constructor.
Definition at line 138 of file FeaturesInterface.h.
|
inlinevirtual |
Destructor.
Definition at line 151 of file FeaturesInterface.h.
|
static |
Creates (or resets) a scalar field with the given name on the input core points cloud
Definition at line 19 of file FeaturesInterface.cpp.
References cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName().
Referenced by masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), and masc::PointFeature::prepare().
|
inlinevirtual |
Checks the feature definition validity.
Reimplemented in masc::PointFeature, masc::NeighborhoodFeature, masc::DualCloudFeature, and masc::ContextBasedFeature.
Definition at line 179 of file FeaturesInterface.h.
References cloud1, cloud2, error(), getType(), NO_OPERATION, NO_STAT, op, PointFeature, and stat.
Referenced by masc::ContextBasedFeature::checkValidity(), masc::DualCloudFeature::checkValidity(), masc::NeighborhoodFeature::checkValidity(), and masc::PointFeature::checkValidity().
|
pure virtual |
Clones this feature.
Implemented in masc::PointFeature, masc::NeighborhoodFeature, masc::DualCloudFeature, and masc::ContextBasedFeature.
|
static |
Extracts the set of 'sources' from a set of features.
Definition at line 195 of file FeaturesInterface.cpp.
References CVLog::Warning().
Referenced by q3DMASCPlugin::doClassifyAction(), q3DMASCPlugin::doTrainAction(), and Command3DMASCClassif::process().
|
inlinevirtual |
Finishes the feature preparation (update the scalar field, etc.)
Reimplemented in masc::PointFeature, masc::NeighborhoodFeature, and masc::ContextBasedFeature.
Definition at line 170 of file FeaturesInterface.h.
|
pure virtual |
Returns the type (must be reimplemented by child struct)
Implemented in masc::PointFeature, masc::NeighborhoodFeature, masc::DualCloudFeature, and masc::ContextBasedFeature.
Referenced by checkValidity().
|
static |
Loads a set of 'sources' from a file.
Definition at line 154 of file FeaturesInterface.cpp.
References masc::Feature::Source::Blue, filename, masc::Feature::Source::name, masc::Feature::Source::ScalarField, masc::Feature::Source::type, and CVLog::Warning().
Referenced by Command3DMASCClassif::process().
|
inlinestatic |
Definition at line 97 of file FeaturesInterface.h.
References DIVIDE, MINUS, MULTIPLY, op, and PLUS.
Referenced by masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), masc::NeighborhoodFeature::toString(), and masc::PointFeature::toString().
|
static |
Performs a mathematical operation between two scalar fields (they must have the same size!)
Definition at line 95 of file FeaturesInterface.cpp.
References cloudViewer::ScalarField::computeMinAndMax(), cloudViewer::ScalarField::getValue(), NO_OPERATION, op, PerformMathOp(), and cloudViewer::ScalarField::setValue().
|
static |
Performs a mathematical operation between two scalar fields (they must have the same size!)
Definition at line 116 of file FeaturesInterface.cpp.
References cloudViewer::ScalarField::computeMinAndMax(), NO_OPERATION, op, PerformMathOp(), IScalarFieldWrapper::pointValue(), cloudViewer::ScalarField::setValue(), and IScalarFieldWrapper::size().
|
static |
Performs a mathematical operation between two scalars.
Definition at line 72 of file FeaturesInterface.cpp.
References abs(), DIVIDE, MINUS, MULTIPLY, NAN_VALUE, op, and PLUS.
Referenced by ComputeMathOpWithNearestNeighbor(), masc::NeighborhoodFeature::finish(), masc::PointFeature::finish(), and PerformMathOp().
|
pure virtual |
Prepares the feature (compute the scalar field, etc.)
Implemented in masc::PointFeature, masc::NeighborhoodFeature, masc::DualCloudFeature, and masc::ContextBasedFeature.
|
static |
Creates (or resets) a scalar field with the given name on the input core points cloud
Definition at line 29 of file FeaturesInterface.cpp.
References ccPointCloud::addScalarField(), cloudViewer::ScalarField::fill(), cloudViewer::PointCloudTpl< T >::getScalarField(), cloudViewer::PointCloudTpl< T >::getScalarFieldIndexByName(), NAN_VALUE, SFCollector::push(), CCShareable::release(), cloudViewer::ScalarField::resizeSafe(), cloudViewer::PointCloudTpl< T >::size(), and CVLog::Warning().
Referenced by masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), and masc::PointFeature::prepare().
|
static |
Saves a set of 'sources' to a file.
Definition at line 138 of file FeaturesInterface.cpp.
References QtCompat::endl(), filename, and CVLog::Warning().
Referenced by Command3DMASCClassif::process().
|
inline |
Returns whether the feature has an associated scale.
Definition at line 176 of file FeaturesInterface.h.
References scale.
Referenced by masc::ContextBasedFeature::checkValidity(), masc::PointFeature::checkValidity(), masc::PointFeature::finish(), masc::ContextBasedFeature::prepare(), masc::PointFeature::prepare(), masc::ContextBasedFeature::toString(), and masc::PointFeature::toString().
|
inlinestatic |
Definition at line 75 of file FeaturesInterface.h.
References MEAN, MEDIAN, MODE, RANGE, SKEW, stat, and STD.
Referenced by masc::PointFeature::prepare(), and masc::PointFeature::toString().
|
pure virtual |
Returns the formatted description.
Implemented in masc::PointFeature, masc::NeighborhoodFeature, masc::DualCloudFeature, and masc::ContextBasedFeature.
| ccPointCloud* masc::Feature::cloud1 |
Definition at line 232 of file FeaturesInterface.h.
Referenced by checkValidity(), masc::ContextBasedFeature::checkValidity(), masc::DualCloudFeature::checkValidity(), masc::PointFeature::checkValidity(), masc::ContextBasedFeature::computeValue(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), and masc::PointFeature::prepare().
| QString masc::Feature::cloud1Label |
Definition at line 233 of file FeaturesInterface.h.
Referenced by masc::ContextBasedFeature::checkValidity(), masc::PointFeature::checkValidity(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), masc::ContextBasedFeature::toString(), masc::NeighborhoodFeature::toString(), and masc::PointFeature::toString().
| ccPointCloud * masc::Feature::cloud2 |
Definition at line 232 of file FeaturesInterface.h.
Referenced by checkValidity(), masc::DualCloudFeature::checkValidity(), masc::NeighborhoodFeature::checkValidity(), masc::PointFeature::checkValidity(), masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), masc::NeighborhoodFeature::toString(), and masc::PointFeature::toString().
| QString masc::Feature::cloud2Label |
Definition at line 233 of file FeaturesInterface.h.
Referenced by masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), masc::NeighborhoodFeature::toString(), and masc::PointFeature::toString().
| Operation masc::Feature::op |
Definition at line 238 of file FeaturesInterface.h.
Referenced by checkValidity(), masc::DualCloudFeature::checkValidity(), masc::NeighborhoodFeature::checkValidity(), masc::PointFeature::checkValidity(), masc::NeighborhoodFeature::finish(), masc::PointFeature::finish(), OpToString(), PerformMathOp(), masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), masc::NeighborhoodFeature::toString(), and masc::PointFeature::toString().
| double masc::Feature::scale |
Scale (diameter)
Definition at line 230 of file FeaturesInterface.h.
Referenced by masc::NeighborhoodFeature::checkValidity(), masc::ContextBasedFeature::ContextBasedFeature(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), scaled(), masc::ContextBasedFeature::toString(), masc::DualCloudFeature::toString(), masc::NeighborhoodFeature::toString(), and masc::PointFeature::toString().
| bool masc::Feature::sf1WasAlreadyExisting |
Definition at line 240 of file FeaturesInterface.h.
Referenced by masc::NeighborhoodFeature::finish(), masc::PointFeature::finish(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), and masc::PointFeature::prepare().
| bool masc::Feature::sf2WasAlreadyExisting |
Definition at line 241 of file FeaturesInterface.h.
Referenced by masc::NeighborhoodFeature::prepare(), and masc::PointFeature::prepare().
| Source masc::Feature::source |
Definition at line 235 of file FeaturesInterface.h.
Referenced by masc::PointFeature::PointFeature(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), and masc::PointFeature::prepare().
| Stat masc::Feature::stat |
Definition at line 237 of file FeaturesInterface.h.
Referenced by checkValidity(), masc::NeighborhoodFeature::checkValidity(), masc::PointFeature::checkValidity(), masc::PointFeature::computeStat(), masc::PointFeature::prepare(), StatToString(), and masc::PointFeature::toString().