39 MotionData() : _detected(false), _centroid_x(0), _centroid_y(0), _frame_width(0), _frame_height(0), _pixel_count(0)
51 MotionData(
int centroid_x,
int centroid_y,
int frame_width,
int frame_height,
int pixel_count)
52 : _detected(true), _centroid_x(centroid_x), _centroid_y(centroid_y), _frame_width(frame_width),
53 _frame_height(frame_height), _pixel_count(pixel_count)
111 uint32_t _detection_time_ms;
113 float _motion_confidence;
114 int _consecutive_motion_frames;
115 int _consecutive_static_frames;
116 uint32_t _total_detections;
117 uint32_t _total_frames;
118 uint32_t _last_frame_timestamp;
119 uint32_t _average_fps;
126 : _detection_time_ms(0), _pixels_changed(0), _motion_confidence(0.0f), _consecutive_motion_frames(0),
127 _consecutive_static_frames(0), _total_detections(0), _total_frames(0), _last_frame_timestamp(0),
136 void set_detection_time_ms(uint32_t time) { this->_detection_time_ms = time; }
137 void set_pixels_changed(
int count) { this->_pixels_changed = count; }
145 this->_motion_confidence = (conf < 0.0f) ? 0.0f : (conf > 1.0f) ? 1.0f : conf;
147 void set_consecutive_motion_frames(
int count) { this->_consecutive_motion_frames = count; }
148 void set_consecutive_static_frames(
int count) { this->_consecutive_static_frames = count; }
149 void set_total_detections(uint32_t count) { this->_total_detections = count; }
150 void set_total_frames(uint32_t count) { this->_total_frames = count; }
151 void set_last_frame_timestamp(uint32_t ts) { this->_last_frame_timestamp = ts; }
152 void set_average_fps(uint32_t fps) { this->_average_fps = fps; }
Performance and health metrics for the Motion Detection engine.
Definition motion_data.h:109
uint32_t get_total_frames() const
Definition motion_data.h:172
uint32_t get_last_frame_timestamp() const
Definition motion_data.h:174
float get_motion_confidence() const
Definition motion_data.h:164
uint32_t get_total_detections() const
Definition motion_data.h:170
int get_pixels_changed() const
Definition motion_data.h:162
uint32_t get_detection_time_ms() const
Definition motion_data.h:160
uint32_t get_average_fps() const
Definition motion_data.h:176
void set_motion_confidence(float conf)
Sets confidence and clamps value between 0.0 and 1.0.
Definition motion_data.h:143
DetectionMetrics()
Constructor: Initializes all metrics to zero.
Definition motion_data.h:125
int get_consecutive_static_frames() const
Definition motion_data.h:168
int get_consecutive_motion_frames() const
Definition motion_data.h:166
Clean abstraction for motion detection results.
Definition motion_data.h:20
int get_centroid_x() const
Get motion centroid X coordinate.
Definition motion_data.h:73
int get_frame_height() const
Get the height of the frame processed.
Definition motion_data.h:91
MotionData()
Default Constructor: Create empty motion data.
Definition motion_data.h:39
int get_pixel_count() const
Get the volume of detected motion.
Definition motion_data.h:97
int get_centroid_y() const
Get motion centroid Y coordinate.
Definition motion_data.h:79
int get_frame_width() const
Get the width of the frame processed.
Definition motion_data.h:85
bool is_detected() const
Check if valid motion was detected in this snapshot.
Definition motion_data.h:67
MotionData(int centroid_x, int centroid_y, int frame_width, int frame_height, int pixel_count)
Parameterized Constructor: Create motion data from algorithm output.
Definition motion_data.h:51