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)
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.
shutter_frac (float, optional) – fraction of inter-frame duration the shutter is active. Range [0, 1]
readout_std (float, optional) – Standard deviation of zero mean Gaussian read noise. Defaults to 0.0.
fwc (float, optional) – Full well capacity, used for normalization. Defaults to 10000.0.
adc_bitdepth (int, optional) – Resolution of ADC in bits. Defaults to 12.
flux_gain (float, optional) – factor to scale the input [0, 1] image _before_ Poisson sampling
iso_gain (float, optional) – factor to scale the photo-electron reading _after_ Poisson sampling
mosaic (bool, optional) – implement one array with mosaiced R-/G-/B-sensitive pixels or an innately 3-channel sensor
demosaic (string, optional) – demosaicing method to use if “mosaic” is set (default “off”)
Perform bernoulli sampling on linearized RGB frames to yield binary frames.
Parameters:
img (npt.NDArray[np.floating]) – Linear intensity image to sample binary frame from.
flux_gain (float, optional) – scale factor to convert img in [0, 1] range to other flux levels. Defaults to 1.0.
bitplanes (int, optional) – when bitplanes > 1, this represents a binomial SPAD sensor that sums binary samples internally
for each measurement, operating at framerate 1/bitplanes of a binary SPAD sensor. Defaults to 1.
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).