36 #define PRUNER_ANGLE 2
39 #define ANGLE_SHIFT (0.0)
43 #define MAX_PROTO_INDEX 24
44 #define BITS_PER_WERD static_cast<int>(8 * sizeof(uinT32))
46 #define MAX_NUM_CONFIGS 64
47 #define MAX_NUM_PROTOS 512
48 #define PROTOS_PER_PROTO_SET 64
49 #define MAX_NUM_PROTO_SETS (MAX_NUM_PROTOS / PROTOS_PER_PROTO_SET)
50 #define NUM_PP_PARAMS 3
51 #define NUM_PP_BUCKETS 64
52 #define NUM_CP_BUCKETS 24
53 #define CLASSES_PER_CP 32
54 #define NUM_BITS_PER_CLASS 2
55 #define CLASS_PRUNER_CLASS_MASK (~(~0 << NUM_BITS_PER_CLASS))
56 #define CLASSES_PER_CP_WERD (CLASSES_PER_CP / NUM_BITS_PER_CLASS)
57 #define PROTOS_PER_PP_WERD BITS_PER_WERD
58 #define BITS_PER_CP_VECTOR (CLASSES_PER_CP * NUM_BITS_PER_CLASS)
59 #define MAX_NUM_CLASS_PRUNERS ((MAX_NUM_CLASSES + CLASSES_PER_CP - 1) / \
61 #define WERDS_PER_CP_VECTOR (BITS_PER_CP_VECTOR / BITS_PER_WERD)
62 #define WERDS_PER_PP_VECTOR ((PROTOS_PER_PROTO_SET+BITS_PER_WERD-1)/ \
64 #define WERDS_PER_PP (NUM_PP_PARAMS * NUM_PP_BUCKETS * \
66 #define WERDS_PER_CP (NUM_CP_BUCKETS * NUM_CP_BUCKETS * \
67 NUM_CP_BUCKETS * WERDS_PER_CP_VECTOR)
68 #define WERDS_PER_CONFIG_VEC ((MAX_NUM_CONFIGS + BITS_PER_WERD - 1) / \
132 #define MAX_NUM_INT_FEATURES 512
133 #define INT_CHAR_NORM_RANGE 256
149 tprintf(
"(%d,%d):%d\n", X, Y, Theta);
168 #define MaxNumIntProtosIn(C) (C->NumProtoSets * PROTOS_PER_PROTO_SET)
169 #define SetForProto(P) (P / PROTOS_PER_PROTO_SET)
170 #define IndexForProto(P) (P % PROTOS_PER_PROTO_SET)
171 #define ProtoForProtoId(C,P) (&((C->ProtoSets[SetForProto (P)])-> \
172 Protos [IndexForProto (P)]))
173 #define PPrunerWordIndexFor(I) (((I) % PROTOS_PER_PROTO_SET) / \
175 #define PPrunerBitIndexFor(I) ((I) % PROTOS_PER_PP_WERD)
176 #define PPrunerMaskFor(I) (1 << PPrunerBitIndexFor (I))
178 #define MaxNumClassesIn(T) (T->NumClassPruners * CLASSES_PER_CP)
179 #define LegalClassId(c) ((c) >= 0 && (c) <= MAX_CLASS_ID)
180 #define UnusedClassIdIn(T,c) ((T)->Class[c] == NULL)
181 #define ClassForClassId(T,c) ((T)->Class[c])
182 #define ClassPrunersFor(T) ((T)->ClassPruner)
183 #define CPrunerIdFor(c) ((c) / CLASSES_PER_CP)
184 #define CPrunerFor(T,c) ((T)->ClassPruners[CPrunerIdFor(c)])
185 #define CPrunerWordIndexFor(c) (((c) % CLASSES_PER_CP) / CLASSES_PER_CP_WERD)
186 #define CPrunerBitIndexFor(c) (((c) % CLASSES_PER_CP) % CLASSES_PER_CP_WERD)
187 #define CPrunerMaskFor(L,c) (((L)+1) << CPrunerBitIndexFor (c) * NUM_BITS_PER_CLASS)
190 #define PRINT_MATCH_SUMMARY 0x001
191 #define DISPLAY_FEATURE_MATCHES 0x002
192 #define DISPLAY_PROTO_MATCHES 0x004
193 #define PRINT_FEATURE_MATCHES 0x008
194 #define PRINT_PROTO_MATCHES 0x010
195 #define CLIP_MATCH_EVIDENCE 0x020
197 #define MatchDebuggingOn(D) (D)
198 #define PrintMatchSummaryOn(D) ((D) & PRINT_MATCH_SUMMARY)
199 #define DisplayFeatureMatchesOn(D) ((D) & DISPLAY_FEATURE_MATCHES)
200 #define DisplayProtoMatchesOn(D) ((D) & DISPLAY_PROTO_MATCHES)
201 #define PrintFeatureMatchesOn(D) ((D) & PRINT_FEATURE_MATCHES)
202 #define PrintProtoMatchesOn(D) ((D) & PRINT_PROTO_MATCHES)
203 #define ClipMatchEvidenceOn(D) ((D) & CLIP_MATCH_EVIDENCE)
216 INT_TEMPLATES Templates);
219 INT_CLASS Class,
bool debug);
234 INT_CLASS
NewIntClass(
int MaxNumProtos,
int MaxNumConfigs);
251 #ifndef GRAPHICS_DISABLED
264 #endif // GRAPHICS_DISABLED
INT_CLASS NewIntClass(int MaxNumProtos, int MaxNumConfigs)
void ClearFeatureSpaceWindow(NORM_METHOD norm_method, ScrollView *window)
int AddIntConfig(INT_CLASS Class)
void AddIntClass(INT_TEMPLATES Templates, CLASS_ID ClassId, INT_CLASS Class)
#define WERDS_PER_PP_VECTOR
struct INT_PROTO_STRUCT * INT_PROTO
void free_int_templates(INT_TEMPLATES templates)
uinT32 CONFIG_PRUNER[NUM_PP_PARAMS][NUM_PP_BUCKETS][4]
struct INT_CLASS_STRUCT * INT_CLASS
int AddIntProto(INT_CLASS Class)
void UpdateMatchDisplay()
uinT16 Bucket16For(FLOAT32 param, FLOAT32 offset, int num_buckets)
uinT32 PROTO_PRUNER[NUM_PP_PARAMS][NUM_PP_BUCKETS][WERDS_PER_PP_VECTOR]
void AddProtoToProtoPruner(PROTO Proto, int ProtoId, INT_CLASS Class, bool debug)
INT_TEMPLATES NewIntTemplates()
#define WERDS_PER_CP_VECTOR
#define MAX_NUM_PROTO_SETS
uinT8 Bucket8For(FLOAT32 param, FLOAT32 offset, int num_buckets)
#define MAX_NUM_CLASS_PRUNERS
void DisplayIntFeature(const INT_FEATURE_STRUCT *Feature, FLOAT32 Evidence)
INT_FEATURE_STRUCT INT_FEATURE_ARRAY[MAX_NUM_INT_FEATURES]
#define MAX_NUM_INT_FEATURES
ScrollView * CreateFeatureSpaceWindow(const char *name, int xpos, int ypos)
struct INT_TEMPLATES_STRUCT * INT_TEMPLATES
void DisplayIntProto(INT_CLASS Class, PROTO_ID ProtoId, FLOAT32 Evidence)
void InitProtoDisplayWindowIfReqd()
INT_FEATURE_STRUCT * INT_FEATURE
void ConvertConfig(BIT_VECTOR Config, int ConfigId, INT_CLASS Class)
#define PROTOS_PER_PROTO_SET
void InitIntMatchWindowIfReqd()
void InitFeatureDisplayWindowIfReqd()
uinT8 CircBucketFor(FLOAT32 param, FLOAT32 offset, int num_buckets)
uinT32 p[NUM_CP_BUCKETS][NUM_CP_BUCKETS][NUM_CP_BUCKETS][WERDS_PER_CP_VECTOR]
void RenderIntFeature(ScrollView *window, const INT_FEATURE_STRUCT *Feature, ScrollView::Color color)
void AddProtoToClassPruner(PROTO Proto, CLASS_ID ClassId, INT_TEMPLATES Templates)
#define WERDS_PER_CONFIG_VEC
struct PROTO_SET_STRUCT * PROTO_SET