motiondetect.c File Reference

Include dependency graph for motiondetect.c:


Data Structures

struct  filter_sys_t
 filter_sys_t: chroma method descriptor More...

Defines

#define FILTER_PREFIX   "motiondetect-"
#define NUM_COLORS   (5000)
#define CHECK(A)

Functions

static int Create (vlc_object_t *)
static void Destroy (vlc_object_t *)
int vlc_entry__main (module_t *p_module)
const char * vlc_entry_license__main (void)
static picture_tFilter (filter_t *, picture_t *)
static picture_tFilterPacked (filter_t *, picture_t *)
static void GaussianConvolution (uint32_t *, uint32_t *, int, int, int)
static int FindShapes (uint32_t *, uint32_t *, int, int, int, int *, int *, int *, int *, int *)
static void Draw (filter_t *p_filter, uint8_t *p_pix, int i_pix_pitch, int i_pix_size)

Define Documentation

#define CHECK (  ) 

Value:

if( p_smooth[A] && p_smooth[A] != p_smooth[i*i_pitch+j] ) \
                { \
                    if( p_smooth[A] < p_smooth[i*i_pitch+j] ) \
                        colors[p_smooth[i*i_pitch+j]] = p_smooth[A]; \
                    else \
                        colors[p_smooth[A]] = p_smooth[i*i_pitch+j]; \
                }

Referenced by FindShapes(), and yadif_filter_line_c().

#define FILTER_PREFIX   "motiondetect-"

#define NUM_COLORS   (5000)

Referenced by FindShapes().


Function Documentation

static int Create ( vlc_object_t p_this  )  [static]

static void Destroy ( vlc_object_t p_this  )  [static]

static void Draw ( filter_t p_filter,
uint8_t *  p_pix,
int  i_pix_pitch,
int  i_pix_size 
) [static]

static picture_t * Filter ( filter_t p_filter,
picture_t p_inpic 
) [static]

Substract Y planes

Get the areas where movement was detected

Count final number of shapes Draw rectangles (there can be more than 1 moving shape in 1 rectangle)

We're done. Lets keep a copy of the picture TODO we may just picture_Release with a latency of 1 if the filters/vout handle it correctly

References filter_sys_t::b_old, filter_sys_t::color_x_max, filter_sys_t::color_x_min, filter_sys_t::color_y_max, filter_sys_t::color_y_min, filter_sys_t::colors, Draw(), filter_NewPicture(), FindShapes(), filter_t::fmt_in, picture_t::format, i, video_format_t::i_chroma, filter_sys_t::i_colors, video_format_t::i_height, plane_t::i_pitch, video_format_t::i_width, msg_Warn, picture_t::p, filter_sys_t::p_buf, filter_sys_t::p_buf2, filter_sys_t::p_old, plane_t::p_pixels, filter_t::p_sys, p_sys, picture_Copy(), picture_Release(), U_PLANE, V_PLANE, es_format_t::video, VLC_CODEC_I420, VLC_CODEC_I422, VLC_CODEC_J420, VLC_CODEC_J422, VLC_CODEC_YV12, and Y_PLANE.

static picture_t * FilterPacked ( filter_t p_filter,
picture_t p_inpic 
) [static]

Get the areas where movement was detected

Count final number of shapes Draw rectangles (there can be more than 1 moving shape in 1 rectangle)

We're done. Lets keep a copy of the picture TODO we may just picture_Release with a latency of 1 if the filters/vout handle it correctly

References filter_sys_t::b_old, filter_sys_t::color_x_max, filter_sys_t::color_x_min, filter_sys_t::color_y_max, filter_sys_t::color_y_min, filter_sys_t::colors, Draw(), filter_NewPicture(), FindShapes(), filter_t::fmt_in, GetPackedYuvOffsets(), i, video_format_t::i_chroma, filter_sys_t::i_colors, video_format_t::i_height, plane_t::i_pitch, video_format_t::i_width, msg_Warn, picture_t::p, filter_sys_t::p_buf, filter_sys_t::p_buf2, filter_sys_t::p_old, plane_t::p_pixels, filter_t::p_sys, p_sys, picture_Copy(), picture_Release(), es_format_t::video, and Y_PLANE.

static int FindShapes ( uint32_t *  p_diff,
uint32_t *  p_smooth,
int  i_pitch,
int  i_visible,
int  i_lines,
int *  colors,
int *  color_x_min,
int *  color_x_max,
int *  color_y_min,
int *  color_y_max 
) [static]

Apply some smoothing to remove noise

Label the shapes and build the labels dependencies list

Initialise empty rectangle list

Compute rectangle coordinates

Merge overlaping rectangles

References __MAX, __MIN, CHECK, GaussianConvolution(), i, and NUM_COLORS.

Referenced by Filter(), and FilterPacked().

static void GaussianConvolution ( uint32_t *  p_inpix,
uint32_t *  p_smooth,
int  i_src_pitch,
int  i_num_lines,
int  i_src_visible 
) [static]

int vlc_entry__main ( module_t p_module  ) 

const char* vlc_entry_license__main ( void   ) 


Generated on Tue May 25 08:05:31 2010 for VLC by  doxygen 1.5.6