26 #ifndef __MatchDataBase_hh__
27 #define __MatchDataBase_hh__
29 #include <bias_config.h>
30 #include <Base/Debug/Debug.hh>
31 #include <Base/Geometry/HomgPoint2D.hh>
32 #include <Base/Geometry/HomgPoint3D.hh>
33 #include <Base/Geometry/KMatrix.hh>
34 #include <Base/Geometry/RMatrixBase.hh>
35 #include <Base/Geometry/PMatrixBase.hh>
36 #include <Utils/Param.hh>
38 #define D_MD_IO 0x00000001
57 void GetR(std::vector<RMatrixBase>& R)
const;
60 void GetC(std::vector<HomgPoint3D>& C)
const;
63 void GetP(std::vector<PMatrixBase>& P)
const;
65 void GetPoints(
int imNo, std::vector<HomgPoint2D>& p)
const;
67 void GetPoints(std::vector<std::vector<HomgPoint2D> >& p)
const;
70 void GetCorrespondences(std::vector<std::vector<HomgPoint2D> >& p)
const;
72 void GetNormalizedPoints(
int imNo, std::vector<HomgPoint2D>& p)
const;
74 void GetNormalizedPoints(std::vector<std::vector<HomgPoint2D> >& p)
const;
77 void GetNormalizedCorrespondences(std::vector<std::vector<HomgPoint2D> >& p)
const;
80 void SetData(
KMatrix& K, std::vector<RMatrixBase>& R,
81 std::vector<HomgPoint3D>& C,
82 std::vector<std::vector<HomgPoint2D> >& m);
84 void SetNormalizedData(
KMatrix& K, std::vector<RMatrixBase>& R,
85 std::vector<HomgPoint3D>& C,
86 std::vector<std::vector<HomgPoint2D> >& m);
89 {
return *_NumImages; }
92 int Read(
const std::string& fname);
94 virtual int Read(std::istream& is);
97 int Write(
const std::string& fname)
const;
99 virtual int Write(std::ostream& os)
const;
113 std::vector<RMatrixBase>
_R;
115 std::vector<HomgPoint3D>
_C;
117 std::vector<PMatrixBase>
_P;
121 std::vector<std::vector<HomgPoint2D> >
_Points;
124 void _SetCamData(
KMatrix& K, std::vector<RMatrixBase>& R,
125 std::vector<HomgPoint3D>& C);
128 virtual void _AddParameter(
Param ¶);
130 inline void _Transpose(
const std::vector<std::vector<HomgPoint2D> >& src,
131 std::vector<std::vector<HomgPoint2D> >& dst)
const
133 const int numimg=(int)src.size();
135 const int numpoints=(int)src[0].size();
136 dst.resize(numpoints);
137 for (
int i=0; i<numpoints; i++){
138 dst[i].resize(numimg);
139 for (
int k=0; k<numimg; k++){
148 BIASUtils_EXPORT std::ostream&
operator<<(std::ostream& os,
const MatchDataBase& m);
150 BIASUtils_EXPORT std::istream&
operator>>(std::istream& is, MatchDataBase& m);
157 #endif // __MatchDataBase_hh__
std::vector< std::vector< HomgPoint2D > > _NormalizedPoints
std::vector< PMatrixBase > _P
void _Transpose(const std::vector< std::vector< HomgPoint2D > > &src, std::vector< std::vector< HomgPoint2D > > &dst) const
std::vector< RMatrixBase > _R
class for representing matches, used in GenSynthMatches and biasshowsm
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
describes a projective 3D -> 2D mapping in homogenous coordinates
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
This class Param provides generic support for parameters.
std::vector< HomgPoint3D > _C
std::vector< std::vector< HomgPoint2D > > _Points
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
Implements a 3D rotation matrix.
BIASCommon_EXPORT std::istream & operator>>(std::istream &is, BIAS::TimeStamp &ts)
Standard input operator for TimeStamps.