CycloPos Header version 1.0.0
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
cyMatch.h
Go to the documentation of this file.
1//*****************************************************************************
2// File : cyMatch.h
3// Module : CycloPos
4// Description : Definition of a match between two features
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_MATCH_H__
21#define __CY_MATCH_H__
22
23#include "cyBase.h" // CycloPos generic include
24#include "cyFeature.h"
25
26typedef struct {
29 gzBool outlier;
30
31 } MATCH;
32
33// ------------------ cyCoordinate ---------------------------
34
35class cyCoordinate : public gzReference
36{
37public:
38
40
42
43 CY_EXPORT gzUInt32 getIndex();
44
45 CY_EXPORT static gzRefPointer<cyCoordinate> getCoordinate(gzUInt32 index);
46
47
48 //Data
49
50 gzFloat x,y,z;
51
52 gzBool valid;
53
54private:
55
56 gzUInt32 m_index;
57
58 static gzDynamicArray<cyCoordinate *> s_coordinates;
59 static gzMutex s_lock;
60};
61
62GZ_DECLARE_REFPTR(cyCoordinate);
63
64// ------------------ cyMatch --------------------------------
65
66class cyMatch : public gzReference
67{
68 friend class cyFeature;
69 friend class cyCamera;
70
71public:
72
74
76
77 // -------- Debug ---------------------------
78
80
81 CY_EXPORT gzVoid setOutlier(gzUInt32 index,gzBool outlier,gzUInt32 count=1);
82 CY_EXPORT gzVoid resetOutliers(gzBool value);
83 CY_EXPORT gzVoid swapOutliers(gzUInt32 indexA,gzUInt32 indexB);
84
85 CY_EXPORT gzFloat estimateOutliers(gzUInt32 min_inliers=CY_DEFAULT_RANSAC_OUTLIER_INLIERS,gzUInt32 iterations=CY_DEFAULT_RANSAC_OUTLIER_ITERATIONS,gzFloat reqMaxError=0,gzFloat outlier_mag=CY_DEFAULT_RANSAC_OUTLIER_MAG,gzBool onlyRansacSet=FALSE);
86 CY_EXPORT gzFloat estimateInfiniteHomographyOutliers(gzUInt32 min_inliers=CY_DEFAULT_RANSAC_OUTLIER_INLIERS,gzUInt32 iterations=CY_DEFAULT_RANSAC_OUTLIER_ITERATIONS,gzFloat reqMaxError=0,gzFloat outlier_mag=CY_DEFAULT_RANSAC_OUTLIER_MAG,gzFloat xc=0,gzFloat yc=0,KVals k=KVals(),gzBool taylor=FALSE);
87 CY_EXPORT gzFloat removeOutliers(gzUInt32 min_inliers,gzFloat reqMaxError);
88 CY_EXPORT gzFloat recursiveRemoveOutliers(gzUInt32 min_inliers=CY_DEFAULT_RANSAC_OUTLIER_INLIERS,gzUInt32 iterations=CY_DEFAULT_RANSAC_OUTLIER_ITERATIONS,gzFloat reqMaxError=0);
89
90 CY_EXPORT gzMatrixf calculateF();
91 CY_EXPORT gzMatrixf calculateH(gzFloat xc=0,gzFloat yc=0,KVals k=KVals(),gzBool taylor=FALSE);
92 CY_EXPORT gzBool calculateP(const gzMatrixf &K0, const gzMatrixf &K1 , gzMatrixf &Pp);
94
95 CY_EXPORT gzBool getBestMatchPositions(gzVectorf &posA_1,gzVectorf &posB_1,gzVectorf &posA_2,gzVectorf &posB_2,gzVectorf &posA_3,gzVectorf &posB_3);
96
98
99 CY_EXPORT gzVoid normalize(gzBool yes);
100
101 CY_EXPORT gzBool isOutlier(gzUInt32 index);
102
103 CY_EXPORT gzFloatXY getNormCoordA(gzUInt32 index);
104 CY_EXPORT gzFloatXY getNormCoordB(gzUInt32 index);
105
106 // -------- Properties ----------------------
107
108 GZ_PROPERTY_GET_EXPORT(cyFeaturePtr, FeatureA, CY_EXPORT);
109 GZ_PROPERTY_GET_EXPORT(cyFeaturePtr, FeatureB, CY_EXPORT);
110
111 GZ_PROPERTY_GET_EXPORT(gzUInt32, Count, CY_EXPORT);
112 GZ_PROPERTY_GET_EXPORT(gzUInt32, Outliers, CY_EXPORT);
113
114 GZ_PROPERTY_GET_EXPORT(gzFloat, MeanOrientationDiff, CY_EXPORT);
115 GZ_PROPERTY_GET_EXPORT(gzFloat, StdDevOrientationDiff, CY_EXPORT);
116
117private:
118
119 MATCH *m_matches;
120
121 gzRefList<cyCoordinate> m_coordinates;
122};
123
124GZ_DECLARE_REFPTR(cyMatch);
125
126
127#endif // __CY_MATCH_H__
128
129
130
131
132
133
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
gzUInt32 getIndex()
gzFloat y
Definition cyMatch.h:50
gzBool valid
Definition cyMatch.h:52
gzFloat z
Definition cyMatch.h:50
virtual ~cyCoordinate()
gzFloat x
Definition cyMatch.h:50
static gzRefPointer< cyCoordinate > getCoordinate(gzUInt32 index)
gzFloatXY getNormCoordA(gzUInt32 index)
gzVoid calculateDominantOrientation()
gzBool isOutlier(gzUInt32 index)
gzVoid setOutlier(gzUInt32 index, gzBool outlier, gzUInt32 count=1)
gzBool getBestMatchPositions(gzVectorf &posA_1, gzVectorf &posB_1, gzVectorf &posA_2, gzVectorf &posB_2, gzVectorf &posA_3, gzVectorf &posB_3)
gzVoid resetOutliers(gzBool value)
gzMatrixf calculateH(gzFloat xc=0, gzFloat yc=0, KVals k=KVals(), gzBool taylor=FALSE)
gzFloat removeOutliers(gzUInt32 min_inliers, gzFloat reqMaxError)
gzVoid swapOutliers(gzUInt32 indexA, gzUInt32 indexB)
gzFloat estimateOutliers(gzUInt32 min_inliers=CY_DEFAULT_RANSAC_OUTLIER_INLIERS, gzUInt32 iterations=CY_DEFAULT_RANSAC_OUTLIER_ITERATIONS, gzFloat reqMaxError=0, gzFloat outlier_mag=CY_DEFAULT_RANSAC_OUTLIER_MAG, gzBool onlyRansacSet=FALSE)
gzVoid normalize(gzBool yes)
gzFloat estimateInfiniteHomographyOutliers(gzUInt32 min_inliers=CY_DEFAULT_RANSAC_OUTLIER_INLIERS, gzUInt32 iterations=CY_DEFAULT_RANSAC_OUTLIER_ITERATIONS, gzFloat reqMaxError=0, gzFloat outlier_mag=CY_DEFAULT_RANSAC_OUTLIER_MAG, gzFloat xc=0, gzFloat yc=0, KVals k=KVals(), gzBool taylor=FALSE)
virtual gzVoid debug(cyDebugFlags flags=CY_DEBUG_DEFAULT)
gzFloat recursiveRemoveOutliers(gzUInt32 min_inliers=CY_DEFAULT_RANSAC_OUTLIER_INLIERS, gzUInt32 iterations=CY_DEFAULT_RANSAC_OUTLIER_ITERATIONS, gzFloat reqMaxError=0)
gzVoid createMatchedCoordinates()
friend class cyCamera
Definition cyMatch.h:69
virtual ~cyMatch()
gzBool calculateP(const gzMatrixf &K0, const gzMatrixf &K1, gzMatrixf &Pp)
gzMatrixf calculateF()
friend class cyFeature
Definition cyMatch.h:68
gzFloatXY getNormCoordB(gzUInt32 index)
Basic include for all CycloPos files. Defines export structures and basic flags and builtin compiled ...
#define CY_EXPORT
Export control of dll functions.
Definition cyBase.h:50
cyDebugFlags
Definition cyBase.h:161
@ CY_DEBUG_DEFAULT
Definition cyBase.h:162
#define CY_DEFAULT_RANSAC_OUTLIER_MAG
Definition cyFeature.h:33
#define CY_DEFAULT_RANSAC_OUTLIER_ITERATIONS
Definition cyFeature.h:34
#define CY_DEFAULT_RANSAC_OUTLIER_INLIERS
Definition cyFeature.h:35
gzUInt32 descriptorIndexB
Definition cyMatch.h:28
gzBool outlier
Definition cyMatch.h:29
gzUInt32 descriptorIndexA
Definition cyMatch.h:27