Class SuperCell

Inheritance Relationships

Base Type

Class Documentation

class cpphots::SuperCell : public cpphots::interfaces::Clonable<SuperCell, interfaces::SuperCell>

Subsample layer into super cells, without averaging.

If added to a layer, the output coordinates of the events will be mapped using cells of a fixed size, thus reducing the output dimensionality. Cells may be overlapping, causing the layer to emit more than one event.

Public Functions

inline SuperCell()

Construct a new SuperCell modifier.

This constructor should not be used explicitly, it is provided only to load this modifier from a stream.

SuperCell(uint16_t width, uint16_t height, uint16_t K)

Construct a new SuperCell modifier.

Parameters
  • width – width of the context

  • height – height of the context

  • K – size of the cells

virtual std::pair<uint16_t, uint16_t> findCell(uint16_t ex, uint16_t ey) const override

Find the coordinates of the cell that contains certain coordinates.

Parameters
  • ex – x coordinate of the event

  • ey – y coordinate of the event

Returns

cell coordinates

virtual std::pair<uint16_t, uint16_t> getSize() const override

Returns the size of the context.

Returns

{width, height}

virtual std::pair<uint16_t, uint16_t> getCellSizes() const override

Get the number of the horizontal and vertical cells.

Returns

{horizontal cells, vertical cells}

virtual TimeSurfaceType averageTS(const TimeSurfaceType &ts, uint16_t cx, uint16_t cy) override

Average time surfaces over a cell.

This function actually returns the time surface unmodified.

Parameters
  • ts – new time surface computed

  • cx – x coordinate of the cell

  • cy – y coordinate of the cell

Returns

averaged time surface

virtual void toStream(std::ostream &out) const override

Insert to stream.

Parameters

out – stream where to insert to

virtual void fromStream(std::istream &in) override

Extract from stream.

Parameters/current state is expected to be overwritten or invalidated.

Parameters

in – stream where to extract from

Protected Functions

std::pair<uint16_t, uint16_t> getCellCenter(uint16_t cx, uint16_t cy) const

Get the center of a cell in event-space.

Parameters
  • cx – cell x

  • cy – cell y

Returns

event-space coordinates of the center

bool isInCell(uint16_t cx, uint16_t cy, uint16_t ex, uint16_t ey) const

Check whether some events coordinates are in a certain cell or not.

Parameters
  • cx – cell x

  • cy – cell y

  • ex – event x

  • ey – event y

Returns

true if event is in cell

Returns

false otherwise

Protected Attributes

uint16_t width

Width of the context.

uint16_t height

Height of the context.

uint16_t K

Size of the cells.

uint16_t wcell

Number of cells (horizontal)

uint16_t hcell

Number of cells (vertical)

uint16_t wmax

Max horizontal processing size.

uint16_t hmax

Max vertical processing size.