46 bool voteFromReferenceObjectExists;
49 for (TypeToInnerMap::iterator typeIt = votedReferencePoses.begin();
50 typeIt != votedReferencePoses.end(); typeIt++)
52 for (IdToVoteMap::iterator idIt = typeIt->second.begin();
53 idIt != typeIt->second.end(); idIt++)
56 for (VotedPosePtrs::iterator voteIt = idIt->second.begin();
57 voteIt != idIt->second.end(); voteIt++)
65 if(voteIt != idIt->second.begin())
67 VotedPosePtrs::iterator previousVoteIt = std::prev(voteIt);
94 double confidence = 0;
101 double tmpWeight = summarizedVote.second.second;
102 confidence += (tmpWeight / votedPose->weightDenominator);
104 obj->type = votedPose->vote->objectType;
105 obj->observedId = votedPose->vote->observedId;
106 obj->weight = tmpWeight;
107 if(obj->type.find(
"_sub") == std::string::npos)
109 obj->confidence = votedPose->weight;
114 if ((confidence > 0) && (!result || (result->confidence < confidence)))
125 return (result !=
nullptr);
133 unsigned int fittingVoteCounter;
139 for (TypeToInnerMap::iterator typeIt = votes.begin();
140 typeIt != votes.end(); typeIt++)
143 for (IdToVoteMap::iterator idIt = typeIt->second.begin();
144 idIt != typeIt->second.end(); idIt++)
158 if (fittingVoteCounter > 0)
169 summarizedFittingVotes.push_back(std::make_pair(bestVotedPose, std::make_pair(fittingVoteCounter, bestWeight)));
RatingDataPtr ratingCache
bool computeVotingResult(VotingResultPtr &result, TypeToInnerMap votedReferencePoses)
static bool isSelfVote(const VoteSpecifierPtr &vote)
VotingSpacePtr mVotingSpaceInEval
void searchFittingVotes(TypeToInnerMap votes)
boost::shared_ptr< VotingResult > VotingResultPtr
boost::shared_ptr< RatingData > RatingDataPtr
SummarizedVotedPosePtrs summarizedFittingVotes
boost::shared_ptr< BaseRater > RaterPtr
VotedPosePtr originForFitting
boost::shared_ptr< VotedPose > VotedPosePtr
std::map< std::string, IdToVoteMap > TypeToInnerMap
VotingResultCalculator(VotingSpacePtr votingSpaceInEval, bool enabledSelfVoteCheck, int raterType=0)
static bool poseEqual(const PosePtr &p1, const PosePtr &p2)
boost::shared_ptr< ObjectSet > ObjectSetPtr
std::set< ObjectPtr > sourcesWithFittingVotes
std::vector< SummarizedVotedPosePtr > SummarizedVotedPosePtrs
std::pair< VotedPosePtr, CountWeightPair > SummarizedVotedPosePtr
unsigned int countSupportingOriginForFittingVotes(VotedPosePtrs originForFittingVotes)
bool enabledSelfVoteCheck
static constexpr double epsilon
boost::shared_ptr< VotingSpace > VotingSpacePtr
this namespace contains all generally usable classes.
boost::shared_ptr< Object > ObjectPtr