Post · 10 min read· pp. 55–62

Measurement Update Derivations » Camera Measurement Update

Perspective Projection (Bearing) Measurement Model

Consider a 3D feature is detected from the camera image at time diagram, whose diagram measurement (i.e., the corresponding pixel coordinates) on the image plane is given by:

diagram

where diagram is the measurement noise and typically assumed to be zero-mean white Gaussian; diagram is the normalized undistorted uv measurement; diagram is the camera intrinsic parameters such as focal length and distortion parameters; diagram is the feature position in the current camera frame diagram; diagram is the feature position in the global frame diagram; diagram denotes the current camera pose (position and orientation) in the global frame (or camera extrinsics); and diagram is the feature's parameters of different representations (other than position) such as simply a xyz position or an inverse depth with bearing.

In the above expression, we decompose the measurement function into multiple concatenated functions corresponding to different operations, which map the states into the raw uv measurement on the image plane. It should be noted that as we will perform intrinsic calibration along with extrinsic with different feature representations, the above camera measurement model is general. The high-level description of each function is given in the next section.

Measurement Function Overview

FunctionDescription
diagramThe distortion function that takes normalized coordinates and maps it into distorted uv coordinates
diagramThe projection function that takes a 3D point in the image and converts it into the normalized uv coordinates
diagramTransforming a feature's position in the global frame into the current camera frame
diagramConverting from a feature representation to a 3D feature in the global frame

Jacobian Computation

Given the above nested functions, we can leverage the chainrule to find the total state Jacobian. Since our feature representation function diagram might also depend on the state, i.e. an anchoring pose, we need to carefully consider its additional derivatives. Consider the following example of our measurement in respect to a state diagram Jacobian:

diagram

In the global feature representations, see Point Feature Representations section, the second term will be zero while for the anchored representations it will need to be computed.

Distortion Function

Radial model

To calibrate camera intrinsics, we need to know how to map our normalized coordinates into the raw pixel coordinates on the image plane. We first employ the radial distortion as in OpenCV model:

diagram

where diagram are the normalized coordinates of the 3D feature and u and v are the distorted image coordinates on the image plane. The following distortion and camera intrinsic (focal length and image center) parameters are involved in the above distortion model, which can be estimated online:

diagram

Note that we do not estimate the higher order (i.e., higher than fourth order) terms as in most offline calibration methods such as Kalibr. To estimate these intrinsic parameters (including the distortation parameters), the following Jacobian for these parameters is needed:

diagram

Similarly, the Jacobian with respect to the normalized coordinates can be obtained as follows:

diagram

Fisheye model

As fisheye or wide-angle lenses are widely used in practice, we here provide mathematical derivations of such distortion model as in OpenCV fisheye.

diagram

where diagram are the normalized coordinates of the 3D feature and u and v are the distorted image coordinates on the image plane. Clearly, the following distortion intrinsic parameters are used in the above model:

diagram

In analogy to the previous radial distortion case, the following Jacobian for these parameters is needed for intrinsic calibration:

diagram

Similarly, with the chain rule of differentiation, we can compute the following Jacobian with respect to the normalized coordinates:

diagram

Perspective Projection Function

The standard pinhole camera model is used to project a 3D point in the camera frame into the normalized image plane (with unit depth):

diagram

whose Jacobian matrix is computed as follows:

diagram

Euclidean Transformation

We employ the 6DOF rigid-body Euclidean transformation to transform the 3D feature position in the global frame diagram to the current camera frame diagram based on the current global camera pose:

diagram

Note that in visual-inertial navigation systems, we often keep the IMU, instead of camera, state in the state vector. So, we need to further transform the above geometry using the time-invariant IMU-camera extrinsic parameters diagram as follows:

diagram

Substituting these quantities into the equation of diagram yields:

diagram

We now can compute the following Jacobian with respect to the pertinent states:

diagram

where diagram denotes the skew symmetric matrix of a vector diagram (see Quaternion TR [40]). Note also that in above expression (as well as in ensuing derivations), there is a little abuse of notation; that is, the Jacobian with respect to the rotation matrix is not the direct differentiation with respect to the 3x3 rotation matrix, instead with respect to the corresponding 3x1 rotation angle vector. Moreover, if performing online extrinsic calibration, the Jacobian with respect to the IMU-camera extrinsics is needed:

diagram

Point Feature Representations

There are two main parameterizations of a 3D point feature: 3D position (xyz) and inverse depth with bearing. Both of these can either be represented in the global frame or in an anchor frame of reference which adds a dependency on having an "anchor" pose where the feature is observed. To allow for a unified treatment of different feature parameterizations diagram in our codebase, we derive in detail the generic function diagram that maps different representations into global position.

Global XYZ

As the canonical parameterization, the global position of a 3D point feature is simply given by its xyz coordinates in the global frame of reference:

diagram

It is clear that the Jacobian with respect to the feature parameters is:

diagram

Global Inverse Depth

The global inverse-depth representation of a 3D point feature is given by (akin to spherical coordinates):

diagram

The Jacobian with respect to the feature parameters can be computed as:

diagram

Global Inverse Depth (MSCKF VERSION)

Note that as this representation has a singularity when the z-distance goes to zero, it is not recommended to use in practice. Instead, one should use the Anchored Inverse Depth (MSCKF Version) representation. The anchored version doesn't have this issue if features are represented in a camera frame that they where seen from (in which features should never have a non-positive z-direction).

Anchored XYZ

We can represent a 3D point feature in some "anchor" frame (say some IMU local frame, diagram), which would normally be the IMU pose corresponding to the first camera frame where the feature was detected.

diagram

The Jacobian with respect to the feature state is given by:

diagram

As the anchor pose is involved in this representation, its Jacobians are computed as:

diagram

Moreover, if performing extrinsic calibration, the following Jacobians with respect to the IMU-camera extrinsics are also needed:

diagram

Anchored Inverse Depth

In analogy to the global inverse depth case, we can employ the inverse-depth with bearing (akin to spherical coordinates) in the anchor frame, diagram, to represent a 3D point feature:

diagram

The Jacobian with respect to the feature state is given by:

diagram

The Jacobians with respect to the anchor pose are:

diagram

The Jacobians with respect to the IMU-camera extrinsics are:

diagram

Anchored Inverse Depth (MSCKF Version)

Note that a simpler version of inverse depth was used in the original MSCKF paper [32]. This representation does not have the singularity if it is represented in a camera frame the feature was measured from.

diagram

The Jacobian with respect to the feature state is:

diagram

The Jacobians with respect to the anchor state are:

diagram

The Jacobians with respect to the IMU-camera extrinsics are:

diagram

Anchored Inverse Depth (MSCKF Single Depth Version)

This feature representation is based on the MSCKF representation [32], and the the single depth from VINS-Mono [35]. As compared to the implementation in [35], we are careful about how we handle treating of the bearing of the feature. During initialization we initialize a full 3D feature and then follow that by marginalize the bearing portion of it leaving the depth in the state vector. The marginalized bearing is then fixed for all future linearizations.

Then during update, we perform nullspace projection at every timestep to remove the feature dependence on this bearing. To do so, we need at least two sets of UV measurements to perform this bearing nullspace operation since we loose two dimensions of the feature in the process. We can define the feature measurement function as follows:

diagram

In the above case we have defined a bearing diagram which is the marginalized bearing of the feature after initialization. After collecting two measurement, we can nullspace project to remove the Jacobian in respect to this bearing variable.