-
Notifications
You must be signed in to change notification settings - Fork 5
/
ident.h
68 lines (55 loc) · 1.64 KB
/
ident.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
/**
* ocv_ar - OpenCV based Augmented Reality library
*
* Marker identification base class -- header file.
*
* Author: Markus Konrad <konrad@htw-berlin.de>, June 2014.
* INKA Research Group, HTW Berlin - http://inka.htw-berlin.de/
*
* See LICENSE for license.
*/
#ifndef OCV_AR_IDENT_H
#define OCV_AR_IDENT_H
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include "types.h"
#include "marker.h"
namespace ocv_ar {
/**
* Abstract base class for all identificators providing common methods and a uniform
* interface.
*/
class IdentificatorBase {
public:
/**
* Base constructor to set the identificator type <t> and the required marker size
* <markerSize> in pixels.
*/
IdentificatorBase(IdentificatorType t, int markerSize) : type(t),
reqMarkerSize(markerSize)
{};
/**
* Empty virtual deconstructor.
*/
virtual ~IdentificatorBase() {};
/**
* Abstract method to read a marker code from the image region <area> and save
* possible results in <marker>.
* Returns true if the code could be read, otherwise false.
*/
virtual bool readMarkerCode(const cv::Mat &area, Marker &marker) = 0;
/**
* Returns the required marker size.
*/
int getRequiredMarkerSize() const { return reqMarkerSize; }
/**
* Returns the idenficator type.
*/
IdentificatorType getType() { return type; }
protected:
IdentificatorType type; // identificator type
int reqMarkerSize; // required marker size
};
}
#endif