-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp.1
95 lines (81 loc) · 2.66 KB
/
main.cpp.1
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
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "panorama_check.h"
using namespace cv;
using namespace std;
//vector<String> img_names = {"/home/nolan/Images/1.jpg", "/home/nolan/Images/2.jpg", "/home/nolan/Images/3.jpg",
// "/home/nolan/Images/4.jpg", "/home/nolan/Images/5.jpg"};
//vector<String> img_names = {"/home/baihao/Stitch/try_new/1.jpeg", "/home/baihao/Stitch/try_new/2.jpeg", "/home/baihao/Stitch/try_new/3.jpeg"};
vector<String> img_names = {"/AI/panoimg/1111111/3.jpg", "/AI/panoimg/1111111/4.jpg"};
//vector<String> img_names = {"/home/nolan/Images/c1.jpg", "/home/nolan/Images/c2.jpg", "/home/nolan/Images/c3.jpg",
// "/home/nolan/Images/c4.jpg"};
int main()
{
int num_images = static_cast<int>(img_names.size());
Mat pre_frame = imread(img_names[0]);
if (pre_frame.empty()){
return -2;
}
vector<string> image_names_temp;
store_each all_param;
all_param.full_imgs.push_back(pre_frame);
all_param = generate_result(all_param, 0);
for (int i = 1; i < num_images; ++i)
{
Mat pre_frame = imread(img_names[i]);
all_param.full_imgs.push_back(pre_frame);
// boost::thread api_caller(::generate_result(all_param, i) );
//
// if(api_caller.timed_join(boost::posix_time::milliseconds(500))){
all_param = generate_result(all_param, i);
// }else{
//
// }
//
}
imwrite("/AI/panoimg/result/6.jpg", all_param.result_stitched_img);
cout<<all_param.result_stitched_img.cols;
// all_param.;
char* core_data = 0;
return 0;
}
//void init_core_data(){
// store_each all_param;
// // 初始化 core_data
//}
//int main()
//{
// int num_images = static_cast<int>(img_names.size());
//
//
//
// Mat pre_frame = imread(img_names[0]);
// if (pre_frame.empty()){
// return -2;
// }
//
// vector<string> image_names_temp;
// store_each *all_param =(store_each *)(malloc(100000 * sizeof(store_each)));
// all_param->full_imgs.push_back(pre_frame);
// generate_result(*all_param, 0);
// for (int i = 1; i < num_images; ++i)
// {
// Mat pre_frame = imread(img_names[i]);
// all_param->full_imgs.push_back(pre_frame);
//
//// boost::thread api_caller(::generate_result(all_param, i) );
////
//// if(api_caller.timed_join(boost::posix_time::milliseconds(500))){
// generate_result(*all_param, i);
//// }else{
////
//// }
////
// }
// imwrite("/AI/panoimg/result/6.jpg", all_param->result_stitched_img);
// cout<<all_param->result_stitched_img.cols;
//// all_param.;
// char* core_data = 0;
//
// return 0;
//}