35 #include "Image/Camera.hh"
36 #include "Base/Image/ImageIO.hh"
42 int main(
int argc,
char *argv[])
53 cam.
Init(640, 480, 1);
58 const std::string format(argv[2]);
59 if (format.compare(
"--daimler") == 0 ||
60 format.compare(
"-daimler") == 0)
70 inert.
Set(1.0, 2.0, 3.14, 4.2, 7.2);
72 gps.
Set(7, 1.5, 2.5, 3.5, 4.5, 5.5);
78 cout <<
"Use --daimler as second argument to use Daimler camera format." << endl;
90 cout <<
"Reading projection from "<<argv[1]<<endl;
103 cout <<endl<<
"added meta data to camera: "<<endl;
109 BIASERR(
"error writing cam.mip");
115 BIASERR(
"error reading cam.mip");
121 cout <<endl<<
"====== now read from mip: \nC:\n" << cam2.
GetC()
122 <<
"\nR:\n"<<cam2.
GetR()<<
"\nK:\n"<<cam2.
GetK()
123 <<
"\nP:\n"<<cam2.
GetP()<<
" Projection: "<< cam2.
GetProj()<<endl;
124 cout <<
"==== PrintAppData() from mip ======="<<endl;
126 cerr <<
"sizeof metadata: "<<cam.
GetMetaData()->size()<<endl;
128 BIASERR(
"error writing cam.pgm");
133 BIASERR(
"error reading cam.pgm");
136 cout <<endl<<
"now read from pgm:"<<endl;
140 cout <<
"My Projection fom pgm: "<< cam3.
GetProj()<<endl;
static int ImportImage(const std::string &filename, ImageBase &result)
Try to load/import an image from a file using external libs.
void SetXYZ(ROTATION_MATRIX_TYPE PhiX, ROTATION_MATRIX_TYPE PhiY, ROTATION_MATRIX_TYPE PhiZ)
Set Euler angles (in rad) in order XYZ.
void Set(double yaw, double yawrateraw, double yawrateoffset, double speed, double steeringangle)
int XMLRead(const std::string &Filename)
derived classes must implement the function XMLIn which is called by this function XMLRead to read ev...
const Vector3< double > & GetC() const
int SetP(const PMatrix &matP)
unsigned int GetWidth() const
int GetDebugLevel() const
void Set(int framenum, double latPos, double longPos, double azimuth, double speed, double distanceToMap)
This class hides the underlying projection model, like projection matrix, spherical camera...
void SetReferenceUUID(const BIAS::UUID &uid)
int SetProj(const Projection &Proj)
void SetDebugLevel(const long int lv)
unsigned int GetHeight() const
void FillImageWithXValue()
fills image with value depending on x coordinate
void SetC(const Vector3< double > &C)
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
void SetInertial(DC_inertial &i)
const BIAS::PMatrix & GetP() const
void Init(unsigned int Width, unsigned int Height, unsigned int channels=1, enum EStorageType storageType=ST_unsignedchar, const bool interleaved=true)
calls Init from ImageBase storageType is ignored, just dummy argument
int UpdateMetaData()
copy P_ and co.
void PrintAppData(std::ostream &os)
see whats in the camera, for debug
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
void Setf(const double &focal)
describes a projective 3D -> 2D mapping in homogenous coordinates
const RMatrix & GetR() const
void SetK(const KMatrix &K)
interface class for producing/storing Universally Unique IDentifiers
const BIAS::Projection & GetProj() const
void SetR(const RMatrix &R)
int ParseMetaData(bool bUse2x64bitTS=true)
After ImageIO::Load() operated on AppData_, this method fills P_, Timestamp, DC_*, ...
static UUID GenerateUUID(const bool &consecutively=DEFAULT_UUID_CONSECUTIVELY)
static function which simply produces a uuid and returns
const KMatrix & GetK() const
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) ...
void SetIdentity()
set the elements of this matrix to the identity matrix (possibly overriding the inherited method) ...