www.pudn.com > imageFeatures_Ver3_0_source.zip > quad_dis.h


// quad_dis.h 
// Miscellaneous constants from 1994 version 
 
/* 
** Copyright (C) 1994, 2003 Tyler C. Folsom 
** 
** Permission to use, copy, modify, and distribute this software and its 
** documentation for any purpose and without fee is hereby granted, provided 
** that the above copyright notice appear in all copies and that both that 
** copyright notice and this permission notice appear in supporting 
** documentation.  This software is provided "as is" without express or 
** implied warranty. 
*/ 
#define FL_ABS(x) ((x)>(float)0.0?(x):-(x)) 
 
#define PI 3.1415926536 
#define PI_HALF  1.570796327 
#define PI_1 ((float)3.141592654) 
#define PI8TH (PI_1/8) 
#define PI_2 ((float)6.283185307) 
#define PI_3  9.424777961 
#define EPSILON ((float)1.0e-6) 
#define ROOT_2 ((float)1.414213562) 
#define ROOT_3 ((float)1.732050808) 
#define MAX_ITER 30 
 
// Debug flag to write stuff to trace.txt 
// #define TRACE_ME 1 
 
/* Number of orientations for odd filters (4 or 2) */ 
const ODD_ANGLES = 2; 
 
/* Default value for m_subSampleDiam.  Use this to control whether subsampling happens */ 
const DEFAULT_SUBSAMPLE_DIAM = 200; 
 
/* PRE_THRESH has no effect if it is 1.0.   
   When less than 1, it provides a lower threshold for features on the first pass. 
   Features that fail the threshold initially may pass with help from lateral facilitation. 
*/ 
const float PRE_THRESH = 0.25; 
 
/* Default value for m_lateralFactor.  0 for no lateral antagonism, 1.0 for max */ 
const float DEFAULT_LATERAL = 0.5; 
 
/* A corner is characterized by a step in the dominant orientation and 
   a bar or edge perpendicular to this.  Typically, the bar strength is half as 
   strong as the step.  Classify a feature as a corner if the ratio of the 
   squared magnitudes exceeds this threshold. 
*/ 
#define CORNER_THRESH ((float)0.16) 
 
/* A blob consists of bars of the same color in both the dominant and 
   perpendicular directions.  These should have similar magnitudes. 
   Clssify a blob if this (squared) threshold is passed.  
*/ 
#define BLOB_THRESH  ((float)0.36) 
 
/* specifies range over which bump function is non-zero */ 
#define LIM_SQ ((float) 0.203636) 
 
/* specifies effective range for even and odd filters */ 
#define EFF_LIM ((float) 0.35) 
 
/* discard a signal if it has rolled off by more than this */ 
#define MIN_ROLL_OFF ((float) 0.02) 
 
#define STRENGTH_SCALE ((float) 15.03) 
 
 
typedef unsigned char PIXEL; 
 
/* color for an edge */ 
#define GRID_COLOR ((COLORREF) 0x00FF00) // green 
#define EDGE_COLOR ((COLORREF) 0x0000FF) // red 
#define DARK_BAR_COLOR ((COLORREF) 0xFF0000) // blue 
#define LIGHT_BAR_COLOR ((COLORREF) 0x00FFFF) // yellow 
#define CORNER_COLOR ((COLORREF) 0x00AFFF) // orange 
#define CURVE_COLOR ((COLORREF) 0xFFFF00) // magenta 
#define MAX_PIXEL 255 
#define MIN_PIXEL 0 
//#define FULL_BLACK MIN_PIXEL  
//#define FULL_WHITE MAX_PIXEL 
#define MEDIUM_GRAY ((MAX_PIXEL + MIN_PIXEL) / 2)