-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathhest.h
83 lines (65 loc) · 2.56 KB
/
hest.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
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
#ifndef HEST_H
#define HEST_H
#include <Eigen/Dense>
namespace hest {
struct LineSegment {
LineSegment() {}
LineSegment(const Eigen::Vector2d &p1, const Eigen::Vector2d &p2) : p1(p1), p2(p2) { }
Eigen::Vector2d p1;
Eigen::Vector2d p2;
};
// Estimates a homography such that
// points1 = H * points2
Eigen::Matrix3d estimateHomographyPoints(
const std::vector<Eigen::Vector2d> &points1,
const std::vector<Eigen::Vector2d> &points2,
bool pure_rotation);
// Note that this homography still maps second image to first!
Eigen::Matrix3d estimateHomographyLines(
const std::vector<Eigen::Vector3d> &lines1,
const std::vector<Eigen::Vector3d> &lines2);
// Note that this homography still maps second image to first!
Eigen::Matrix3d estimateHomographyLineSegments(
const std::vector<LineSegment> &line_segments1,
const std::vector<LineSegment> &line_segments2,
bool pure_rotation);
void refineHomography(
const std::vector<LineSegment> &line_segments1,
const std::vector<LineSegment> &line_segments2,
Eigen::Matrix3d &homography,
bool pure_rotation);
void refineHomography(
const std::vector<Eigen::Vector2d> &pts1,
const std::vector<Eigen::Vector2d> &pts2,
Eigen::Matrix3d &homography,
bool pure_rotation);
void refineHomography(
const std::vector<Eigen::Vector2d> &pts1,
const std::vector<Eigen::Vector2d> &pts2,
const std::vector<LineSegment> &line_segments1,
const std::vector<LineSegment> &line_segments2,
Eigen::Matrix3d &homography,
bool pure_rotation);
Eigen::Matrix3d ransacLineHomography(
const std::vector<LineSegment> &line_segments1,
const std::vector<LineSegment> &line_segments2,
double tol_px,
bool pure_rotation,
std::vector<int> *inlier_ind);
Eigen::Matrix3d ransacPointHomography(
const std::vector<Eigen::Vector2d> &pts1,
const std::vector<Eigen::Vector2d> &pts2,
double tol_px,
bool pure_rotation,
std::vector<int> *inlier_ind);
Eigen::Matrix3d ransacPointLineHomography(
const std::vector<Eigen::Vector2d> &pts1,
const std::vector<Eigen::Vector2d> &pts2,
const std::vector<LineSegment> &line_segments1,
const std::vector<LineSegment> &line_segments2,
double tol_px,
bool pure_rotation,
std::vector<int> *inlier_pts_ind,
std::vector<int> *inlier_lin_ind);
}
#endif