#include <OmniMotionDetecting.hh>
Inheritance diagram for OmniMotionDetecting< ConverterT, AngleT >:
ConverterT | Conversion concrete class. For example OmniFastLookupTable or OmniGCardConverter | |
AngleT | Base unit used for angle. It can be for example "int" or "double". |
Definition at line 59 of file OmniMotionDetecting.hh.
Public Member Functions | |
OmniMotionDetecting (on_window_trackable_wannabe_cb *f_cb, void *callback_data, OmniConversion< ConverterT, AngleT, IplImage, CvPoint > *conv_table, int ring_buf_length=4) | |
Constructor. | |
virtual | ~OmniMotionDetecting () |
void | process_next_frame (IplImage *next_frame) |
Main loop. | |
void | register_image_callbacks (on_create_image_context_cb *create_image_context, on_image_do_action_cb *image_show, on_destroy_image_context_cb *destroy_image_context, void *callback_data_on_image_cb) |
The default display system is give to OpenCV capabilities. | |
Private Member Functions | |
void | fast_update_mhi (IplImage *img, int diff_threshold=10) |
Sort of main loop. | |
Private Attributes | |
on_window_trackable_wannabe_cb * | f_on_window_trackable_wannabe_cb |
Callback function to which the frames will be delivered to. | |
on_create_image_context_cb * | create_image_context |
Image display callback. | |
on_image_do_action_cb * | image_show |
Image display callback. | |
on_destroy_image_context_cb * | destroy_image_context |
Image display callback. | |
void * | _callback_data_on_window_trackable_wannabe_cb |
void * | _callback_data_on_image_cb |
OmniConversion< ConverterT, AngleT, IplImage, CvPoint > * | _conv_table |
The conversion class. | |
IplImage ** | _ring_buf |
Ring image buffer. | |
int | _ring_buf_length |
Number of cyclic frame buffer used for motion detection, (should, probably, depend on FPS). | |
int | _ring_last_indx |
IplImage * | _mhi |
MHI. | |
IplImage * | _orient |
orientation | |
IplImage * | _mask |
valid orientation mask | |
IplImage * | _segmask |
motion segmentation map | |
CvMemStorage * | _storage |
temporary storage |
OmniMotionDetecting< ConverterT, AngleT >::OmniMotionDetecting | ( | on_window_trackable_wannabe_cb * | f_cb, | |
void * | callback_data, | |||
OmniConversion< ConverterT, AngleT, IplImage, CvPoint > * | conv_table, | |||
int | ring_buf_length = 4 | |||
) |
f_cb | Callback function for a wannabe trackable window. This function should check the availability of the space in the tracking table, then process or discard the request. | |
callback_data | Callback data. | |
conv_table | Converter class. | |
ring_buf_length | Lenght of the ring buffer used to rotate the images and detect the motion. |
Definition at line 162 of file OmniMotionDetecting.hh.
References OmniMotionDetecting< ConverterT, AngleT >::_ring_buf, OmniMotionDetecting< ConverterT, AngleT >::_ring_buf_length, NULL, omnistuff_create_image_context(), omnistuff_destroy_image_context(), omnistuff_image_do_action(), and OmniMotionDetecting< ConverterT, AngleT >::register_image_callbacks().
Here is the call graph for this function:
OmniMotionDetecting< ConverterT, AngleT >::~OmniMotionDetecting | ( | ) | [virtual] |
Definition at line 191 of file OmniMotionDetecting.hh.
References OmniMotionDetecting< ConverterT, AngleT >::_ring_buf.
void OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi | ( | IplImage * | img, | |
int | diff_threshold = 10 | |||
) | [private] |
Will be called by process_next_frame ().
img | Next image in the stream. | |
diff_threshold | Difference bound between the current and the previous images. |
Definition at line 208 of file OmniMotionDetecting.hh.
References OmniMotionDetecting< ConverterT, AngleT >::_callback_data_on_window_trackable_wannabe_cb, OmniMotionDetecting< ConverterT, AngleT >::_conv_table, OmniMotionDetecting< ConverterT, AngleT >::_mask, OmniMotionDetecting< ConverterT, AngleT >::_mhi, OmniMotionDetecting< ConverterT, AngleT >::_orient, OmniMotionDetecting< ConverterT, AngleT >::_ring_buf, OmniMotionDetecting< ConverterT, AngleT >::_ring_buf_length, OmniMotionDetecting< ConverterT, AngleT >::_ring_last_indx, OmniMotionDetecting< ConverterT, AngleT >::_segmask, OmniMotionDetecting< ConverterT, AngleT >::_storage, OmniAngle< TypeT >::angle_end, OmniAngle< TypeT >::angle_start, OmniConversion< ConverterT, AngleT, ImageT, PointT >::angle_type_conversion(), OmniMotionDetecting< ConverterT, AngleT >::f_on_window_trackable_wannabe_cb, FACE_TRACK_ANGLE_WINDOW, OmniConversion< ConverterT, AngleT, ImageT, PointT >::get_omni_center_x(), OmniConversion< ConverterT, AngleT, ImageT, PointT >::get_omni_center_y(), MAX_TIME_DELTA, MHI_DURATION, NULL, and OmniAngle< TypeT >::range.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::process_next_frame().
Here is the call graph for this function:
Here is the caller graph for this function:
void OmniMotionDetecting< ConverterT, AngleT >::process_next_frame | ( | IplImage * | next_frame | ) |
Subsequent frames to the first should be passed here.
next_frame | Next IplImage in the stream. |
Definition at line 199 of file OmniMotionDetecting.hh.
References OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
Here is the call graph for this function:
void OmniMotionDetecting< ConverterT, AngleT >::register_image_callbacks | ( | on_create_image_context_cb * | create_image_context, | |
on_image_do_action_cb * | image_show, | |||
on_destroy_image_context_cb * | destroy_image_context, | |||
void * | callback_data_on_image_cb | |||
) |
Unfortunately this is not really performant and bug free on a multiplatform fashion. This is because we can set the display callbacks to act like we want with other libraries.
create_image_context | Create window [with a title] where to display the images. | |
image_show | Perform the call to the show function. | |
callback_data_on_image_do_action | Callback data to image_show function. | |
destroy_image_context | Destroy the display window and it's context. |
Definition at line 311 of file OmniMotionDetecting.hh.
References OmniMotionDetecting< ConverterT, AngleT >::_callback_data_on_image_cb.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::OmniMotionDetecting().
Here is the caller graph for this function:
void* OmniMotionDetecting< ConverterT, AngleT >::_callback_data_on_image_cb [private] |
Definition at line 122 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::register_image_callbacks().
void* OmniMotionDetecting< ConverterT, AngleT >::_callback_data_on_window_trackable_wannabe_cb [private] |
Definition at line 121 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
OmniConversion<ConverterT, AngleT, IplImage, CvPoint>* OmniMotionDetecting< ConverterT, AngleT >::_conv_table [private] |
It's specified by ConverterT, AngleT, ImageT, PointT.
Definition at line 128 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
IplImage* OmniMotionDetecting< ConverterT, AngleT >::_mask [private] |
Definition at line 145 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
IplImage* OmniMotionDetecting< ConverterT, AngleT >::_mhi [private] |
Definition at line 139 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
IplImage* OmniMotionDetecting< ConverterT, AngleT >::_orient [private] |
Definition at line 142 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
IplImage** OmniMotionDetecting< ConverterT, AngleT >::_ring_buf [private] |
int OmniMotionDetecting< ConverterT, AngleT >::_ring_buf_length [private] |
Definition at line 134 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi(), and OmniMotionDetecting< ConverterT, AngleT >::OmniMotionDetecting().
int OmniMotionDetecting< ConverterT, AngleT >::_ring_last_indx [private] |
Definition at line 135 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
IplImage* OmniMotionDetecting< ConverterT, AngleT >::_segmask [private] |
Definition at line 148 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
CvMemStorage* OmniMotionDetecting< ConverterT, AngleT >::_storage [private] |
Definition at line 151 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
on_create_image_context_cb* OmniMotionDetecting< ConverterT, AngleT >::create_image_context [private] |
Definition at line 111 of file OmniMotionDetecting.hh.
on_destroy_image_context_cb* OmniMotionDetecting< ConverterT, AngleT >::destroy_image_context [private] |
Definition at line 117 of file OmniMotionDetecting.hh.
on_window_trackable_wannabe_cb* OmniMotionDetecting< ConverterT, AngleT >::f_on_window_trackable_wannabe_cb [private] |
Definition at line 108 of file OmniMotionDetecting.hh.
Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().
on_image_do_action_cb* OmniMotionDetecting< ConverterT, AngleT >::image_show [private] |
Definition at line 114 of file OmniMotionDetecting.hh.