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

📄 utils.h

📁 机器人处理中使用USB摄像机的例子程序.
💻 H
字号:
// Utils.h: define structures and constants needed for the application
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_UTILS_H__62E8CE80_9172_11D3_95F1_00600895DAA5__INCLUDED_)
#define AFX_UTILS_H__62E8CE80_9172_11D3_95F1_00600895DAA5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


//* Define bitmap types and filters
static char BASED_CODE szFilterLog[] = "Data Base Files (*.dat)|*.dat|All Files (*.*)|*.*||";

#define APPNAME			  "Video Tools"
#define NEW_FILE_NAME     "New Image	"
#define PICTURE_DIR		  "\\Pictures\\"
#define DBASE_DIR		  "\\Data\\"
#define STRING_BMP_FILTER "*.bmp"
#define STRING_BMP_EXT ".bmp"
#define FILE_EXT		"*.dat"
#define RGB_3BYTES     3
#define MAX_HUE		   255
#define MODE_NOT_OVERLAP	   0
#define MODE_OVERLAP		   1
#define MODE_USE_HUE		   2

#define WIDTH_OF_ONE_FRAME			320
//#define ROBOT_ANGLE_FULL_FRAME		-444
#define TAKE_FROM_LAST_FRAME		10
#define	NR_FRAMES					12
#define ROBOT_ANGLE_MARGIN  		-307  // -330
#define MARGIN						50	  // 40	

//* Define usefull macros
#define DEBUG_INT(in) {CString str; str.Format ("%i",in); AfxMessageBox (str);}
#define DEBUG_UINT(in) {CString str; str.Format ("%u",in); AfxMessageBox (str);}
#define DEBUG_CHAR(in) {CString str; str.Format ("%c",in); AfxMessageBox (str);}
#define DEBUG_FLOAT(in) {CString str; str.Format ("%f",in); AfxMessageBox (str);}
#define NOT_ENOUGH_MEM(in) {CString str; str.Format ("Not enough memory for %s",in); AfxMessageBox (str); exit (0);}
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MIN3(n1,n2,n3) ((n2<n1)?((n3<n2) ? n3 : n2) : ((n3<n1) ? n3 : n1))
#define MAX3(n1,n2,n3) ((n2>n1)?((n3>n2) ? n3 : n2) : ((n3>n1) ? n3 : n1))
#define BTOSTR(in) ((in==0)?("False"):("True"))

//* Define features structures
#define FVERTICAL_EDGE  'v'
#define COL0_FEATURE	'A'
#define NO_COL_FEATURES	 1   // number of features that are not color features

typedef char TFeature;

typedef struct _ACell		 // element that represent a feature
{
	TFeature Feature;
	long     Pos;
} ACell;

typedef struct _DCell		 // element of the dynamic chain
{
	TFeature Feature;
	long     Pos;
	struct _DCell *next;
} DCell;

typedef struct _GCode		 // structure that include the dynamic chain
{
	DCell   *pHead;
	DCell   *pEnd;
	int 	Size;
} GCode;


typedef struct _PieSlice	 // color definition
{
	short HueFrom;
	short HueMiddle;
	short HueTo;
	COLORREF ColRef;
	int    *ColorHist;
	short  *BinaryHist;
	int   MaxHistVal;
} PieSlice;

typedef unsigned short TShort;

typedef struct _SortStruct
{
	float  	SortVal;
	int		Index;
} SortStruct;

typedef struct _DBaseElement
{
	ACell	*pACell;
	int		nSize;
	CString	*Room;
	CString	*Place;
	float	MatchVal;
} DBaseElement;

typedef struct _DBase
{
	DBaseElement	*pElement;
	short			nColors;
	int				nStrings;
} DBase;
	
typedef struct _MatrixF
{
	float **element;
	short nLig;
	short nCol;
} MatrixF;

typedef struct _MatrixS
{
	TShort **element;
	short nLig;
	short nCol;
} MatrixS;

//* Others
typedef short MATRIX_1X3[3];
typedef short MATRIX_3X3[3][3];

typedef struct _Signal
{
	long	from;		// first index of signal
	long	to;			// last index of signal
	long	*signal;
} Signal;

#endif // !defined(AFX_UTILS_H__62E8CE80_9172_11D3_95F1_00600895DAA5__INCLUDED_)

⌨️ 快捷键说明

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