Program Listing for File tracking_struct.h
↰ Return to documentation for file (c/fmdt/tracking/tracking_struct.h)
#pragma once
#include <stdint.h>
#include <stddef.h>
#include "fmdt/motion/motion_struct.h" // motion_t
enum obj_e { OBJ_UNKNOWN = 0,
OBJ_METEOR,
OBJ_STAR,
OBJ_NOISE,
N_OBJECTS
};
enum state_e { STATE_UNKNOWN = 0,
STATE_UPDATED,
STATE_LOST,
STATE_FINISHED,
N_STATES
};
enum change_state_reason_e { REASON_UNKNOWN = 0,
REASON_TOO_BIG_ANGLE,
REASON_WRONG_DIRECTION,
REASON_TOO_LONG_DURATION,
REASON_ELLIPSE_RATIO,
N_REASONS
};
typedef uint32_t* vec_uint32_t;
typedef struct {
uint32_t id;
uint32_t frame;
uint32_t xmin;
uint32_t xmax;
uint32_t ymin;
uint32_t ymax;
uint32_t S;
float x;
float y;
uint32_t prev_id;
uint32_t next_id;
float dx;
float dy;
float error;
uint32_t time;
uint32_t time_motion;
uint8_t is_extrapolated;
float a;
float b;
} RoI_t;
typedef struct {
uint32_t id;
RoI_t begin;
RoI_t end;
float extrapol_x1;
float extrapol_y1;
float extrapol_x2;
float extrapol_y2;
float extrapol_dx;
float extrapol_dy;
uint8_t extrapol_order;
enum state_e state;
enum obj_e obj_type;
enum change_state_reason_e change_state_reason;
vec_uint32_t RoIs_id;
} track_t;
typedef track_t* vec_track_t;
typedef struct {
RoI_t** RoIs;
motion_t* motion;
uint32_t* n_RoIs;
uint32_t _max_n_RoIs;
size_t _size;
size_t _max_size;
} History_t;
typedef struct {
vec_track_t tracks;
History_t* history;
RoI_t* RoIs_list;
} tracking_data_t;
size_t _tracking_get_track_time(const RoI_t track_begin, const RoI_t track_end);
size_t tracking_get_track_time(const vec_track_t tracks, const size_t t);
size_t tracking_count_objects(const vec_track_t tracks, unsigned* n_stars, unsigned* n_meteors, unsigned* n_noise);