MaximumForegroundInferenceAlgorithm.cpp
Go to the documentation of this file.
1 
19 
21 
23  : ForegroundInferenceAlgorithm(pSceneObjects)
24  , mProbability(0.0)
25  {
26  }
27 
29  {
30  }
31 
32  void MaximumForegroundInferenceAlgorithm::doInference(std::vector<ISM::Object> pEvidenceList, std::ofstream& pRuntimeLogger)
33  {
34  ROS_INFO_STREAM("Calculating scene probability.");
35 
36  // Iterate over all scene objects, evaluate them and summarize the results.
37  mProbability = 0.0;
39  {
40  // Update the scene objects with the new evidence.
41  sceneObject->update(pEvidenceList, pRuntimeLogger);
42 
43  mProbability = std::max(mProbability, sceneObject->getSceneObjectProbability() * sceneObject->getSceneObjectPriori());
44  }
45 
46  // Iterate over all scene objects and mark the best one.
47  bool done = false;
48  for(boost::shared_ptr<SceneObjectDescription> sceneObject : *mSceneObjects)
49  {
50  if(sceneObject->getSceneObjectProbability() * sceneObject->getSceneObjectPriori() == mProbability && !done)
51  {
52  sceneObject->setBestStatus(true);
53  done = true;
54  } else
55  sceneObject->setBestStatus(false);
56  }
57  ROS_INFO_STREAM(" > Maximum scene probability is: '" << mProbability << "'.");
58  }
59 
61  {
62  return mProbability;
63  }
64 
65 }
MaximumForegroundInferenceAlgorithm(boost::shared_ptr< std::vector< boost::shared_ptr< SceneObjectDescription > > > &pSceneObjects)
#define ROS_INFO_STREAM(args)
void doInference(std::vector< ISM::Object > pEvidenceList, std::ofstream &pRuntimeLogger)
boost::shared_ptr< std::vector< boost::shared_ptr< SceneObjectDescription > > > mSceneObjects


asr_psm
Author(s): Braun Kai, Gehrung Joachim, Heizmann Heinrich, Meißner Pascal
autogenerated on Fri Nov 15 2019 03:57:54