-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (40 loc) · 1.47 KB
/
main.cpp
File metadata and controls
53 lines (40 loc) · 1.47 KB
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
#include <iostream>
#include "./Stitching/NISwGSP_Stitching.h"
#include "./Debugger/TimeCalculator.h"
#define _CRT_SECURE_NO_WARNINGS
using namespace std;
int GRID_SIZE_w = 40;
int GRID_SIZE_h = 40;
int main(int argc, const char* argv[]) {
int num_data = 2; // dataset number + 1
const char* data_list[] = { "nothing-here","AANAP-01_skyline"};
Eigen::initParallel();
CV_DNN_REGISTER_LAYER_CLASS(Crop, CropLayer);
cout << "nThreads = " << Eigen::nbThreads() << endl;
cout << "[#Images : " << num_data - 1 << "]" << endl;
time_t start = clock();
TimeCalculator timer;
for (int i = 1; i < num_data; ++i) {
cout << "i = " << i << ", [Images : " << data_list[i] << "]" << endl;
MultiImages multi_images(data_list[i], LINES_FILTER_WIDTH, LINES_FILTER_LENGTH);
NISwGSP_Stitching niswgsp(multi_images);
niswgsp.setWeightToAlignmentTerm(1);
niswgsp.setWeightToLocalSimilarityTerm(0.75);
niswgsp.setWeightToGlobalSimilarityTerm(6, 20, GLOBAL_ROTATION_2D_METHOD);
niswgsp.setWeightToContentPreservingTerm(1.5);
Mat blend_linear;
vector<vector<Point2> > original_vertices;
if (RUN_TYPE != 0) {
blend_linear = niswgsp.solve_content(BLEND_LINEAR, original_vertices);
}
else {
blend_linear = niswgsp.solve(BLEND_LINEAR, original_vertices);
}
time_t end = clock();
cout << "Time:" << double(end - start) / CLOCKS_PER_SEC << endl;
niswgsp.writeImage(blend_linear, BLENDING_METHODS_NAME[BLEND_LINEAR]);
niswgsp.assessment(original_vertices);
}
return 0;
}