tonic.functional.to_bina_rep#

Module Contents#

Functions#

to_bina_rep_numpy(event_frames[, n_frames, n_bits])

Representation that takes T*B binary event frames to produce a sequence of T frames of N-bit

bina_rep(→ numpy.ndarray)

Computes one Bina-Rep frame from the sequence of N binary event-frames in parameter.

tonic.functional.to_bina_rep.to_bina_rep_numpy(event_frames: numpy.ndarray, n_frames: int = 1, n_bits: int = 8)[source]#

Representation that takes T*B binary event frames to produce a sequence of T frames of N-bit numbers. To do so, N binary frames are interpreted as a single frame of N-bit representation. Taken from the paper Barchid et al. 2022, Bina-Rep Event Frames: a Simple and Effective Representation for Event-based cameras https://arxiv.org/pdf/2202.13662.pdf.

Parameters:
  • event_frames (numpy.ndarray) – numpy.ndarray of shape (T*BxPxHxW). The sequence of event frames.

  • n_frames (int) – the number T of bina-rep frames.

  • n_bits (int) – the number N of bits used in the N-bit representation.

Returns:

(numpy.ndarray) the sequence of bina-rep event frames with dimensions (TxPxHxW).

tonic.functional.to_bina_rep.bina_rep(frames: numpy.ndarray) numpy.ndarray[source]#

Computes one Bina-Rep frame from the sequence of N binary event-frames in parameter.

Parameters:

frames (numpy.ndarray) – the sequence of N binary event frames used to compute the bina-rep frame. Shape=(NxPxHxW)

Returns:

the resulting bina-rep event frame. Shape=(PxHxW)

Return type:

numpy.ndarray