26 #ifndef __GENERATE_GROUND_TRUTH_HH__
27 #define __GENERATE_GROUND_TRUTH_HH__
29 #include <Base/Common/BIASpragmaStart.hh>
31 #include <Geometry/PMatrix.hh>
32 #include <Base/Geometry/KMatrix.hh>
33 #include <Base/Geometry/HomgPoint2D.hh>
34 #include <Base/Geometry/HomgPoint3D.hh>
35 #include <Base/Image/Image.hh>
46 static void NormalizeMatches(std::vector<BIAS::HomgPoint2D>& match1,
47 std::vector<BIAS::HomgPoint2D>& match2,
52 static void DeNormalizeMatches(std::vector<BIAS::HomgPoint2D>& match1,
53 std::vector<BIAS::HomgPoint2D>& match2,
60 std::vector<BIAS::HomgPoint2D>& match1,
61 std::vector<BIAS::HomgPoint2D>& match2,
62 unsigned char lcolor,
unsigned char mcolor);
68 static void CreateIdealMatches(std::vector<BIAS::PMatrix>& pvec,
unsigned num,
69 unsigned width,
unsigned height,
70 std::vector<std::vector<BIAS::HomgPoint2D> >&
72 std::vector<BIAS::HomgPoint3D>& points,
73 double minx=-50.0,
double maxx=50.0,
74 double miny=-50.0,
double maxy=50.0,
75 double minz=-50.0,
double maxz=50.0);
85 static void CreateMatches(std::vector<BIAS::PMatrix>& pvec,
unsigned num,
86 unsigned width,
unsigned height,
double spatial_noise,
87 std::vector<std::vector<BIAS::HomgPoint2D> >& i_matches,
88 std::vector<std::vector<BIAS::HomgPoint2D> >& n_matches,
89 std::vector<BIAS::HomgPoint3D>& points,
90 double minx=-50.0,
double maxx=50.0,
91 double miny=-50.0,
double maxy=50.0,
92 double minz=-50.0,
double maxz=50.0);
106 static void CreateMatches(std::vector<BIAS::PMatrix>& pvec,
107 std::vector<BIAS::PMatrix>& n_pvec,
unsigned num,
108 unsigned width,
unsigned height,
double spatial_noise,
109 double r_noise,
double c_noise,
110 std::vector<std::vector<BIAS::HomgPoint2D> >& i_matches,
111 std::vector<std::vector<BIAS::HomgPoint2D> >& n_matches,
112 std::vector<BIAS::HomgPoint3D>& points,
113 double minx=-50.0,
double maxx=50.0,
114 double miny=-50.0,
double maxy=50.0,
115 double minz=-50.0,
double maxz=50.0,
bool print=
false);
133 CreateMatchesOutlier(std::vector<BIAS::PMatrix>& pvec,
134 std::vector<BIAS::PMatrix>& n_pvec,
unsigned num,
135 unsigned width,
unsigned height,
double spatial_noise,
136 double r_noise,
double c_noise,
double outlier_fraction,
137 std::vector<std::vector<BIAS::HomgPoint2D> >& i_matches,
138 std::vector<std::vector<BIAS::HomgPoint2D> >& n_matches,
139 std::vector<BIAS::HomgPoint3D>& points,
140 double minx=-50.0,
double maxx=50.0,
141 double miny=-50.0,
double maxy=50.0,
142 double minz=-50.0,
double maxz=50.0,
156 static void GenerateRandomPlane(std::vector<BIAS::HomgPoint3D> &Points,
158 double aX=-50.0,
double aY=-50.0,
double aZ=0.0,
159 double alphaX=1.0,
double alphaY=0.0,
double alphaZ=0.0,
160 double betaX=0.0,
double betaY=1.0,
double betaZ=0.0,
161 double alphamax=100.0,
162 double betamax=100.0);
174 static void GenerateRandomCube(std::vector<BIAS::HomgPoint3D> &Points,
176 double aX=-50.0,
double aY=-50.0,
double aZ=-50.0,
177 double alphaX=1.0,
double alphaY=0.0,
double alphaZ=0.0,
178 double betaX=0.0,
double betaY=1.0,
double betaZ=0.0,
179 double gammaX=0.0,
double gammaY=0.0,
double gammaZ=1.0,
180 double alphamax=100.0,
181 double betamax=100.0,
182 double gammamax=100.0);
184 static int ReadCorrespondences(
const char *Filename,
185 std::vector<BIAS::HomgPoint2D> &Points1,
186 std::vector<BIAS::HomgPoint2D> &Points2);
192 static int WriteCorrespondences(
const char *Filename,
193 std::vector<BIAS::HomgPoint2D> &Points1,
194 std::vector<BIAS::HomgPoint2D> &Points2);
199 static int ReadWorldPoints(
const char *Filename,
200 std::vector<BIAS::HomgPoint3D> & Points );
206 static int WriteWorldPoints(
const char *Filename,
207 std::vector<BIAS::HomgPoint3D> & Points );
213 #include <Base/Common/BIASpragmaEnd.hh>
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).