forked from ehendrikd/slBenchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBinaryImplementation.h
55 lines (46 loc) · 1.81 KB
/
BinaryImplementation.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
#ifndef BINARY_IMPLEMENTATION_H
#define BINARY_IMPLEMENTATION_H
#include "slBenchmark.h"
using namespace cv;
enum backgroundType {White,Black};
class BinaryImplementation : public slImplementation {
public:
BinaryImplementation();
virtual ~BinaryImplementation() {};
void preExperimentRun();
void postExperimentRun();
virtual double getPatternWidth();
bool hasMoreIterations();
virtual Mat generatePattern();
virtual void iterationProcess();
//virtual void postIterationsProcess();
//Getters and Setters
unsigned int getNumberPatterns();
unsigned int getNumberColumns();
virtual int getBinaryCode(int, int);
// The next function determine whether a colour can be
// considered to be white or black. This is determined by
// the contrast between the first and the second captures:
// if the contrast is above a certain threshold (Black_Threshold),
// then the colour is considered black. If the contrast is below a
// certain threshold (White_Threshold) it is considered white.
// If it is between the two threshold it is uncertain.
int guessColour(int);
void generateBackground(Mat &pattern, Scalar &colour);
virtual double solveCorrespondence(int, int);
protected:
unsigned int numberPatterns;
unsigned int numberColumns;
// The patterns for are bicolour, typically
// black and white. In reality, they can be
// shades of gray to avoid reflection of light
// This is specified by the following two attributes.
unsigned short Black_Value;
unsigned short White_Value;
// The thresholds for black and white values
short Black_Threshold;
short White_Threshold;
// An array containing the codes for each column
int *binaryCode;
};
#endif //BINARY_IMPLEMENTATION_H