-
Notifications
You must be signed in to change notification settings - Fork 1
/
grabcut.h
executable file
·33 lines (29 loc) · 1.74 KB
/
grabcut.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifdef __cplusplus
#if __cplusplus
//extern "C"{
#endif
#endif
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
using namespace cv;
void learnGMMsFromSample( const Mat& img, const Mat& mask, Mat& bgdGMMPara, Mat& fgdGMMPara );
/* learn GMM model parameters from samples which are given by the user */
void grabCut_origin( InputArray _img, InputOutputArray _mask, Rect rect,
InputOutputArray _bgdModel, InputOutputArray _fgdModel,
int iterCount, int mode );
/* original grabcut() function provided by OpenCV */
void grabCut_lockFGBGmodel_linearCombine( InputArray _colorImg, InputArray _imgDiff, InputOutputArray _maskC,
InputArray _bgdModelC, InputArray _fgdModelC, InputArray _bgdModelDiff, InputArray _fgdModelDiff,
double alphaC, double alphadiff, double betaC, double betadiff);
/* linearly combine two cues (imgDiff + color) by the form: P(to source, to sink) = alphaC * -log(P(color)) + alphadiff * -log(P(diff)),
W(pixel, pixel) = betaC * W_based_on_color + betadiff * W_based_on_diff */
void grabCut_lockFGBGmodel_multiCombine( InputArray _colorImg, InputArray _imgDiff, InputOutputArray _maskC,
InputArray _bgdModelC, InputArray _fgdModelC, InputArray _bgdModelDiff, InputArray _fgdModelDiff,
double alphaC, double alphadiff, double betaC, double betadiff);
/* linearly combine two cues (imgDiff + color) by the form: P(to source, to sink) = alphaC * -log(P(color)) + alphadiff * -log(P(diff)),
W(pixel, pixel) = W_based_on_color^betaC + W_based_on_diff^betadiff */
#ifdef __cplusplus
#if __cplusplus
//}
#endif
#endif