MCPcopy Create free account
hub / github.com/biometrics/openbr / init

Method init

openbr/core/core.cpp:571–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569 }
570
571 void init(const QString &description)
572 {
573 if (loadOrExpand(description)) {
574 simplifyTransform();
575 return;
576 }
577
578 // check if the description is an abbreviation or model file with additional arguments supplied
579 File parsed("."+description);
580 if (loadOrExpand(parsed.suffix())) {
581 applyAdditionalProperties(parsed, transform.data());
582 simplifyTransform();
583 return;
584 }
585
586 const bool compareTransform = description.contains('!');
587 QStringList words = QtUtils::parse(description, compareTransform ? '!' : ':');
588
589 if ((words.size() < 1) || (words.size() > 2)) qFatal("Invalid algorithm format.");
590
591 transform = QSharedPointer<Transform>(Transform::make(words[0], NULL));
592 simplifyTransform();
593
594 if (words.size() > 1) {
595 if (!compareTransform) {
596 distance = QSharedPointer<Distance>(Distance::make(words[1], NULL));
597 comparison = QSharedPointer<Transform>(Transform::make("GalleryCompare", NULL));
598 comparison->setPropertyRecursive("distance", QVariant::fromValue(distance.data()));
599 }
600 else
601 comparison = QSharedPointer<Transform>(Transform::make(words[1], NULL));
602 }
603 }
604};
605
606} // namespace br

Callers

nothing calls this directly

Calls 6

makeFunction · 0.85
parseFunction · 0.70
dataMethod · 0.45
containsMethod · 0.45
sizeMethod · 0.45
setPropertyRecursiveMethod · 0.45

Tested by

no test coverage detected