evlib.representation.histogram

Histogram representation.

Classes

Histogram(image_shape[, use_polarity])

Create a 2D histogram from event camera data.

class evlib.representation.histogram.Histogram(image_shape, use_polarity=True)

Create a 2D histogram from event camera data.

Parameters:
  • image_shape (Tuple[int, int]) – (height, width)

  • use_polarity (bool) – if True, counts every positive events as +1 and every negative events as -1, if False, counts every events as +1

__call__(events)

Create histogram.

Parameters:

events (ndarray) – a NumPy array of size [n x d], where n is the number of events and d = 4. Every event is encoded with 4 values (y, x, t, p).

Returns:

A 2D histogram where each pixel holds the number of events in it.

Return type:

ndarray