-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstitcher.hh
executable file
·64 lines (51 loc) · 1.51 KB
/
stitcher.hh
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
// File: stitcher.hh
// Date: Sat May 04 22:36:30 2013 +0800
// Author: Yuxin Wu <[email protected]>
#pragma once
#include <memory>
#include <vector>
#include "lib/mat.h"
#include "lib/utils.hh"
#include "stitcher_image.hh"
#include "stitcherbase.hh"
#include "common/common.hh"
namespace pano {
// forward declaration
class Homography;
class MatchData;
struct MatchInfo;
class PairWiseMatcher;
class Stitcher : public StitcherBase {
private:
// transformation and metadata of each image
ConnectedImages bundle;
// 2d array of all matches
// pairwise_matches[i][j].homo transform j to i, with coor in [-w/2,w/2]
std::vector<std::vector<MatchInfo>> pairwise_matches;
// match two images
bool match_image(const PairWiseMatcher&, int i, int j);
// pairwise matching of all images
void pairwise_match();
// equivalent to pairwise_match when dealing with linear images
void linear_pairwise_match();
// assign a center to be identity
void assign_center();
// build by estimating camera parameters
void estimate_camera();
// naively build panorama assuming linear imgs
void build_linear_simple();
// for debug
void draw_matchinfo();
void dump_matchinfo(const char*) const;
void load_matchinfo(const char*);
public:
template<typename U, typename X =
disable_if_same_or_derived<Stitcher, U>>
Stitcher(U&& i) : StitcherBase(std::forward<U>(i)) {
bundle.component.resize(imgs.size());
REP(i, imgs.size())
bundle.component[i].imgptr = &imgs[i];
}
virtual Mat32f build();
};
}