forked from omarocegueda/registration
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ecqmmfCPP.h
19 lines (19 loc) · 1.58 KB
/
ecqmmfCPP.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef ECQMMF_H
#define ECQMMF_H
//#define ESTIMATE_VARIANCES
const int NEIGH_SIZE=4;
const int dRow[]={-1, 0, 1, 0};
const int dCol[]={0, 1, 0, -1};
#define EPSILON 1e-9
double updateConstantModels(double *img, double *probs, int nrows, int ncols, int nclasses, double *means, double *variances);
int updateVariances(double *img, double *probs, int nrows, int ncols, int nclasses, double *means, double *variances);
double iterateMarginalsAt(int row, int col, double *likelihood, double *probs, int nrows, int ncols, int nclasses, double lambdaParam, double mu, double *N, double *D, double *prev);
double iterateMarginals(double *likelihood, double *probs, int nrows, int ncols, int nclasses, double lambdaParam, double mu, double *N, double *D, double *prev);
int computeNegLogLikelihoodConstantModels(double *img, int nrows, int ncols, int nclasses, double *means, double *variances, double *likelihood);
int initializeConstantModels(double *img, int nrows, int ncols, int nclasses, double *means, double *variances);
int initializeMaximumLikelihoodProbs(double *negLogLikelihood, int nrows, int ncols, int nclasses, double *probs);
int initializeNormalizedLikelihood(double *negLogLikelihood, int nrows, int ncols, int nclasses, double *probs);
int getImageModes(double *probs, int nrows, int ncols, int nclasses, double *means, double *modes);
int getImageSegmentation(double *probs, int nrows, int ncols, int nclasses, double *means, int *seg);
double optimizeMarginals(double *likelihood, double *probs, int nrows, int ncols, int nclasses, double lambdaParam, double mu, int maxIter, double tolerance);
#endif