SDK Analytics Configs

struct Metavision::CountingAlgorithmConfig

Structure to instantiate a counting configuration.

Public Functions

CountingAlgorithmConfig(int min_cluster_size, CountingMode mode = CountingMode::Mono, Metavision::timestamp accumulation_time_us = -1)

Constructor.

Parameters
  • min_cluster_size: Minimum cluster size

  • mode: Type of recording (mono or stereo)

  • accumulation_time_us: Accumulation time of the event buffer before processing (in us) If not set, the algorithm will work in synchronous mode and directly process each received event-buffer.

struct Metavision::CalibrationConfig

Base structure representing all the parameters needed for calibration.

Public Functions

CalibrationConfig(CountingViewSetup view_setup, float object_min_size = 5, float object_average_speed = 5, float distance_object_camera = 300)

Constructor.

See

The enum CountingViewSetup

Parameters
  • view_setup: Type of the counting setup

Parameters
  • object_min_size: Approximate largest dimension of the smallest object (in mm). The value must be positive. It will be refined during the calibration.

  • object_average_speed: Approximate average speed of an object to count (in m/s). It will be refined during the calibration.

  • distance_object_camera: Average distance between the flow of objects to count and the camera (in mm) Camera must look perpendicular to the object falling plan. It will be refined during the calibration.

Public Members

CountingViewSetup view_setup_

Type of the counting setup.

See

The enum CountingViewSetup

struct Metavision::CalibrationResults

Base structure representing all the parameters obtained after the calibration.

Public Functions

CalibrationResults(const std::string &calibration_file)

Base Constructor used when we need to load a calibration file.

Parameters
  • calibration_file: Calibration file to load

CalibrationResults(int width, int height, const std::string &calibration_file)

Constructor used when the sensor’s geometry is known, and we need to write the calibration file.

Parameters
  • width: Sensor’s width (in pixels)

  • height: Sensor’s height (in pixels)

  • calibration_file: Calibration file to write

void load()

Loads the calibration file.

void dump()

Writes the calibration file.

struct Metavision::SpatterTrackerAlgorithmConfig

Configuration to instantiate a SpatterTrackerAlgorithmConfig.

Public Functions

SpatterTrackerAlgorithmConfig(int cell_width, int cell_height, timestamp accumulation_time, int untracked_threshold = 5, int activation_threshold = 10, bool apply_filter = true, int max_distance = 50, const int min_size = 1, const int max_size = std::numeric_limits<int>::max())

Constructor.

Parameters
  • cell_width: Width of cells used for clustering

  • cell_height: Height of cells used for clustering

  • accumulation_time: Time to accumulate events and process

  • untracked_threshold: Maximum number of times a spatter_cluster can stay untracked before being removed

  • activation_threshold: Threshold distinguishing an active cell from inactive cells (i.e. minimum number of events in a cell to consider it as active)

  • apply_filter: If true, than applying a simple filter to remove crazy pixels

  • max_distance: Max distance for clusters association (in pixels)

  • min_size: Minimum object size (in pixels) - minimum of the object’s width and height should be larger than this value

  • max_size: Maximum object size (in pixels) - maximum of the object’s width and height should be smaller than this value

struct Metavision::TrackingConfig

Structure used to configure the TrackingAlgorithm.

Public Types

enum ClusterMaker

Defines the type of cluster maker used by the TrackingAlgorithm.

Values:

enumerator SIMPLE_GRID
enumerator MEDOID_SHIFT
enum DataAssociation

Defines type of data association used by the TrackingAlgorithm.

Values:

enumerator NEAREST
enumerator IOU
enum Initializer

Defines the type of initializer used by the TrackingAlgorithm. Only one method implemented for now.

Values:

enumerator SIMPLE
enum MotionModel

Defines the type of motion model used by the TrackingAlgorithm.

Values:

enumerator SIMPLE
enumerator INSTANT
enumerator SMOOTH
enumerator KALMAN
enum KalmanModel

Defines the Kalman motion model used by the TrackingAlgorithm.

Values:

enumerator CONSTANT_VELOCITY
enumerator CONSTANT_ACCELERATION
enum KalmanPolicy

Defines the Kalman policy model used by the TrackingAlgorithm.

Values:

enumerator ADAPTIVE_NOISE
enumerator MEASUREMENT_TRUST
enum Tracker

Defines the type of tracker used by the TrackingAlgorithm.

Values:

enumerator ELLIPSE
enumerator CLUSTERKF
enum EllipseUpdateFunction

Ellipse tracker related parameters.

Values:

enumerator UNIFORM
enumerator GAUSSIAN
enumerator SIGNED_GAUSSIAN
enumerator TRUNCATED_GAUSSIAN

Public Members

bool print_timings_ = false

If enabled, displays a profiling summary.

ClusterMaker cluster_maker_ = ClusterMaker::SIMPLE_GRID

Type of cluster maker to use.

int cell_width_ = 10

Grid clustering cell’s width (in pixels).

int cell_height_ = 10

Grid clustering cell’s height (in pixels).

timestamp cell_deltat_ = 1000

Grid clustering cell’s time delta (in us).

int activation_threshold_ = 5

Minimum number of events needed to activate the grid.

float medoid_shift_spatial_dist_ = 5

Maximum spatial distance (using Manhattan distance) for two events to be in the same cluster.

timestamp medoid_shift_temporal_dist_ = 10000

Maximum temporal distance for two events to be in the same cluster.

int medoid_shift_min_size_ = 2

Minimum width and height for a cluster to be considered valid and given to the tracking engine.

DataAssociation data_association_ = DataAssociation::IOU

Type of data association to use.

double max_dist_ = 150.

Nearest data association related parameters. Maximum distance between cluster’s centroid and tracker’s position.

double iou_max_dist_ = 150.

IOU data association related parameters. Maximum distance between cluster’s centroid and tracker’s position.

Initializer initializer_ = Initializer::SIMPLE

Simple initializer related parameters.

Type of initializer to use.

MotionModel motion_model_ = MotionModel::SIMPLE

Type of motion model to use.

double smooth_mm_alpha_vel_ = 0.001

Smooth motion model related parameters.

double kalman_motion_model_pos_trans_std_ = 0.0001

Standard deviation of the transition noise for the tracker’s position.

double kalman_motion_model_vel_trans_std_ = 0.05

Standard deviation of the transition noise for the tracker’s velocity.

double kalman_motion_model_acc_trans_std_ = 1e-9

Standard deviation of the transition noise for the tracker’s acceleration.

double kalman_motion_model_pos_obs_std_ = 100

Standard deviation of the observation noise for the tracker’s position.

double kalman_motion_model_init_factor_ = 1e12

Factor to multiply to noise variance at initialization.

double kalman_motion_model_avg_events_per_pixel_ = 1

Expected average events per pixel rate in events/us.

timestamp kalman_motion_model_min_dt_ = 1000

Minimal timestep at which to compute Kalman filter.

KalmanPolicy kalman_motion_model_policy_ = KalmanPolicy::ADAPTIVE_NOISE

Policy used in the Kalman Filter.

KalmanModel kalman_motion_model_motion_model_ = KalmanModel::CONSTANT_VELOCITY

Motion model used in the Kalman filter.

Tracker tracker_ = Tracker::CLUSTERKF

Type of tracker to use.

timestamp delta_ts_for_prediction_ = 5000

Delta ts (in us) for the position prediction.

timestamp ts_to_stop_ = 100000

Time (in us) to wait without having updated a tracker before deleting it.

enum Metavision::CountingMode

Type of recording (mono or stereo)

Values:

enumerator Mono
enumerator Stereo
enum Metavision::CountingViewSetup

Enum to indicate the type of the counting setup. Currently, only mono is supported, but it might be extended to other setups in the future.

Values:

enumerator Mono

Monocular counting setup.