103 Mat3d rgb_covariance;
120 rgb_covariance.
r1 += r *
r;
121 rgb_covariance.
r2 += r *
g;
122 rgb_covariance.
r3 += r *
b;
123 rgb_covariance.
r4 += r *
g;
124 rgb_covariance.
r5 += g *
g;
125 rgb_covariance.
r6 += g *
b;
126 rgb_covariance.
r7 += r *
b;
127 rgb_covariance.
r8 += g *
b;
128 rgb_covariance.
r9 += b *
b;
152 return rd * rd + gd * gd + bd * bd;
157 FILE *f = fopen(pFileName,
"r");
167 if (fscanf(f,
"%f %f %f %f %f %f %f %f %f\n",
183 FILE *f = fopen(pFileName,
"w");
193 if (fprintf(f,
"%.10f %.10f %.10f %.10f %.10f %.10f %.10f %.10f %.10f\n",
Data structure for the representation of a 3D vector.
void CalculateColorModel()
Mat3d inverse_rgb_covariance
void SetVec(Vec3d &vec, float x, float y, float z)
void MulVecScalar(const Vec3d &vec, float scalar, Vec3d &result)
void Invert(const Mat3d &matrix, Mat3d &result)
void AddToVec(Vec3d &vec, const Vec3d &vectorToAdd)
void MulMatScalar(const Mat3d &matrix, float scalar, Mat3d &result)
void SetInverseCovariance(const Mat3d &inverse_covariance)
void SetMean(const Vec3d &mean)
float CalculateColorProbability(const Vec3d &rgb)
bool AddRGBTriplet(int r, int g, int b)
void Reset(int nMaxNumberOfTriplets)
GLdouble GLdouble GLdouble r
bool LoadFromFile(const char *pFileName)
float EvaluateForm(const Vec3d &matrix1, const Mat3d &matrix2)
bool SaveToFile(const char *pFileName)
void SubtractVecVec(const Vec3d &vector1, const Vec3d &vector2, Vec3d &result)
int m_nMaxNumberOfTriplets
void SetMat(Mat3d &matrix, float r1, float r2, float r3, float r4, float r5, float r6, float r7, float r8, float r9)
Data structure for the representation of a 3x3 matrix.
float CalculateColorDistanceSquared(int r, int g, int b)