Dewobble
Video motion stabilization with awareness of lens projection
camera.hpp
1 #ifndef DEWOBBLE_CAMERA_HPP
2 #define DEWOBBLE_CAMERA_HPP
3 
4 #include <opencv2/core.hpp>
5 #include <vector>
6 
7 namespace dewobble
8 {
9 
16 enum Projection {
17  PROJECTION_RECTILINEAR,
18  PROJECTION_EQUIDISTANT_FISHEYE,
19 };
20 
27 class Camera
28 {
29  public:
33  const Projection m_projection;
37  const double m_focal_length;
41  const int m_width;
45  const int m_height;
49  const double m_focal_point_x;
53  const double m_focal_point_y;
54  Camera(
55  Projection projection,
56  double diagonal_field_of_view,
57  int width,
58  int height,
59  double focal_point_x,
60  double focal_point_y);
61 
67  cv::Size size() const;
73  cv::Matx33d matrix() const;
79  cv::Mat distortion_coefficients() const;
92  std::vector<cv::Point2f> undistortPoints(
93  std::vector<cv::Point2f> points,
94  cv::InputArray rotation = cv::noArray(),
95  cv::InputArray output_matrix = cv::noArray()) const;
106  std::vector<cv::Point2f> distortPoints(
107  std::vector<cv::Point2f> points,
108  cv::InputArray input_matrix = cv::noArray()) const;
109 };
110 
111 } // namespace dewobble
112 
113 #endif // DEWOBBLE_CAMERA_HPP
Definition: camera.hpp:28
const double m_focal_point_y
Definition: camera.hpp:53
std::vector< cv::Point2f > distortPoints(std::vector< cv::Point2f > points, cv::InputArray input_matrix=cv::noArray()) const
std::vector< cv::Point2f > undistortPoints(std::vector< cv::Point2f > points, cv::InputArray rotation=cv::noArray(), cv::InputArray output_matrix=cv::noArray()) const
const int m_height
Definition: camera.hpp:45
const Projection m_projection
Definition: camera.hpp:33
const int m_width
Definition: camera.hpp:41
cv::Size size() const
const double m_focal_point_x
Definition: camera.hpp:49
cv::Mat distortion_coefficients() const
const double m_focal_length
Definition: camera.hpp:37
cv::Matx33d matrix() const