34 #include <Geometry/ProjectionParametersProjective.hh>
39 int main(
int argc,
char *argv[])
45 R.
SetXYZ(30.0 / 180.0 * M_PI, 10.0 / 180.0 * M_PI, 20.0 / 180.0 * M_PI);
54 cout <<
"using P Matrix " << P << endl;
60 cout <<
"retrieving C " << ppp.
GetC() << endl;
62 cout <<
"ostream after setting from P : ppp " << ppp << endl;
65 string fname =
"ProjParProjExample01.xml";
71 cerr <<
"error reading "<< fname << endl;
76 cout <<
"ostream after xml read ppp " << ppp << endl;
81 cout <<
"copy constructor " << pppc << endl;
91 cout <<
"orig 3D point " << point3D <<
" project/unproject " << point3DNew << endl;
98 cout <<
"point2D by Project method " << point2D1 << endl;
99 point2D1 = ppp.
GetP() * point3D1;
101 cout <<
"point2D by P projection " << point2D1 << endl;
void SetP(const Matrix3x4< double > &P)
set 12 entries if projective P using a PMatrix
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
void SetXYZ(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY, ROTATION_MATRIX_TYPE PhiZ)
Set Euler angles (in rad) in order XYZ.
int XMLRead(const std::string &Filename)
derived classes must implement the function XMLIn which is called by this function XMLRead to read ev...
virtual Vector3< double > GetC() const
get projection center
virtual HomgPoint3D UnProjectToPoint(const HomgPoint2D &pos, double depth, bool IgnoreDistortion=false) const
calculates a 3D point in the global (not the rig) coordinate system, which belongs to the image posit...
virtual void SetImageSize(const unsigned int w, const unsigned int h)
Set image dimensions (in pixels).
HomgPoint2D & Homogenize()
homogenize class data member elements to W==1 by divison by W
void Homogenize()
homogenize class data member elements to W==1 by divison by W
int XMLWrite(const std::string &Filename, int CompressionLevel=0, bool AutoAddCompressionSuffix=true, std::string encoding="UTF-8") const
call this to add the class to a new xml tree and write it to the file Filename.
12 parametric p for completely projective reconstruction scenarios, unknown focal lengths...
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
virtual PMatrix GetP() const
return the complete pmatrix (internals+externals / projective) used for projection ...
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
describes a projective 3D -> 2D mapping in homogenous coordinates
void Compose(const Matrix3x3< double > &K, const Matrix3x3< double > &R, const Vector3< double > &C)
composes this from K, R and C using P = [ K R' | -K R' C ] with R' = transpose(R) ...
HomgPoint2D Project(const HomgPoint3D &X, bool IgnoreDistortion=false) const
calculates the projection of a point in the world coordinate system to a pixel in the image plane of ...
class BIASGeometryBase_EXPORT HomgPoint3D