forked from NickStupich/Rolling-Shutter-Video-Stabilization
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nullTransform.cpp
72 lines (52 loc) · 1.63 KB
/
nullTransform.cpp
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
#include <iostream> // for standard I/O
#include <string> // for strings
#include <iomanip> // for controlling float print precision
#include <sstream> // string to number conversion
#include <time.h>
#include <numeric>
#include "nullTransform.h"
#include "svd.h"
#include "structures.h"
#include "settings.h"
#include "coreFuncs.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"
NullTransform::NullTransform(){
}
NullTransform::NullTransform(Mat img1, Mat img2, int index0, int index1){
imgBound ib = {0, img1.cols, 0, img1.rows};
frameBound = ib;
/*
vector<Point2f> corners1, corners2;
int length = GetPointsToTrack(img1, img2, corners1, corners2);
*/
#ifdef SHFITS_FILENAME
evalTransforms(index0, index1, (char*)SHFITS_FILENAME);
#endif
}
void NullTransform::CreateAbsoluteTransform(NullTransform prevTransform){
}
void NullTransform::TransformPoint(float x, float y, float &x2, float &y2){
x2 = x;
y2 = y;
}
void NullTransform::TransformPointAbs(float x, float y, float &x2, float &y2){
x2 = x;
y2 = y;
}
vector<PointShift> loadActualShifts(char* filename){
vector<PointShift> frameShifts;
FILE* fp = fopen(filename, "r");
float x1, y1, x2, y2;
while(fscanf(fp, "%f\t%f\t%f\t%f", &x1, &y1, &x2, &y2) != EOF){
PointShift ps = {x1, y1, x2, y2};
frameShifts.push_back(ps);
}
fclose(fp);
return frameShifts;
}