The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mixGauss Class Reference

#include <mixgauss.h>

Inheritance diagram for mixGauss:

Inheritance graph
[legend]
List of all members.

Protected Member Functions

double getMixProb (const int rgb[], double means[][3], double covariances[][3], double weights[])

Member Function Documentation

double getMixProb const int  rgb[],
double  means[][3],
double  covariances[][3],
double  weights[]
[protected]
 

Definition at line 120 of file mixgauss.cpp.

References i, and PI.

Referenced by nonSkinMixGauss::getMixProb(), and skinMixGauss::getMixProb().

00120                                                                                                          {
00121         int i, j;
00122         const double PI = 3.14159265358979;
00123         const double constTerm = pow(double(2.0)*PI, double(3.0)/double(2.0));
00124         double sumprobs = 0.0;
00125         for (i = 0; i < 16; i++) {
00126                 double rootDetCov = sqrt(covariances[i][0] * covariances[i][1] * covariances[i][2]);
00127                 double ScalingTerm = double(1.0)/(constTerm*rootDetCov);
00128                 double sum = 0.0;
00129                 for (j = 0; j < 3; j++) {
00130                         sum += pow(rgb[j] - means[i][j], 2) / covariances[i][j];
00131                 }
00132     sumprobs += weights[i] * ScalingTerm * exp(-.5 * sum);
00133         }
00134         return (sumprobs);
00135 }


The documentation for this class was generated from the following files:
Generated on Mon Nov 8 17:08:32 2004 for MPT by  doxygen 1.3.9.1