root/modules/motion_detector.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2 
   3 Motion detection module
   4 
   5 Author: mx3 (Max Sagaydachny) . win1251 ( Максим Сагайдачный )
   6 Email: win.drivers@gmail.com
   7 Skype: max_dtc
   8 ICQ#: 125-985-663
   9 Country: Ukraine
  10 Sity: Kharkiv
  11 
  12 idea: mx3
  13 implementation: mx3
  14 
  15 purpose of the module:
  16  implement 2 uBASIC procedures
  17    md_detect_changes( columns [in], rows [in], pixel_measure_mode,  )
  18    md_get_cell_change ( col [in], row [in], val [out] )
  19 
  20 explanation:
  21 
  22  - for motion detection used array of YUV pixels which are used to display thumbnail picture on LCD
  23 
  24 declaration:
  25 
  26 function md_detect_changes ( 
  27 
  28   columns, // input parameter. number of columns to split screen into
  29 
  30   rows, // input parameter. number of rows to split screen into
  31 
  32   pixel_measure_mode, // input parameter.
  33     // 0 for Y,
  34     // 1 for U, - (mx3)not sure if this mode required
  35     // 2 for V, - (mx3)not sure if this mode required
  36     // 3 for R, - (mx3)not sure if this mode required
  37     // 4 for G, - (mx3)not sure if this mode required
  38     // 5 for B, - (mx3)not sure if this mode required
  39 
  40   detection_timeout, // input parameter. number of millisecnds to abort detection. detected_cells_count will be 0 for timeout condition
  41 
  42   measure_interval, // input parameter. number of milliseconds between comparison of two pictures
  43 
  44   threshold, // input parameter. difference value for which procedure will trigger detection of changes
  45 
  46   draw_grid, // bit mask input parameter. 
  47              // bit 0 - to draw grid (detected sectors/cells).
  48              // bit 1 - to display most recent cell difference
  49 
  50   detected_cells_count, // output parameter. count of cells where pixel values differs enough to trigger motion detection
  51 
  52 // clipping. allows to exclude some region from mtion detection triggering
  53 // or use onli selected area to make motion detection
  54 // I'm not sure that following parameters are required but using them anyway
  55 
  56   clipping_region_mode, // input parameter.
  57                         // 0 no clipping regions
  58       // 1 - for excluding selected region from motion detection 
  59       // 2 - use this only region to make motion detection
  60   clipping_region_column1, // input parameter.
  61   clipping_region_row1, // input parameter. 
  62    // this is top-left corner of clipping region 
  63 
  64   clipping_region_column2, // input parameter.
  65   clipping_region_row2, // input parameter.
  66          // this is right bottom corner of clipping region
  67 )
  68 
  69 function md_get_cell_diff ( 
  70   col [in], // column of the cell we are requesting
  71   row [in], // row of the cell we are requesting
  72   val [out] // value of difference between measurements
  73 )
  74 
  75 */
  76 
  77 #ifndef __MOTION_DETECTOR__
  78 #define __MOTION_DETECTOR__
  79 
  80 #include "flt.h"
  81 
  82 // Update version if changes are made to the module interface
  83 #define MOTION_DETECTOR_VERSION {2,0}
  84 
  85 typedef struct
  86 {
  87     base_interface_t    base;
  88 
  89     void (*md_close_motion_detector)();
  90     int (*md_init_motion_detector)(
  91          int columns,                   // input parameter. number of columns to split screen into
  92          int rows,                      // input parameter. number of rows to split screen into
  93          int pixel_measure_mode,        // input parameter.
  94                                         // 0 for Y,
  95                                         // 1 for U, - (mx3)not sure if this mode required
  96                                         // 2 for V, - (mx3)not sure if this mode required
  97                                         // 3 for R, - (mx3)not sure if this mode required
  98                                         // 4 for G, - (mx3)not sure if this mode required
  99                                         // 5 for B, - (mx3)not sure if this mode required
 100          int detection_timeout,         // input parameter. number of millisecnds to abort detection.
 101                                         // detected_cells_count will be 0 for timeout condition
 102          int measure_interval,          // input parameter. number of milliseconds between comparison of two pictures
 103          int threshold,                 // input parameter. difference value for which procedure will trigger detection of changes
 104          int draw_grid,                 // bit mask input parameter. 
 105                                         // bit 0 - controls drawing grid(detected sectors/cells) (0=off, 1=on).
 106                                         // bit 1 - controls display of most recent cell difference (0=off, 1=on).
 107 // clipping. allows to exclude some region from motion detection triggering
 108 // or use onli selected area to make motion detection
 109 // I'm not sure that following parameters are required but using them anyway
 110          int clipping_region_mode,      // input parameter.
 111                                         // 0 no clipping regions
 112                                         // 1 - for excluding selected region from motion detection 
 113                                         // 2 - use this only region to make motion detection
 114          int clipping_region_column1,   // input parameter.
 115          int clipping_region_row1,      // input parameter. 
 116                                         // this is top-left corner of clipping region 
 117          int clipping_region_column2,   // input parameter.
 118          int clipping_region_row2,      // input parameter.
 119                                         // this is right bottom corner of clipping region
 120          int parameters,
 121          int pixels_step,
 122          int msecs_before_trigger
 123     );
 124 
 125     int (*md_get_cell_diff)(int column, int row);
 126     void (*md_draw_grid)();
 127     int (*md_get_cell_val)(int column, int row);
 128 
 129 } libmotiondetect_sym;
 130 
 131 //-------------------------------------------------------------------
 132 extern libmotiondetect_sym* libmotiondetect;
 133 extern libmotiondetect_sym* module_mdetect_load();              // 0fail, addr-ok
 134 
 135 #endif
 136 
 137 
 138 
 139 
 140 
 141 
 142  
 143 

/* [<][>][^][v][top][bottom][index][help] */