forked from mlukichev/RobotVision
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransformations.h
More file actions
61 lines (34 loc) · 1.36 KB
/
transformations.h
File metadata and controls
61 lines (34 loc) · 1.36 KB
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
#ifndef TRANSFORMATIONS_H
#define TRANSFORMATIONS_H
#include <opencv2/opencv.hpp>
#include <vector>
namespace robot_vision {
class Transformation {
public:
Transformation(const cv::Mat& mat): mat_{mat} {}
Transformation(cv::Mat&& mat): mat_{std::move(mat)} {}
Transformation(const cv::Mat&, const cv::Mat&);
Transformation(const cv::Mat&, const cv::Vec3d&);
Transformation(): mat_{cv::Mat::eye(4, 4, CV_64F)} {}
Transformation(const Transformation& o) = default;
Transformation(Transformation&& o) = default;
cv::Mat Self();
std::vector<double> ToVector() const;
cv::Vec3d ToVec3d();
cv::Mat ToRot();
cv::Mat ToVec();
Transformation Inverse();
Transformation operator*(const Transformation& other) const;
Transformation operator/(const Transformation& other) const;
Transformation operator*(double other) const;
Transformation operator/(double other) const;
Transformation operator+(const Transformation& other) const;
Transformation operator-(const Transformation& other) const;
Transformation& operator=(const Transformation& other) = default;
private:
cv::Mat mat_;
};
Transformation TransformationAverage(const std::vector<Transformation>& mats);
double TransformationDifference(const Transformation& a, const Transformation& b, double rotation_weight, double translation_weight);
} // namespace robot_vision
#endif