Smart Camera ESP32
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
MotionData Class Reference

Clean abstraction for motion detection results. More...

#include <motion_data.h>

Public Member Functions

Initialization
 MotionData ()
 Default Constructor: Create empty motion data.
 
 MotionData (int centroid_x, int centroid_y, int frame_width, int frame_height, int pixel_count)
 Parameterized Constructor: Create motion data from algorithm output.
 
Data Accessors (Getters)
bool is_detected () const
 Check if valid motion was detected in this snapshot.
 
int get_centroid_x () const
 Get motion centroid X coordinate.
 
int get_centroid_y () const
 Get motion centroid Y coordinate.
 
int get_frame_width () const
 Get the width of the frame processed.
 
int get_frame_height () const
 Get the height of the frame processed.
 
int get_pixel_count () const
 Get the volume of detected motion.
 

Detailed Description

Clean abstraction for motion detection results.

Separates motion detection logic from visualization. This class acts as a "Snapshot" of a single frame's motion analysis, providing the geometric data required to draw AR overlays or move servos.

Constructor & Destructor Documentation

◆ MotionData() [1/2]

MotionData::MotionData ( )
inline

Default Constructor: Create empty motion data.

Note
Used to initialize state when no motion has been processed yet.

◆ MotionData() [2/2]

MotionData::MotionData ( int centroid_x,
int centroid_y,
int frame_width,
int frame_height,
int pixel_count )
inline

Parameterized Constructor: Create motion data from algorithm output.

Parameters
centroid_xThe X coordinate of the motion "blob" center.
centroid_yThe Y coordinate of the motion "blob" center.
frame_widthThe resolution width used during analysis.
frame_heightThe resolution height used during analysis.
pixel_countThe quantity of pixels that exceeded the sensitivity threshold.

Member Function Documentation

◆ get_centroid_x()

int MotionData::get_centroid_x ( ) const
inline

Get motion centroid X coordinate.

Returns
X pixel coordinate (0 if no motion).

◆ get_centroid_y()

int MotionData::get_centroid_y ( ) const
inline

Get motion centroid Y coordinate.

Returns
Y pixel coordinate (0 if no motion).

◆ get_frame_height()

int MotionData::get_frame_height ( ) const
inline

Get the height of the frame processed.

Returns
Source height in pixels (e.g., 240 for QVGA).

◆ get_frame_width()

int MotionData::get_frame_width ( ) const
inline

Get the width of the frame processed.

Returns
Source width in pixels (e.g., 320 for QVGA).

◆ get_pixel_count()

int MotionData::get_pixel_count ( ) const
inline

Get the volume of detected motion.

Returns
Total count of pixels that changed between frames.

◆ is_detected()

bool MotionData::is_detected ( ) const
inline

Check if valid motion was detected in this snapshot.

Returns
true if the pixel_count met the minimum algorithm threshold.

The documentation for this class was generated from the following file: