25 ObjectRelations& topology,
const std::vector<std::pair<int, TrackPtr> >& mostCommonObjects,
26 std::map<TrackPtr, int>& objectOccurences)
28 if (referenceWithParent.second == 0)
34 this->
recommendedLevel = referenceWithParent.second->getRecommendedLevel() + 1;
37 this->
reference = referenceWithParent.first;
38 std::vector<TrackPtr> clustersTracks;
42 bool referenceInserted =
false;
43 for (ObjectRelations::iterator relationIt = topology.begin(); relationIt != topology.end();)
46 if (relationIt->second->containsObject(referenceWithParent.first->type,
47 referenceWithParent.first->observedId))
49 bool childInserted =
false;
50 for (std::vector<std::pair<int, TrackPtr> >::const_iterator tracksIt = mostCommonObjects.begin();
51 tracksIt != mostCommonObjects.end();
54 if (tracksIt->second->type == referenceWithParent.first->type &&
55 tracksIt->second->observedId == referenceWithParent.first->observedId)
57 if (referenceInserted ==
false)
60 referenceInserted =
true;
61 std::vector<VoteSpecifierPtr> votes;
63 for (
size_t i = 0; i < referenceWithParent.first->objects.size(); ++i)
65 if (referenceWithParent.first->objects[i] == 0)
74 votes.push_back(vote);
80 std::map<std::string, std::vector<VoteSpecifierPtr>>();
85 else if (relationIt->second->containsObject(tracksIt->second->type, tracksIt->second->observedId))
89 std::vector<VoteSpecifierPtr> votes;
90 if (relationIt->second->getObjectTypeA() == tracksIt->second->type &&
91 relationIt->second->getObjectIdA() == tracksIt->second->observedId)
93 votes = relationIt->second->getVotesFromAForReferencePoseB();
97 votes = relationIt->second->getVotesFromBForReferencePoseA();
103 std::map<std::string, std::vector<VoteSpecifierPtr>>();
108 if (childInserted && referenceInserted)
114 objectOccurences[relationIt->second->getTrackA()] -= 1;
115 objectOccurences[relationIt->second->getTrackB()] -= 1;
117 topology.erase(relationIt++);
128 const std::string &observedId)
const boost::shared_ptr< Quaternion > QuaternionPtr
unsigned recommendedLevel
Cluster(const std::pair< TrackPtr, boost::shared_ptr< Cluster > > &referenceWithParent, ObjectRelations &topology, const std::vector< std::pair< int, TrackPtr > > &mostCommonObjects, std::map< TrackPtr, int > &objectOccurences)
std::vector< VoteSpecifierPtr > getVotersByVotersTypeAndObservedId(const std::string &type, const std::string &observedId) const
std::map< unsigned int, ISM::ObjectRelationPtr, std::less< unsigned > > ObjectRelations
unsigned getRecommendedLevel()
boost::shared_ptr< VoteSpecifier > VoteSpecifierPtr
boost::shared_ptr< Tracks > TracksPtr
std::map< std::string, std::map< std::string, std::vector< VoteSpecifierPtr > > > votesByVotersTypeAndObservedId
boost::shared_ptr< Track > TrackPtr
this namespace contains all generally usable classes.