-
Notifications
You must be signed in to change notification settings - Fork 2
/
RadialStitcher.h
55 lines (42 loc) · 1.48 KB
/
RadialStitcher.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
//
// Created by eksan on 2019/12/6.
//
#ifndef ST_1_RADIALSTITCHER_H
#define ST_1_RADIALSTITCHER_H
#include <vector>
#include <opencv2/opencv.hpp>
////////////////////////////////////////////////////////////////////////////////
typedef struct
{
cv::Point2f left_top;
cv::Point2f left_bottom;
cv::Point2f right_top;
cv::Point2f right_bottom;
}four_corners_t;
// Radial Stitcher Class reads in images and stitches them along horizontal
// axis.
// -----------------------------------------------------------------------------
class RadialStitcher {
public:
RadialStitcher(int numImages);
~RadialStitcher();
// Main stitching process
cv::Mat Stitch(std::vector<cv::Mat> imgs);
std::vector<cv::Mat> cylinder_projection_map(double width, double height, double focal);
private:
// Stitcher Parameters
int numImages;
double focalLength;
four_corners_t corners;
// Images and Masks
std::vector<cv::Mat> src_list; // Stores input images
// Feature point information, rewritten over course of stitching
std::vector<cv::KeyPoint> keypoints1; // curr image keypoints
std::vector<cv::KeyPoint> keypoints2; // neighbor image keypoints
std::vector<cv::DMatch> matches; // feature pairs
// Auxiliary functions
cv::Mat merge_image(cv::Mat img1, cv::Mat img2, cv::Point shift);
int optimizeSeam(cv::Mat &img1, cv::Mat &img2, cv::Mat& dst);
int calcCorners(cv::Mat& H, cv::Mat& src);
};
#endif //ST_1_RADIALSTITCHER_H