-
Notifications
You must be signed in to change notification settings - Fork 0
/
tool.h
141 lines (109 loc) · 3.35 KB
/
tool.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#ifndef TOOL_H
#define TOOL_H
#include <QObject>
#include <QImage>
#include <vector>
#include "icgbench.h"
#include "gpu.h"
#include <opencv2/core.hpp>
using namespace std;
//using namespace arma;
using namespace cv;
class ScribbleArea;
#include <scribblearea.h>
struct Scribble
{
int label,x,y;
Vec3f rgb;
};
class Tool : public QObject
{
Q_OBJECT
public:
Tool();
~Tool();
ScribbleArea *in,*out;
std::vector<Scribble> scribbles, scribbles_orig;
vector<unsigned> label_count,label_count_orig;
unsigned TexWinSize,NrWaveletSteps,BrushSize,currentIt, nr_labels,eig,TexDim;
float kernel_alpha,kernel_sigma,kernel_beta, kernel_delta,seg_it, seg_tau,seg_lambda, seg_eta;
vector<Mat> likely;
vector<Mat> data_term;
vector<Mat> theta, eta;
vector<Mat> xi;
Mat labeling, groundtruth, LDAimage, G;
vector<Mat> Textures, primal, dual;
vector<Mat> WaveletHH,WaveletLH,WaveletHL, WaveletLL;
QString WaveletFilter;
int ColorMode, GMode, Anisotropy;
bool EstimateGPU;
bool Color,Space,Texture;
bool ColorDone, TextureDone;
bool LDATexSpace, AutoParam;
GPU_DATA gpu;
GPU_DATA const_gpu;
Mat LDA(Mat Call, vector<Mat> Ceach);
Mat OLDA(Mat Call, vector<Mat> Ceach, vector<Scribble> &scrib, vector<unsigned> &count);
void readScribbles();
double DiceScore(QString file);
Mat ColorLDA(bool show,bool ortho);
bool GTerm(bool show);
bool Wavelet(bool show);
bool GPUSegmentation(bool stepwise);
bool LBP(int radius, int samples);
bool ColorLBP(int radius, int samples);
void projectDijkstra();
void projectSimplex(vector<double> &in);
void getKNN(int x, int y, vector<Scribble> out);
void printPixelInformation(unsigned x, unsigned y);
Mat computeLabeling(vector<Mat> &input);
Mat makeBeautifulSegmentation();
public slots:
void doLBP();
void doTest();
void doColorLDA();
void doColorOLDA();
bool doKernelEstimation();
bool doKernelEstimation(bool doAll);
void doGTerm();
void setEigenVector(int i);
void setColor(int i);
void setGMode(int i);
void setSpace(int i);
void setTexture(int i);
void setSigma(double s);
void setAlpha(double a);
void setTau(double t);
void setBeta(double b);
void setEta(double e);
void setLambda(double l);
void setIterations(int it);
void setColorMode(int i);
void setTextureMode(int i);
void setEstimateGPU(int i);
void setAnisotropy(int i);
void setWaveletSteps(int i);
void setTexDim(int i);
void setTexWin(int i);
void doContSeg();
void doGPUSegmentationStepwise();
void doGPUSegmentationConvergence();
void doDumpImage();
void setAutoParam(int i);
void setDelta(double d);
void doBenchIcgFile();
double BenchIcgFile(QString file);
void doBenchmark();
void doBenchmark(string dir);
void doWavelet();
void setWaveletFilter(QString str);
void setBrushSize(int i);
void doIcgBench();
void LoadIcgBenchFile(QString file);
double doDiceScore();
void doDiceScoreWithOutput();
void loadCImgData();
void doDumpEstimation();
void doFull();
};
#endif // TOOL_H