MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / loadClassifierModel

Method loadClassifierModel

ml/src/svm_wrapper.cpp:499–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497}
498
499bool
500pcl::SVMClassify::loadClassifierModel(const char* filename)
501{
502 auto* out = reinterpret_cast<SVMModel*>(svm_load_model(filename));
503 if (out == nullptr) {
504 PCL_ERROR("[pcl::%s::loadClassifierModel] Can't open classifier model %s.\n",
505 getClassName().c_str(),
506 filename);
507 return false;
508 }
509
510 model_ = *out;
511 free(out);
512
513 if (model_.l == 0) {
514 PCL_ERROR("[pcl::%s::loadClassifierModel] Can't open classifier model %s.\n",
515 getClassName().c_str(),
516 filename);
517 return false;
518 }
519
520 scaling_.obj = model_.scaling;
521
522 int i = 0;
523
524 while (model_.scaling[i].index != -1)
525 i++;
526
527 scaling_.max = i;
528
529 return true;
530}
531
532bool
533pcl::SVMClassify::classificationTest()

Callers

nothing calls this directly

Calls 2

svm_load_modelFunction · 0.85
getClassNameFunction · 0.50

Tested by

no test coverage detected