-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmyGCApplication.h
38 lines (34 loc) · 1.01 KB
/
myGCApplication.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
34
35
36
37
38
#ifndef __MY_GC_APPLICATION__
#define __MY_GC_APPLICATION__
#include <opencv2\imgproc.hpp>
#include <iostream>
using namespace std;
using namespace cv;
class MyGCApplication
{
public:
enum { NOT_SET = 0, IN_PROCESS = 1, SET = 2 };
static const int radius = 2;
static const int thickness = -1;
void reset();
void setImageAndWinName(const Mat& _image, const string& _winName);
void showImage() const;
void mouseClick(int event, int x, int y, int flags, void* param);
int nextIter();
int getIterCount() const { return iterCount; }
void saveBinaryMaskImg(string maskFileName); // 保存结果生成的mask遮罩图片,用于poisson融合
void help();
private:
void setRectInMask();
void setLblsInMask(int flags, Point p, bool isPr);
const string* winName;
const Mat* image;
Mat mask;
Mat bgdModel, fgdModel;
uchar rectState, lblsState, prLblsState;
bool isInitialized;
Rect rect; // 矩形框
vector<Point> fgdPxls, bgdPxls, prFgdPxls, prBgdPxls; // 前景像素,背景像素,可能的前景像素,可能的背景像素
int iterCount;
};
#endif