Integrate IMU measurements and estimate trajectory using forward Euler integration [1].
Parameters:
acc_pos (Iterable[npt.ArrayLike]) – Positional acceleration as measured by the IMU. Expects an iterable
of [ax, ay, az] vectors in m/s^2 (in camera-coordinates).
vel_ang (Iterable[npt.ArrayLike]) – Rotational velocity as measured by the gyro. Expects an iterable
of [wx, wy, wz] vectors in Rad/s (in camera-coordinates).
dt (float) – Sampling period in seconds. Typically equal to 1/fps.
gravity (npt.NDArray, optional) – Gravity vector in m/s^2 (in world-coordinates). Defaults to -9.8 m/s^2 in Z.
pose_init (npt.NDArray, optional) – Initial pose. Defaults to identity.
vel_init (npt.NDArray, optional) – Initial positional velocity. Defaults to the zero vector.
While the integration is performed in world coordinates, this helper
operates on velocities and accelerations in camera coordinates and perform
the coordinate change internally. Poses remain in world coordinates.
Note
Angular acceleration handling is not implemented!
Parameters:
pose (npt.NDArray) – Current camera pose in world coordinates.
vel_pos_c (npt.NDArray) – Translational velocity in camera coordinates.
vel_ang_c (npt.NDArray) – Angular velocity in camera coordinates.
acc_pos_c (npt.NDArray) – Translational acceleration in camera coordinates.
dt (float) – Sampling period in seconds.
Returns:
Camera pose at next time step (in world-coords),
Translational velocity at next time step (in camera coords)
Emulates a conventional RGB camera from a sequence of intensity frames.
Note
Motion-blur is approximated by averaging consecutive ground truth frames,
this can be done more efficiently if optical flow is available.
See emulate_rgb_from_flow for more.
Parameters:
sequence (npt.ArrayLike) – Input sequence of linear-intensity frames, can be a collection of frames,
or np/torch array with time as the first dimension.
readout_std (float, optional) – Standard deviation of zero mean Gaussian read noise. Defaults to 20.0.
fwc (float, optional) – Full well capacity, used for normalization. Defaults to 500.0.
bitdepth (int, optional) – Resolution of ADC in bits. Defaults to 12.
factor (float, optional) – Scaling factor to control intensity of output RGB image. Defaults to 1.0.
rng (np.random.Generator, optional) – Optional random number generator. Defaults to none.
Convert average of many single photon binary frames to conventional RGB image.
Invert the process by which binary frames are emulated. The result can be either
linear RGB values or sRGB values depending on how the binary frames were constructed.
Assuming each binary patch was created by a Bernoulli process with p=1-exp(-factor*rgb),
then the average of binary frames tends to p. We can therefore recover the original rgb
values as -log(1-bin)/factor where bin is the average of many binary frames.
Parameters:
mean_binary_patch (torch.Tensor | npt.NDArray) – Binary avg to convert to rgb, expects a np.ndarray or torch tensor.
epsilon (float, optional) – Smallest allowed value before taking logarithm, needed for stability. Defaults to 1e-6.
quantile (float, optional) – If supplied, normalize by this quantile. For instance, if set to 0.9 then the
ninety-percent brightest value will be used as the new maximum, with brighter values being clipped.
Defaults to None (no normalization/clipping).