25 cmd.
print(
"[CANUPO]");
27 return cmd.
error(QString(
"Missing parameter: classifier filename "
28 "(.prm) after \"-%1\"")
33 params.confidenceThreshold = 0.0;
34 params.generateAdditionalSF =
false;
35 params.generateRoughnessSF =
false;
37 params.useActiveSFForConfidence =
false;
39 QString classifierFilename;
43 QString argument = cmd.
arguments().front();
50 return cmd.
error(QString(
"Missing parameter: confidence "
51 "threshold after '%1'")
56 params.confidenceThreshold =
57 cmd.
arguments().takeFirst().toDouble(&ok);
58 if (!ok ||
params.confidenceThreshold < 0.0) {
59 return cmd.
error(QString(
"Invalid parameter: confidence "
60 "threshold after '%1'")
64 cmd.
print(QString(
"Confidence threshold set to %1")
65 .arg(
params.confidenceThreshold));
68 classifierFilename = argument;
74 if (classifierFilename.isEmpty()) {
75 return cmd.
error(
"Classifier name not set");
78 if (cmd.
clouds().empty()) {
79 return cmd.
error(
"Need at least At least one cloud must be loaded");
90 if (currentSFIndex >= 0) {
91 desc.pc->setCurrentDisplayedScalarField(currentSFIndex);
92 params.useActiveSFForConfidence =
true;
94 params.useActiveSFForConfidence =
false;
99 realCorePoints,
nullptr,
nullptr,
102 QString errorStr = cmd.
exportEntity(desc,
"CLASSIFIED");
103 if (!errorStr.isEmpty()) {
104 return cmd.
error(errorStr);
cmdLineReadable * params[]
Set of (core) point descriptors.
bool autoSaveMode() const
virtual QStringList & arguments()=0
Returns the list of arguments.
virtual void print(const QString &message) const =0
virtual bool error(const QString &message) const =0
static bool IsCommand(const QString &token, const char *command)
Test whether a command line token is a valid command keyword or not.
bool silentMode() const
Returns the silent mode.
virtual QString exportEntity(CLEntityDesc &entityDesc, const QString &suffix=QString(), QString *outputFilename=nullptr, ccCommandLineInterface::ExportOptions options=ExportOption::NoOptions)=0
Exports a cloud or a mesh.
virtual std::vector< CLCloudDesc > & clouds()
Currently opened point clouds and their filename.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
int getCurrentDisplayedScalarFieldIndex() const
Returns the currently displayed scalar field index (or -1 if none)
A generic 3D point cloud with index-based and presistent access to points.
static bool Classify(QString classifierFilename, const ClassifyParams ¶ms, ccPointCloud *cloud, cloudViewer::GenericIndexedCloudPersist *corePoints, CorePointDescSet &corePointsDescriptors, ccPointCloud *realCorePoints=nullptr, ecvMainAppInterface *app=nullptr, QWidget *parentWidget=nullptr, bool silent=false)
Classify a point cloud.
static const char COMMAND_CANUPO_CONFIDENCE[]
static const char COMMAND_CANUPO_CALSSIFY[]
Loaded cloud description.
virtual bool process(ccCommandLineInterface &cmd) override
Main process.
Generic command interface.
Command(const QString &name, const QString &keyword)
Default constructor.