-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcylstitcher.hh
executable file
·46 lines (37 loc) · 1.27 KB
/
cylstitcher.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
//File: cylstitcher.hh
//Author: Yuxin Wu <[email protected]>
//在柱形变换投影过程中,加入straightening修正
//通过搜索畸变方程中的yc来降低弯曲效应。
//使用了视角变换的方式去对准左边和右边的边界。(修正垂直面上误差)
#pragma once
#include "stitcherbase.hh"
#include "stitcher_image.hh"
#include "common/common.hh"
namespace pano {
// forward declaration
class Homography;
class MatchData;
struct MatchInfo;
// a stitcher which warps images to cyilnder before stitching
class CylinderStitcher : public StitcherBase {
protected:
ConnectedImages bundle;
// build panorama with cylindrical pre-warping
void build_warp();
// in cylindrical mode, search warping parameter for straightening
float update_h_factor(float, float&, float&,
std::vector<Homography>&,
const std::vector<MatchData>&);
// in cylindrical mode, perspective correction on the final image
Mat32f perspective_correction(const Mat32f&);
public:
template<typename U, typename X =
disable_if_same_or_derived<CylinderStitcher, U>>
CylinderStitcher(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();
};
}