GaussianMixtureModel.cpp
Go to the documentation of this file.
1 
19 
21 
23  {
24  }
25 
27  {
28  }
29 
31  {
32  // Check, if a kernel of this type already exists.
34  if(kernel.compare(pKernel))
35  return;
36 
37  // Kernel not already in distribution? Take it!
38  mKernels.push_back(pKernel);
39  }
40 
42  {
43  double sum = 0.0;
44 
45  // Calculate the sum over all kernels.
46  for(unsigned int i = 0; i < mKernels.size(); i++)
47  sum += mKernels[i].mWeight;
48 
49  // Normalize the kernels.
50  for(unsigned int i = 0; i < mKernels.size(); i++)
51  mKernels[i].mWeight /= sum;
52  }
53 
55  {
56  return mKernels.size();
57  }
58 
60  {
62  kernel.initializeVisualizer(mVisualizer);
63  }
64 
65  void GaussianMixtureModel::save(boost::property_tree::ptree& pPt, std::string pNode)
66  {
67  // Create a seperate tree for this gmm.
68  boost::property_tree::ptree subtree;
69 
70  BOOST_FOREACH(PSMLearner::GaussianKernel kernel, mKernels)
71  kernel.save(subtree);
72 
73  // Add subtree to main tree.
74  pPt.add_child(pNode, subtree);
75  }
76 
77  std::vector<PSMLearner::GaussianKernel> GaussianMixtureModel::getKernels() const
78  {
79  return mKernels;
80  }
81 
82 }
void save(boost::property_tree::ptree &pPt, std::string pNode)
void addKernel(const PSMLearner::GaussianKernel &pKernel)
void initializeVisualizer(boost::shared_ptr< Visualization::ProbabilisticSecondarySceneObjectVisualization > mSuperior)
std::vector< PSMLearner::GaussianKernel > getKernels() const
std::vector< PSMLearner::GaussianKernel > mKernels


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