-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPastPicture.cpp
More file actions
40 lines (30 loc) · 1009 Bytes
/
PastPicture.cpp
File metadata and controls
40 lines (30 loc) · 1009 Bytes
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
#include <iostream>
#include <fstream>
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/stitching/stitcher.hpp"
using namespace std;
using namespace cv;
bool try_use_gpu = false;
vector<Mat> imgs;
string result_name = "C:\\Users\\Administrator\\Desktop\\face.test\\test\\test\\result.jpg";
//void printUsage();
//int parseCmdArgs(int argc, char** argv);
int main(int argc, char* argv[])
{
Mat img = imread("C:\\Users\\Administrator\\Desktop\\face.test\\test\\face\\1.bmp");
imgs.push_back(img);
img = imread("C:\\Users\\Administrator\\Desktop\\face.test\\test\\face\\2.bmp");
imgs.push_back(img);
img = imread("C:\\Users\\Administrator\\Desktop\\face.test\\test\\face\\3.bmp");
imgs.push_back(img);
Mat pano;
Stitcher stitcher = Stitcher::createDefault(try_use_gpu);
Stitcher::Status status = stitcher.stitch(imgs, pano);
if (status != Stitcher::OK)
{
cout << "Can't stitch images, error code = " << int(status) << endl;
return -1;
}
imwrite(result_name, pano);
return 0;
}