forked from NickStupich/Rolling-Shutter-Video-Stabilization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructures.h
155 lines (134 loc) · 2.62 KB
/
structures.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#ifndef STRUCTURES_H
#define STRUCTURES_H
#include <opencv2/imgproc/imgproc.hpp> // Gaussian Blur
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/features2d.hpp>
#include <opencv2/video/tracking.hpp>
#include "opencv2/imgproc/imgproc_c.h"
using namespace cv;
using namespace std;
typedef struct
{
vector<Point2f> features;
vector<Mat> pyramid;
} FeaturesInfo;
typedef struct
{
float ux1;
float uy1;
float ux2;
float uy2;
float rotation;
float cos;
float sin;
} Transformation;
/*
class Transformation{
public:
float ux1;
float uy1;
float ux2;
float uy2;
float rotation;
float cos;
float sin;
Transformation(float _ux1, float _uy1, float _ux2, float _uy2, float _rotation, float _cos, float _sin){
ux1 = _ux1;
uy1 = _uy1;
ux2 = _ux2;
uy2 = _uy2;
rotation = _rotation;
cos = _cos;
sin = _sin;
}
void TransformPoint(float x, float y, float &x2, float &y2){
x2 = (x-ux1) * cos - (y-uy1) * sin + ux2;
y2 = (x-ux1) * sin + (y-uy1) * cos + uy2;
}
};
class AbsoluteTransformation{
public:
Transformation trans;
float idx;
float idy;
AbsoluteTransformation(Transformation _trans, AbsoluteTransformation prevTrans){
}
void TransformPoint(float x, float y, float &x2, float &y2){
trans.TransformPoint(x, y, x2, y2);
x2 += idx;
y2 += idy;
}
};*/
typedef struct
{
Transformation trans;
float idx;
float idy;
} AbsoluteTransformation;
typedef struct
{
int minX;
int maxX;
int minY;
int maxY;
} imgBound;
typedef struct
{
double minX;
double maxX;
double minY;
double maxY;
} cropBound;
typedef struct
{
float x1;
float y1;
float x2;
float y2;
} PointShift;
typedef struct
{
char *inFileName, *outFileName;
int fourcc;
char *codec;
int encQuality;
int encBitrate;
int method;
int threads;
bool warnings;
int corners;
int cornerRows;
int cornerCols;
bool noSubpix;
bool test;
int winSize;
int noCrop;
double cSmooth;
double zoom;
float djdShift;
float djdLinear;
float djdAmount;
double qualityLevel;
int maxLevel;
int iter;
double epsilon;
double eigThr;
bool twoPass;
} arguments;
typedef struct
{
int from;
int to;
} threadParams;
typedef struct
{
float **shiftsX;
float **shiftsY;
float *params;
int width;
int height;
int numParams;
} TransformationMem;
#endif