OmniMotionDetecting< ConverterT, AngleT > Class Template Reference

#include <OmniMotionDetecting.hh>

Inheritance diagram for OmniMotionDetecting< ConverterT, AngleT >:

Inheritance graph
[legend]
Collaboration diagram for OmniMotionDetecting< ConverterT, AngleT >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class ConverterT, class AngleT>
class OmniMotionDetecting< ConverterT, AngleT >

Template class.
Parameters:
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_cbf_on_window_trackable_wannabe_cb
 Callback function to which the frames will be delivered to.
on_create_image_context_cbcreate_image_context
 Image display callback.
on_image_do_action_cbimage_show
 Image display callback.
on_destroy_image_context_cbdestroy_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


Constructor & Destructor Documentation

template<class ConverterT, class AngleT>
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 
)

Parameters:
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.
See also:
OmniFastLookupTable, OmniGCardConverter, OmniConversion

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:

template<class ConverterT, class AngleT>
OmniMotionDetecting< ConverterT, AngleT >::~OmniMotionDetecting (  )  [virtual]

Definition at line 191 of file OmniMotionDetecting.hh.

References OmniMotionDetecting< ConverterT, AngleT >::_ring_buf.


Member Function Documentation

template<class ConverterT, class AngleT>
void OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi ( IplImage *  img,
int  diff_threshold = 10 
) [private]

Will be called by process_next_frame ().

Parameters:
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:

template<class ConverterT, class AngleT>
void OmniMotionDetecting< ConverterT, AngleT >::process_next_frame ( IplImage *  next_frame  ) 

Subsequent frames to the first should be passed here.

Parameters:
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:

template<class ConverterT, class AngleT>
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.

Parameters:
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:


Member Data Documentation

template<class ConverterT, class AngleT>
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().

template<class ConverterT, class AngleT>
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().

template<class ConverterT, class AngleT>
OmniConversion<ConverterT, AngleT, IplImage, CvPoint>* OmniMotionDetecting< ConverterT, AngleT >::_conv_table [private]

It's specified by ConverterT, AngleT, ImageT, PointT.

See also:
OmniFastLookupTable, OmniGCardConverter, OmniConversion

Definition at line 128 of file OmniMotionDetecting.hh.

Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().

template<class ConverterT, class AngleT>
IplImage* OmniMotionDetecting< ConverterT, AngleT >::_mask [private]

Definition at line 145 of file OmniMotionDetecting.hh.

Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().

template<class ConverterT, class AngleT>
IplImage* OmniMotionDetecting< ConverterT, AngleT >::_mhi [private]

Definition at line 139 of file OmniMotionDetecting.hh.

Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().

template<class ConverterT, class AngleT>
IplImage* OmniMotionDetecting< ConverterT, AngleT >::_orient [private]

Definition at line 142 of file OmniMotionDetecting.hh.

Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().

template<class ConverterT, class AngleT>
IplImage** OmniMotionDetecting< ConverterT, AngleT >::_ring_buf [private]

Definition at line 131 of file OmniMotionDetecting.hh.

Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi(), OmniMotionDetecting< ConverterT, AngleT >::OmniMotionDetecting(), and OmniMotionDetecting< ConverterT, AngleT >::~OmniMotionDetecting().

template<class ConverterT, class AngleT>
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().

template<class ConverterT, class AngleT>
int OmniMotionDetecting< ConverterT, AngleT >::_ring_last_indx [private]

Definition at line 135 of file OmniMotionDetecting.hh.

Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().

template<class ConverterT, class AngleT>
IplImage* OmniMotionDetecting< ConverterT, AngleT >::_segmask [private]

Definition at line 148 of file OmniMotionDetecting.hh.

Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().

template<class ConverterT, class AngleT>
CvMemStorage* OmniMotionDetecting< ConverterT, AngleT >::_storage [private]

Definition at line 151 of file OmniMotionDetecting.hh.

Referenced by OmniMotionDetecting< ConverterT, AngleT >::fast_update_mhi().

template<class ConverterT, class AngleT>
on_create_image_context_cb* OmniMotionDetecting< ConverterT, AngleT >::create_image_context [private]

Definition at line 111 of file OmniMotionDetecting.hh.

template<class ConverterT, class AngleT>
on_destroy_image_context_cb* OmniMotionDetecting< ConverterT, AngleT >::destroy_image_context [private]

Definition at line 117 of file OmniMotionDetecting.hh.

template<class ConverterT, class AngleT>
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().

template<class ConverterT, class AngleT>
on_image_do_action_cb* OmniMotionDetecting< ConverterT, AngleT >::image_show [private]

Definition at line 114 of file OmniMotionDetecting.hh.


The documentation for this class was generated from the following file:
Generated on Tue Dec 26 10:37:59 2006 for Omnimeeting by  doxygen 1.4.7