-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcamera_projection_measurement.h
39 lines (31 loc) · 1.39 KB
/
camera_projection_measurement.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
#pragma once
#include "sophus/se3.hpp"
// Forward declaration.
struct LinearizedCameraProjectionMeasurement;
/// \brief Represents a camera projection of a world point, given in normalized image coordinates.
class CameraProjectionMeasurement
{
public:
/// \brief Constructs the measurement.
/// \param normalized_plane_point Measured image point as normalized image coordinate.
/// \param world_point Corresponding world point in world coordinate system.
CameraProjectionMeasurement(const Eigen::Vector2d& normalized_plane_point, const Eigen::Vector3d& world_point);
/// \brief Linearize the measurement prediction function at the current state.
/// \param current_state Current estimate of the camera pose T_w_c.
LinearizedCameraProjectionMeasurement linearize(const Sophus::SE3d& current_state) const;
enum {
measure_dim = 2, /// Dimension of image measurements (normalized image coordinate)
state_dim = 6 /// Dimension of state (pose)
};
private:
Eigen::Vector3d world_point_;
Eigen::Vector2d normalized_plane_point_;
};
/// \brief Struct for linearization of measurement prediction function.
struct LinearizedCameraProjectionMeasurement
{
/// Measurement Jacobian
Eigen::Matrix<double, CameraProjectionMeasurement::measure_dim, CameraProjectionMeasurement::state_dim> A;
/// Measurement error
Eigen::Matrix<double, CameraProjectionMeasurement::measure_dim, 1> b;
};