⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmv_types.h

📁 linux下的视频捕捉和处理CMVision2.0-beta1.rar
💻 H
字号:
/*=========================================================================    cmv_types.h  -------------------------------------------------------------------------    Basic types used by CMVision  -------------------------------------------------------------------------    Copyright 2001, 2002    James R. Bruce (jbruce <at> cs.cmu.edu)    School of Computer Science    Carnegie Mellon University  -------------------------------------------------------------------------    This source code is distributed "as is" with absolutely no warranty.    It is covered under the GNU General Public Licence, Version 2.0;    See COPYING, which should be included with this distribution.  -------------------------------------------------------------------------    Revision History:  =========================================================================*/#ifndef __CMVISION_TYPES_H__#define __CMVISION_TYPES_H__namespace CMVision{// uncomment if your compiler supports the "restrict" keyword// #define restrict __restrict__#define restricttemplate <class pixel>class image{public:  pixel *buf;  int width,height,pitch;};#define CMV_PARAM <class pixel,class vimage,class threshold>#define CMV_TEM template CMV_PARAM#define CMV_NONE ((unsigned)(-1))/*// Options for level of processing//   use enable()/disable() to change #define CMV_THRESHOLD      0x01#define CMV_COLOR_AVERAGES 0x02#define CMV_DUAL_THRESHOLD 0x04#define CMV_DENSITY_MERGE  0x08#define CMV_VALID_OPTIONS  0x0F*/template <class cclass>class run{public:  short x,y,width;    // location and width of run  cclass color;       // which color(s) this run represents  int parent,next;    // parent run and next run in run list};template <class cclass>class run_mini{public:  short x,y,width;    // location and width of run  cclass color;       // which color(s) this run represents  short parent,next;  // parent run and next run in run list};struct region{  int color;         // id of the color  int x1,y1,x2,y2;   // bounding box (x1,y1) - (x2,y2)  float cen_x,cen_y; // centroid  int area;          // occupied area in pixels  int run_start;     // first run index for this region  int iterator_id;   // id to prevent duplicate hits by an iterator  region *next;      // next region in list};struct region_small{  short color;       // id of the color  short x1,y1,x2,y2; // bounding box (x1,y1) - (x2,y2)  short iterator_id; // id to prevent duplicate hits by an iterator  float cen_x,cen_y; // centroid  int area;          // occupied area in pixels  int run_start;     // first run index for this region  region *next;      // next region in list};struct region_tiny{  uchar color;       // id of the color  uchar x1,y1,x2,y2; // bounding box (x1,y1) - (x2,y2)  float cen_x,cen_y; // centroid  short area;        // occupied area in pixels  short run_start;   // first run index for this region  short iterator_id; // id to prevent duplicate hits by an iterator  region *next;      // next region in list};struct color_class_state{  region *list;      // head of region list for this color  int num;           // number of regions of this color  int min_area;      // minimum area for a meaningful region  rgb color;         // example color (such as used in test output)  char *name;        // color's meaningful name (e.g. orange ball, goal)};} // namespace#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -