25 return instance->cost;
31 for (
unsigned int i = 0; i < pObjectTypes.size() - 1; i++)
32 for (
unsigned int j = i + 1; j < pObjectTypes.size(); j++)
33 mRelations.push_back(SceneModel::Relation(pObjectTypes[i], pObjectTypes[j]));
41 ISM::TopologyPtr ismTopology(
new ISM::Topology());
46 ismTopology->cost = pPsmTopology->getCost();
50 ismTopology->isValid =
false;
52 ismTopology->identifier = pPsmTopology->mIdentifier;
54 ismTopology->evaluationResult.falsePositives = pPsmTopology->getFalsePositives();
55 ismTopology->evaluationResult.falseNegatives = pPsmTopology->getFalseNegatives();
56 ismTopology->evaluationResult.averageRecognitionRuntime = pPsmTopology->getAverageRecognitionRuntime();
59 for (
unsigned int relationIndex = 0; relationIndex <
mRelations.size(); relationIndex++)
61 std::string objectA =
mRelations[relationIndex].getObjectTypeA();
62 std::string objectB =
mRelations[relationIndex].getObjectTypeB();
65 if (relation->containsObject(objectA) && relation->containsObject(objectB))
67 ISM::TrackPtr trackA(
new ISM::Track(objectA));
68 ISM::TrackPtr trackB(
new ISM::Track(objectB));
69 ISM::ObjectRelationPtr ismRelation(
new ISM::ObjectRelation(trackA, trackB,
mSceneId));
70 ismTopology->objectRelations[relationIndex] = ismRelation;
83 psmTopology->mUsedInOptimization =
false;
87 psmTopology->setCost(pIsmTopology->cost);
89 psmTopology->setEvaluationResult(pIsmTopology->evaluationResult.averageRecognitionRuntime,
90 pIsmTopology->evaluationResult.falsePositives,
91 pIsmTopology->evaluationResult.falseNegatives);
94 psmTopology->mIdentifier = pIsmTopology->identifier;
96 for (std::pair<unsigned int, ISM::ObjectRelationPtr> relation: pIsmTopology->objectRelations)
98 std::string objectTypeA = relation.second->getObjectTypeA();
99 std::string objectTypeB = relation.second->getObjectTypeB();
101 psmTopology->mRelations.push_back(psmRelation);
boost::shared_ptr< SceneModel::Topology > ismToPsm(ISM::TopologyPtr pIsmTopology)
double calculateCost(ISM::TopologyPtr instance)
ISM::TopologyPtr psmToIsm(boost::shared_ptr< SceneModel::Topology > pPsmTopology)
std::vector< SceneModel::Relation > mRelations
TopologyAdapter(std::vector< std::string > pObjectTypes, std::string pSceneId)
unsigned int mPSMTopologyIndex
unsigned int mISMTopologyIndex