CycloPos Header version 1.0.0
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
cyBase.h
Go to the documentation of this file.
1//*****************************************************************************
2// File : cyBase.h
3// Module : CycloPos
4// Description : Generic settings of the CycloPos library
5// Author : Anders Modén
6// Product : CycloPos 1.0.0
7//
8// Copyright © 2011- ToolTech Software, Sweden
9//
10// NOTE: CycloPos is a generic VR and Tool positioning library for a mono camera
11//
12//
13// Revision History...
14//
15// Who Date Description
16//
17// AMO 110901 Created file
18//
19//******************************************************************************
20#ifndef __CY_BASE_H__
21#define __CY_BASE_H__
22
31
32#include "gzBaseLibrary.h" // GizmoBase generic include
33#include "cyVersion.h" // Version info
34
35// ------------------- Generic platform settings -------------------------------------------------------------------------
36
37#ifdef GZ_WINDOWS
38 #ifndef GZ_STATIC // Default to use all Gizmo dlls
39 #define CY_DLL // Define GZ_STATIC to use static libs
40 #endif
41#endif // GZ_WINDOWS
42
43#ifdef CY_DLL //cyclopos.dll
44 #ifdef CY_EXPORTS
45 #define CY_EXPORT __declspec(dllexport)
46 #else
47 #define CY_EXPORT __declspec(dllimport)
48 #endif
49#else
50 #define CY_EXPORT
51#endif
52
53// ------------------- Some settings and constants ----------------
54
55// Precompiled configurations
56
57//#define FEATURE_LEVEL_MIN //!< Minumum (FAST) level of feature extraction details
58//#define FEATURE_LEVEL_MID //!< Medium level of feature extraction details
59#define FEATURE_LEVEL_MAX
60
61#if defined FEATURE_LEVEL_MIN
62
63 // 2x2 x 4 desc samples = 16
64
65 #define FEATURE_COUNT 16
66
67 #define MAXDIM 4
68 #define LEVEL_DEPTH 3
69
70#elif defined FEATURE_LEVEL_MID
71
72 // 3x3 x 4 desc samples = 36
73
74 #define FEATURE_COUNT 36
75
76 #define MAXDIM 4
77 #define LEVEL_DEPTH 3
78
79#elif defined FEATURE_LEVEL_MAX
80
81 // 4x4 x 4 desc samples = 64
82
83 #define FEATURE_COUNT 64
84
85 #define MAXDIM 8
86 #define LEVEL_DEPTH 3
87
88#endif
89
90// ----------------------- Generic settings --------------------
91
92#define CY_DEFAULT_MAX_OUTLIER_DIST 10.0f
93#define CY_DEFAULT_RANSAC_MAX_ITERATIONS 1000
94#define CY_DEFAULT_MIN_PIXEL_DIST 2.0f
95
96#define CY_REQUIRED_INLIERS_FOR_RANSAC 16
97
98
99// --------------------- Some custom types ---------------------
100
101typedef struct {
102 gzInt32 x, y;
103
104 } XY;
105
106typedef struct {
107 gzFloat x, y;
108
109 } XY_f;
110
112{
113public:
114
115 gzFloat scale;
116 gzFloat orientation;
117 gzArray<gzFloat> descriptor;
118 gzUInt32 bits;
119 gzUInt32 xy_index;
120 gzUInt32 compare;
121
122};
123
124class KVals
125{
126public:
127
128 KVals(gzFloat _k1=0,gzFloat _k2=0,gzFloat _k3=0,gzFloat _k4=0,gzFloat _k5=0,gzFloat _k6=1,gzFloat _k7=0)
129 {
130 k1=_k1;
131 k2=_k2;
132 k3=_k3;
133 k4=_k4;
134 k5=_k5;
135 k6=_k6;
136 k7=_k7;
137 }
138
139 gzFloat & operator[](gzUInt32 index)
140 {
141 if(index>=7)
142 gzThrowFatal("Index out of bounds");
143
144 return *(&k1+index);
145 }
146
147 gzFloat k1,k2,k3,k4,k5,k6,k7;
148};
149
151{
152public:
153
154 GZ_PROPERTY_EXPORT(gzFloat, Mean, CY_EXPORT);
155 GZ_PROPERTY_EXPORT(gzFloat, StdDev, CY_EXPORT);
156};
157
158// -------- Debug flags ---------------
159
166
168
169
170#endif // __CY_BASE_H__
gzFloat & operator[](gzUInt32 index)
Definition cyBase.h:139
gzFloat k3
Definition cyBase.h:147
gzFloat k4
Definition cyBase.h:147
gzFloat k6
Definition cyBase.h:147
gzFloat k7
Definition cyBase.h:147
KVals(gzFloat _k1=0, gzFloat _k2=0, gzFloat _k3=0, gzFloat _k4=0, gzFloat _k5=0, gzFloat _k6=1, gzFloat _k7=0)
Definition cyBase.h:128
gzFloat k1
Definition cyBase.h:147
gzFloat k2
Definition cyBase.h:147
gzFloat k5
Definition cyBase.h:147
gzFloat scale
Scale used for Wavelet Descriptor.
Definition cyBase.h:115
gzUInt32 xy_index
point index
Definition cyBase.h:119
gzUInt32 bits
Bitcount for binary descriptors.
Definition cyBase.h:118
gzUInt32 compare
if part in a compare situation
Definition cyBase.h:120
gzFloat orientation
Major orientation axis direction.
Definition cyBase.h:116
gzArray< gzFloat > descriptor
Actual data.
Definition cyBase.h:117
#define CY_EXPORT
Export control of dll functions.
Definition cyBase.h:50
GZ_USE_BIT_LOGIC(cyDebugFlags)
cyDebugFlags
Definition cyBase.h:161
@ CY_DEBUG_HEADER_ONLY
Definition cyBase.h:164
@ CY_DEBUG_DUMP_XML
Definition cyBase.h:163
@ CY_DEBUG_DEFAULT
Definition cyBase.h:162
Definition cyBase.h:106
gzFloat y
Definition cyBase.h:107
gzFloat x
Definition cyBase.h:107
Definition cyBase.h:101
gzInt32 y
Definition cyBase.h:102
gzInt32 x
Definition cyBase.h:102