SDK Analytics Configs
-
struct JetMonitoringAlarmConfig
Jet monitoring alarm parameters.
Public Functions
-
inline bool is_valid() const
Basic validation.
Public Members
-
bool alarm_on_count = false
If true, an alarm will be raised if the jet count exceeds the expected_count value.
-
int max_expected_count = 0
Maximum expected number of jets.
-
bool alarm_on_cycle = false
Activate/deactivate alarm on cycle time.
-
float expected_cycle_ms = 0
Expected cycle time.
-
float cycle_tol_percentage = 0
Tolerance for estimated cycle time, in percentage of expected_cycle_ms.
-
inline bool is_valid() const
-
struct JetMonitoringAlgorithmConfig
Jet monitoring algorithm parameters.
Public Types
Public Members
-
Orientation nozzle_orientation = Down
Nozzle orientation.
-
cv::Rect detection_roi
Central ROI used to detect jets by identifying peaks in the event-rate.
-
Orientation nozzle_orientation = Down
-
struct JetMonitoringLoggerConfig
Jet monitoring logger parameters.
Public Members
-
bool enable_logging = false
If true, the logging is enabled, otherwise no logging.
-
int log_history_length_ms = 0
Log buffer length in ms. Each log dump will have this duration.
-
int log_dump_delay_ms = 0
Log delay after the trigger in ms. How much we see after the trigger.
-
std::string log_out_dir = ""
Base output directory. Each log dump will be a subdirectory in it.
-
bool dump_at_exit = false
Automatically dump when exiting the application.
-
bool log_jet_video = false
Combine the images of each jet to create a video of an average jet.
-
bool log_jets_evt_rate = false
Dump a file containing the event rate for each jet.
-
bool enable_logging = false
-
struct LineClusterTrackingConfig
Struct representing the parameters used to instantiate a LineClusterTracker inside PsmAlgorithm.
Public Functions
-
LineClusterTrackingConfig() = default
Default constructor.
-
inline LineClusterTrackingConfig(unsigned int bitsets_buffer_size, unsigned int cluster_ths = 3, unsigned int num_clusters_ths = 4, unsigned int min_inter_clusters_distance = 1, float learning_rate = 1.f, float max_dx_allowed = 5.f, unsigned int max_nbr_empty_rows = 0)
Constructor.
- Parameters
bitsets_buffer_size – Size of the bitset circular buffer (accumulation_time = bitsets_buffer_size *precision_time_us )
cluster_ths – Minimum width (in pixels) below which clusters of events are considered as noise
num_clusters_ths – Minimum number of cluster measurements below which a particle is considered as noise
min_inter_clusters_distance – Once small clusters have been removed, merge clusters that are closer than this distance. This helps dealing with dead pixels that could cut particles in half. If set to 0, do nothing
learning_rate – Ratio in the weighted mean between the current x position and the observation. This is used only when the particle is shrinking, because the front of the particle is always sharp while the trail might be noisy. 0.0 is conservative and does not take the observation into account, whereas 1.0 has no memory and overwrites the cluster estimate with the new observation. A value outside ]0,1] disables the weighted mean, and 1.0 is used instead.
max_dx_allowed – Caps x variation at this value. A negative value disables the clamping. This is used only when the particle is shrinking, because the front of the particle is always sharp while the trail might be noisy.
max_nbr_empty_rows – Number of consecutive empty measurements that is tolerated
-
LineClusterTrackingConfig() = default
-
struct LineParticleTrackingConfig
Struct representing the parameters used to instantiate a LineParticleTracker inside PsmAlgorithm.
Public Functions
-
inline LineParticleTrackingConfig(bool is_going_down, unsigned int dt_first_match_ths, double tan_angle_ths = 1., double matching_ths = 0.5)
Constructor.
- Parameters
is_going_down – True if the particle is falling, false if it’s going upwards
dt_first_match_ths – Maximum allowed duration to match the 2nd particle of a track
tan_angle_ths – Tangent of the angle with the vertical beyond which two particles on consecutive lines can’t be matched
matching_ths – Minimum similarity score in [0,1] needed to match two particles
-
inline LineParticleTrackingConfig(bool is_going_down, unsigned int dt_first_match_ths, double tan_angle_ths = 1., double matching_ths = 0.5)
-
struct SpatterTrackerAlgorithmConfig
Configuration to instantiate a SpatterTrackerAlgorithmConfig.
Public Functions
-
inline SpatterTrackerAlgorithmConfig(int cell_width, int cell_height, 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(), timestamp min_time_tracked = 0, timestamp static_objects_memory = 0, int max_size_variation = 100, int max_dist_static_obj = 0, EvtFilterType filtered_polarity = EvtFilterType::FILTER_NEG)
Constructor.
- Parameters
cell_width – Width of cells used for clustering
cell_height – Height of cells used for clustering
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, then a simple filter to remove crazy pixels will be applied
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
min_time_tracked – Minimum delay to track a custer. Before this delay, it is tracked internally only.
static_objects_memory – Time after which the static constraint of detected clusters is relaxed
max_size_variation – Maximum size variation allowed for two cluster to be associated
max_dist_static_obj – Maximum displacement allowed for a static cluster (else, it is considered a moving cluster)
filtered_polarity – Polarity of events to filter out
Public Members
-
int cell_width_
Width of the cells used for clustering.
-
int cell_height_
Height of the cells used for clustering.
-
int untracked_threshold_
Maximum number of times a spatter cluster can stay untracked before being forgotten.
-
int activation_threshold_
Minimum number of events in a cell to consider it active during clustering.
-
bool apply_filter_
If true then will consider only one event per pixel.
-
int max_distance_
Maximum distance (in pixel) allowed for clusters association.
-
int min_size_
Minimum object size (in pixel)
-
int max_size_
Maximum object size (in pixel)
-
timestamp min_time_tracked_us_
Minimum duration a new cluster should be tracked before being output (in us)
-
int max_dist_static_obj_
Maximum displacement allowed to consider a cluster static (in pixel)
-
int max_size_variation_
Maximum size variation allowed for two clusters to be matched (in pixel)
-
timestamp static_memory_
Time after which the static constraint of the detected clusters is relaxed (in us)
-
EvtFilterType filter_type_
Polarity of events to filter out.
-
inline SpatterTrackerAlgorithmConfig(int cell_width, int cell_height, 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(), timestamp min_time_tracked = 0, timestamp static_objects_memory = 0, int max_size_variation = 100, int max_dist_static_obj = 0, EvtFilterType filtered_polarity = EvtFilterType::FILTER_NEG)
-
struct TrackingConfig
Structure used to configure the TrackingAlgorithm.
There are 4 main parts:
Clustering using one of the methods indexed by TrackingConfig::ClusterMaker
Data association using one of the methods indexed by TrackingConfig::DataAssociation
Tracker initialization using the method indexed by TrackingConfig::Initializer
Tracking using one of the methods indexed by TrackingConfig::Tracker
Public Types
-
enum class ClusterMaker
Defines the type of cluster maker used by the TrackingAlgorithm to build clusters from input events.
Values:
-
enumerator SIMPLE_GRID
Cluster making is based on a regular grid:
The camera FOV is divided into elementary cells using a regular grid; the size of the cells is cell_width_ x cell_height_.
For each cell, if the number of events in the cell for the given time-slice cell_deltat_ is larger than the activation_threshold_, then the cell is considered as active.
Active cells of a given time-slice are connected into clusters.
-
enumerator MEDOID_SHIFT
Cluster making is based on spatial and temporal distances between neighboring events. If the spatial and temporal distances between the event and its neighboring event are smaller than the thresholds medoid_shift_spatial_dist_ and medoid_shift_temporal_dist_, then the event goes to the same cluster as its neighbour, otherwise, it creates a new cluster.
-
enumerator SIMPLE_GRID
-
enum class DataAssociation
Defines the type of data association used by the TrackingAlgorithm to associate each cluster to one tracker.
Values:
-
enumerator NEAREST
Data association is based on the nearest tracker.
-
enumerator IOU
Data association is based the largest IOU (Intersection Over Union) area between the tracker and the cluster. If no IOU association is available but the distance between the tracker and the cluster is smaller than iou_max_dist_, then the cluster is associated using the nearest criterion. The IOU criterion has the priority over the distance criterion.
-
enumerator NEAREST
-
enum class Initializer
Defines the type of initializer used by the TrackingAlgorithm to initialize new trackers and make bounding box proposals from input cluster/events. Only one method is implemented for now.
Values:
-
enumerator SIMPLE
-
enumerator SIMPLE
-
enum class MotionModel
Defines the type of motion model used by the TrackingAlgorithm to predict the positions of trackers.
Values:
-
enumerator SIMPLE
Motion model that assumes that the velocity is constant.
-
enumerator INSTANT
Motion model that takes the last measured velocity.
-
enumerator SMOOTH
Motion model that models the velocity as a smooth evolving quantity parameterized by smooth_mm_alpha_vel_.
-
enumerator KALMAN
Kalman motion model.
-
enumerator SIMPLE
-
enum class KalmanModel
Defines the motion model used in MotionModel::KALMAN.
Values:
-
enumerator CONSTANT_VELOCITY
Motion model with a constant velocity.
-
enumerator CONSTANT_ACCELERATION
Motion model with a constant acceleration.
-
enumerator CONSTANT_VELOCITY
-
enum class KalmanPolicy
Defines the policy to determine measurement noise from data in MotionModel::KALMAN.
Values:
-
enumerator ADAPTIVE_NOISE
Policy that adapts the measurement noise based on the number of events associated to the tracker.
-
enumerator MEASUREMENT_TRUST
Policy that keeps the noise model as defined in the provided parameters.
-
enumerator ADAPTIVE_NOISE
-
enum class Tracker
Defines the type of the tracker used by the TrackingAlgorithm.
Values:
-
enumerator ELLIPSE
Tracker is based on the event by event update of the tracker’s pose and shape. The tracker is represented as a Gaussian, and the update is performed by weighting each event contribution with EllipseUpdateFunction and updating the tracker’s pose/size using EllipseUpdateMethod.
-
enumerator CLUSTERKF
Kalman tracker that uses the result of clustering as an observation state to predict the current state of the tracker. It considers the cluster’s barycenter and size as measurements, and it estimates the tracker’s position, velocity and size.
-
enumerator ELLIPSE
-
enum class EllipseUpdateFunction
Update function used in Tracker::ELLIPSE.
Values:
-
enumerator UNIFORM
Function outputs one if the radius is smaller than the parameter, and zero otherwise.
-
enumerator GAUSSIAN
Function computes a Gaussian with mean equal to 1 and variance given in input.
-
enumerator SIGNED_GAUSSIAN
Function computes a Gaussian multiplied by the radius minus the mean. This changes the sign of the function inside the radius and gives a negative update.
-
enumerator TRUNCATED_GAUSSIAN
Function computes a Gaussian if the radius is larger than the mean, otherwise returns zero.
-
enumerator UNIFORM
-
enum class EllipseUpdateMethod
Method used in Tracker::ELLIPSE to update the tracker.
Values:
-
enumerator PER_EVENT
Method updates the tracker at each event.
-
enumerator ELLIPSE_FITTING
Method fits an ellipse on the associated cluster events and then updates the tracker’s position event by event and the shape using the covariance of the associated cluster
-
enumerator GAUSSIAN_FITTING
Method computes the mean and the covariance of the associated cluster events and then updates the tracker’s position event by event and the shape using the covariance of the associated cluster
-
enumerator ELLIPSE_FITTING_FULL
Method fits an ellipse on the associated cluster events and then updates the tracker using a convex combination on the mean and covariance of the cluster without weight
-
enumerator GAUSSIAN_FITTING_FULL
Method fits a Gaussian on the associated cluster events and then updates the tracker using a convex combination on the mean and covariance of the cluster without weight
-
enumerator PER_EVENT
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
Cell’s width (in pixels) in ClusterMaker::SIMPLE_GRID.
-
int cell_height_ = 10
Cell’s height (in pixels) in ClusterMaker::SIMPLE_GRID.
-
timestamp cell_deltat_ = 1000
Time-slice (in us) used to decide if a cell is active in ClusterMaker::SIMPLE_GRID.
-
int activation_threshold_ = 5
Minimum number of events needed to activate the cell in ClusterMaker::SIMPLE_GRID.
-
float medoid_shift_spatial_dist_ = 5
Maximum spatial distance (using Manhattan distance) for two events to be in the same cluster in ClusterMaker::MEDOID_SHIFT.
-
timestamp medoid_shift_temporal_dist_ = 10000
Maximum temporal distance for two events to be in the same cluster in ClusterMaker::MEDOID_SHIFT.
-
int medoid_shift_min_size_ = 2
Minimum width and height for a cluster to be considered valid in ClusterMaker::MEDOID_SHIFT and given to the tracking engine.
-
DataAssociation data_association_ = DataAssociation::IOU
Type of data association to use.
-
double max_dist_ = 150.
Maximum distance between the cluster’s centroid and the tracker’s position (in pixels) used in DataAssociation::NEAREST.
-
double iou_max_dist_ = 150.
Maximum distance between the cluster’s centroid and the tracker’s position (in pixels) used in DataAssociation::IOU. The distance criterion is used only if IOU association is not available.
-
Initializer initializer_ = Initializer::SIMPLE
Type of tracker initializer to use.
-
MotionModel motion_model_ = MotionModel::SIMPLE
Type of motion model to use.
-
double smooth_mm_alpha_vel_ = 0.001
Smoothing parameter used in MotionModel::SMOOTH.
-
double kalman_motion_model_pos_trans_std_ = 0.0001
Standard deviation of the transition noise for the tracker’s position in MotionModel::KALMAN.
-
double kalman_motion_model_vel_trans_std_ = 0.05
Standard deviation of the transition noise for the tracker’s velocity in MotionModel::KALMAN.
-
double kalman_motion_model_acc_trans_std_ = 1e-9
Standard deviation of the transition noise for the tracker’s acceleration in MotionModel::KALMAN.
-
double kalman_motion_model_pos_obs_std_ = 100
Standard deviation of the observation noise for the tracker’s position in MotionModel::KALMAN.
-
double kalman_motion_model_init_factor_ = 1e12
Factor to multiply to noise variance at initialization in MotionModel::KALMAN.
-
double kalman_motion_model_avg_events_per_pixel_ = 1
Expected average events per pixel rate in events/us in MotionModel::KALMAN.
-
timestamp kalman_motion_model_min_dt_ = 1000
Minimal timestep at which Kalman filter is computed in MotionModel::KALMAN.
-
KalmanPolicy kalman_motion_model_policy_ = KalmanPolicy::ADAPTIVE_NOISE
Policy used in MotionModel::KALMAN.
-
KalmanModel kalman_motion_model_motion_model_ = KalmanModel::CONSTANT_VELOCITY
Motion model used in MotionModel::KALMAN.
-
double alpha_pos_ = 0.1
Update rate for the tracker position in Tracker::ELLIPSE.
-
double alpha_shape_ = 0.04
Update rate for the tracker shape in Tracker::ELLIPSE.
-
EllipseUpdateFunction update_function_ = EllipseUpdateFunction::GAUSSIAN
Update function used in Tracker::ELLIPSE
-
EllipseUpdateMethod update_method_ = EllipseUpdateMethod::GAUSSIAN_FITTING
Update method used in Tracker::ELLIPSE
-
bool decompose_covariance_ = false
Flag specifying if to update the covariance decomposing it in eigenvalues and eigenvectors in Tracker::ELLIPSE
-
double cluster_kf_pos_var_ = 1200000000
Variance of the tracker’s position in Tracker::CLUSTERKF.
-
double cluster_kf_vel_var_ = 32000
Variance of the tracker’s velocity in Tracker::CLUSTERKF.
-
double cluster_kf_acc_var_ = 0.8
Variance of the tracker’s acceleration in Tracker::CLUSTERKF.
-
double cluster_kf_size_var_ = 200000
Variance of the tracker’s size in Tracker::CLUSTERKF.
-
double cluster_kf_vel_size_var_ = 2
Variance of the tracker’s size change rate in Tracker::CLUSTERKF
-
double cluster_kf_pos_obs_var_ = 200
Variance of the observed position in Tracker::CLUSTERKF.
-
double cluster_kf_size_obs_var_ = 1e3
Variance of the observed size in Tracker::CLUSTERKF.
-
timestamp ts_to_stop_ = 100000
Time (in us) to wait without having updated a tracker before deleting it.
-
std::filesystem::path forbidden_area_file_ = ""
File indicating the forbidden area.