![]() |
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 | Type { Type::PointFeature, Type::NeighborhoodFeature, Type::ContextBasedFeature, Type::DualCloudFeature, Type::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.
| typedef std::vector<Shared> masc::Feature::Set |
Set of features.
| typedef QSharedPointer<Feature> masc::Feature::Shared |
Shared type.
| enum masc::Feature::Stat |
|
strong |
Feature type.
|
inline |
Default constructor.
|
inlinevirtual |
Destructor.
|
static |
Creates (or resets) a scalar field with the given name on the input core points cloud
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::ContextBasedFeature, and masc::DualCloudFeature.
References cloud1, cloud2, getType(), NO_OPERATION, NO_STAT, op, PointFeature, and stat.
Referenced by masc::DualCloudFeature::checkValidity(), masc::ContextBasedFeature::checkValidity(), masc::NeighborhoodFeature::checkValidity(), and masc::PointFeature::checkValidity().
|
pure virtual |
Clones this feature.
Implemented in masc::PointFeature, masc::NeighborhoodFeature, masc::ContextBasedFeature, and masc::DualCloudFeature.
|
static |
Extracts the set of 'sources' from a set of features.
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.
|
pure virtual |
Returns the type (must be reimplemented by child struct)
Implemented in masc::PointFeature, masc::NeighborhoodFeature, masc::ContextBasedFeature, and masc::DualCloudFeature.
Referenced by checkValidity().
|
static |
Loads a set of 'sources' from a file.
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 |
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!)
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!)
References cloudViewer::ScalarField::computeMinAndMax(), NO_OPERATION, op, PerformMathOp(), IScalarFieldWrapper::pointValue(), cloudViewer::ScalarField::setValue(), and IScalarFieldWrapper::size().
|
static |
Performs a mathematical operation between two scalars.
References 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::ContextBasedFeature, and masc::DualCloudFeature.
|
static |
Creates (or resets) a scalar field with the given name on the input core points cloud
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.
References QtCompat::endl(), filename, and CVLog::Warning().
Referenced by Command3DMASCClassif::process().
|
inline |
Returns whether the feature has an associated scale.
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 |
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::ContextBasedFeature, and masc::DualCloudFeature.
| ccPointCloud* masc::Feature::cloud1 |
Referenced by masc::DualCloudFeature::checkValidity(), masc::ContextBasedFeature::checkValidity(), checkValidity(), masc::PointFeature::checkValidity(), masc::ContextBasedFeature::computeValue(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), and masc::PointFeature::prepare().
| QString masc::Feature::cloud1Label |
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 |
| QString masc::Feature::cloud2Label |
| Operation masc::Feature::op |
Referenced by masc::DualCloudFeature::checkValidity(), masc::NeighborhoodFeature::checkValidity(), 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)
Referenced by masc::NeighborhoodFeature::checkValidity(), masc::ContextBasedFeature::ContextBasedFeature(), masc::ContextBasedFeature::prepare(), masc::NeighborhoodFeature::prepare(), masc::PointFeature::prepare(), scaled(), masc::DualCloudFeature::toString(), masc::ContextBasedFeature::toString(), masc::NeighborhoodFeature::toString(), and masc::PointFeature::toString().
| bool masc::Feature::sf1WasAlreadyExisting |
| bool masc::Feature::sf2WasAlreadyExisting |
Referenced by masc::NeighborhoodFeature::prepare(), and masc::PointFeature::prepare().
| Source masc::Feature::source |
| Stat masc::Feature::stat |