:py:mod:`tonic.functional.to_bina_rep`
======================================

.. py:module:: tonic.functional.to_bina_rep


Module Contents
---------------


Functions
~~~~~~~~~

.. autoapisummary::

   tonic.functional.to_bina_rep.to_bina_rep_numpy
   tonic.functional.to_bina_rep.bina_rep



.. py:function:: to_bina_rep_numpy(event_frames: numpy.ndarray, n_frames: int = 1, n_bits: int = 8)

   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.

   :param event_frames: numpy.ndarray of shape (T*BxPxHxW). The sequence of event frames.
   :param n_frames: the number T of bina-rep frames.
   :type n_frames: int
   :param n_bits: the number N of bits used in the N-bit representation.
   :type n_bits: int

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


.. py:function:: bina_rep(frames: numpy.ndarray) -> numpy.ndarray

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

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

   :returns: the resulting bina-rep event frame. Shape=(PxHxW)
   :rtype: numpy.ndarray


