Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Attributes | Friends | List of all members
BIAS::Projection Class Reference

This class hides the underlying projection model, like projection matrix, spherical camera, lens distortion. More...

#include <Geometry/Projection.hh>

+ Inheritance diagram for BIAS::Projection:
+ Collaboration diagram for BIAS::Projection:

Public Member Functions

void AddAbsoluteCamera (ProjectionParametersBase *ppb)
 Add a camera to the projection,the coordinates of the pose are given in absolute Coordinates, they are transformed to relative coordinates to the first camera internally. More...
 
void AddRelativeCamera (ProjectionParametersBase *ppb)
 Add a camera to the projection,the coordinates of the pose are given in relative Coordinates, first cam is origin. More...
 
void Clear ()
 Delete all ProjectionParameterBase objects contained in Projection. More...
 
void CreatePerspective (const BIAS::Pose &pose, const BIAS::KMatrix &K, int width, int height, BIAS_ProjParaPersp_DISTORTION_TYPE radDistType=DISTYPE_DEF, const std::vector< double > &UndistortionCoefficients=std::vector< double >(4, 0.0))
 Create a perspective camera and add to projection. More...
 
void CreateSpherical (const Pose &pose, const unsigned int width, const int height, const double principalX, const double principalY, const double radius, const double aspect=1.0)
 push_back a new sperical cam to this More...
 
virtual bool DoesPointProjectIntoImage (const BIAS::HomgPoint3D &X, BIAS::HomgPoint2D &x, unsigned int cam=0, bool IgnoreDistortion=false) const
 Checks if 3D point projects into specified image and returns belonging 2D image point. More...
 
virtual const bool DoExtrinsicsDiffer (const BIAS::Projection &p) const
 Checks whether extrinsic parameters are different. More...
 
virtual const bool DoIntrinsicsDiffer (const BIAS::Projection &p) const
 Checks whether intrinsic parameters are different. More...
 
Vector3< double > GetAbsoluteC (unsigned int cam=0) const
 Return center of camera with index cam. More...
 
Quaternion< double > GetAbsoluteQ (unsigned int cam=0) const
 return rotation quaternion of camera with index cam. More...
 
RMatrix GetAbsoluteR (unsigned int cam=0) const
 return RMatrix of camera with index cam. More...
 
Vector3< double > GetC (unsigned int cam=0) const
 return Center of camera with index cam. More...
 
virtual Matrix< double > GetCov (unsigned int cam=0) const
 Get the Pose covariance. More...
 
Matrix3x4< double > GetExternals (unsigned int cam=0) const
 Obtain the external camera parameters. More...
 
std::string GetIdentifier () const
 Return the identifier of the Projection such as a name. More...
 
ProjectionParametersBaseGetParameterCloneWithAbsolutePose (unsigned int cam=0) const
 Allocates memory for parameters base type and returns pointer to it! More...
 
const ProjectionParametersBaseGetParameters (unsigned int cam=0) const
 const parameter access function More...
 
ProjectionParametersBaseGetParameters (unsigned int cam=0)
 Non-const access function to parameters. More...
 
virtual const PoseGetPose (unsigned int cam=0) const
 return complete pose object. More...
 
BIAS::Quaternion< double > GetQ (unsigned int cam=0) const
 return rotation quaternion of camera with index cam if cam>0 this is a relative pose in the coordinate system of cam 0 More...
 
RMatrix GetR (unsigned int cam=0) const
 return RMatrix of camera with index cam. More...
 
int InitFromCameraData (const std::vector< CameraData > &vcd)
 initializes projection from cameradata object More...
 
bool IsEmpty () const
 Determine whether the Projection is Empty. More...
 
virtual int Load (const std::string &filename)
 convenience wrapper which tries to read different formats More...
 
const Projectionoperator= (const Projection &p)
 operator= More...
 
bool PoseValid (unsigned int cam=0) const
 Determine whether the pose is valid or not. More...
 
virtual HomgPoint2D Project (const HomgPoint3D &X, unsigned int cam=0, bool IgnoreDistortion=false) const
 returns the 2d projection of X in camera cam, where X is given in the global coordinate frame (not the rig) (needs HomgPoint3D to map points at infinity) More...
 
 Projection ()
 constructor More...
 
 Projection (const Projection &p)
 copy constructor More...
 
 Projection (const ProjectionParametersBase &p)
 constructor for initialization with a ProjectionParametersBase object More...
 
int ReadFromBBC (const std::string &filename, const bool silent=false)
 read BBC's FreeD data from file and constructs a perspective projection (may have radial distortion) More...
 
int ReadFromCamParamFile (const std::string &filename, const bool silent=false)
 Reads a camera data XML file and constructs the ProjectionParametersBase-pointer, using the ProjectionParametersIO and the CameraParameter file format. More...
 
void Rescale (float ratio, unsigned int cam=0)
 adapt internal params to resampled image More...
 
virtual void SetC (const Vector3< double > &C, unsigned int cam=0)
 Set center of camera with index cam. More...
 
virtual void SetCov (const Matrix< double > &Cov, unsigned int cam=0)
 Set the Pose covariance. More...
 
void SetIdentifier (const std::string &identString)
 Set the identifier of the Projection such as a name. More...
 
virtual void SetPose (const BIAS::Pose pose, unsigned int cam=0)
 Set the Pose of the camera with index cam. More...
 
virtual void SetQ (const Quaternion< double > &Q, unsigned int cam=0)
 Set rotation quaternion of camera with index cam. More...
 
virtual void SetR (const RMatrix &R, unsigned int cam=0)
 Set rotation matrix of camera with index cam. More...
 
unsigned int Size () const
 Determine number of ProjectionParameterBase pointers in Projection. More...
 
Matrix3x3< double > UnProjectToCovLocal (const HomgPoint2D &pos, const Matrix3x3< double > &cov2D, const double &depth, unsigned int camSystem=0, unsigned int cam=0, bool IgnoreDistortion=false, bool Normalize=false) const
 calculate 3D point and associated covariance by unprojection More...
 
Vector3< double > UnProjectToPoint (const HomgPoint2D &pos, double depth, unsigned int cam=0, bool IgnoreDistortion=false) const
 calculates a 3D point in the global (not the rig) coordinate system, which belongs to the image position pos with distance depth to the camera center of cam. More...
 
Vector3< double > UnProjectToPointLocal (const HomgPoint2D &pos, const double &depth, unsigned int camSystem=0, unsigned int cam=0, bool IgnoreDistortion=false) const
 calculates a 3D point in a local camera coordinate system specified by camSystem, which belongs to the image position pos in cam with distance depth to the camera center cam. More...
 
void UnProjectToRay (const HomgPoint2D &pos, Vector3< double > &origin, Vector3< double > &rayDir, unsigned int cam=0, bool IgnoreDistortion=false) const
 calculates the viewing ray in the global coordinate frame (not the rig) from the camera center which belongs to the given image position. More...
 
void UnProjectToRay (const HomgPoint2D &pos, Vector3< double > &rayDir, unsigned int cam=0, bool IgnoreDistortion=false) const
 calculates the viewing ray in the global coordinate frame (not the rig) from the camera center which belongs to the given image position. More...
 
void UnProjectToRayLocal (const HomgPoint2D &pos, Vector3< double > &origin, Vector3< double > &rayDir, unsigned int camSystem=0, unsigned int cam=0, bool IgnoreDistortion=false) const
 calculates a 3D ray in a local camera coordinate system specified by camSystem, which belongs to the image position pos in cam. More...
 
xmlNodePtr XMLAdd (const xmlNodePtr Node, XMLIO &XMLObject) const
 call this to add the class to a node of a given xml tree More...
 
virtual int XMLGetClassName (std::string &TopLevelTag, double &Version) const
 specialization of XML block name function for BIAS::Projection. More...
 
virtual int XMLIn (const xmlNodePtr Node, XMLIO &XMLObject)
 specialization of XML read function for BIAS::Projection. More...
 
virtual int XMLOut (const xmlNodePtr Node, XMLIO &XMLObject) const
 specialization of XML write function for BIAS::Projection. More...
 
int XMLRead (const std::string &Filename)
 derived classes must implement the function XMLIn which is called by this function XMLRead to read everything with name Filename into (*this). More...
 
int XMLReadFromString (const std::string &str)
 reconstruct xml tree from string More...
 
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. More...
 
int XMLWriteToString (std::string &str, std::string encoding="UTF-8") const
 serialize xml tree to string More...
 
virtual ~Projection ()
 destructor for initialization with a ProjectionParametersBase object More...
 

Protected Attributes

std::string identifier_
 Multifunctional identifier. More...
 
std::vector
< ProjectionParametersBase * > 
vecParameters_
 the intrinsics (like K, ...) of the camera usually only one only in rig mode there may be many, in that case vecIntrinsics[0] holds the external pose while the others hold the internal pose (pose in the coordinate system of the first camera) More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Projection &p)
 The outstream operator, used in XMLOut, etc. More...
 

Detailed Description

This class hides the underlying projection model, like projection matrix, spherical camera, lens distortion.

Read and write projections with XMLRead(filename) and XMLWrite(filename)

Author
MIP
Examples:
Example3DImagePlane.cpp, ExampleCalcRelativeTransform.cpp, ExampleCamera.cpp, ExampleCameraPath2Vrml.cpp, ExampleConic.cpp, ExampleEstimateFisheyePolynomial.cpp, ExampleExtractKFromMipImage.cpp, ExampleMultipleDepthWarp.cpp, ExampleMultisampleBlit.cpp, ExampleProjection.cpp, ExampleProjectionGUI.cpp, ExampleProjectionMapping.cpp, ExampleRectification.cpp, ExampleTransformToCartesian.cpp, ExampleTriangleMesh.cpp, ExampleTriangleMeshQuad.cpp, ExampleUndistort.cpp, ExampleVRMLOutProjection.cpp, and ExampleXB3Rectification.cpp.

Definition at line 70 of file Projection.hh.

Constructor & Destructor Documentation

Projection::Projection ( )

constructor

Definition at line 38 of file Projection.cpp.

Projection::Projection ( const Projection p)

copy constructor

Definition at line 49 of file Projection.cpp.

Projection::Projection ( const ProjectionParametersBase p)
explicit

constructor for initialization with a ProjectionParametersBase object

Definition at line 43 of file Projection.cpp.

References BIAS::ProjectionParametersBase::Clone().

Projection::~Projection ( )
virtual

destructor for initialization with a ProjectionParametersBase object

Definition at line 55 of file Projection.cpp.

Member Function Documentation

void Projection::AddAbsoluteCamera ( ProjectionParametersBase ppb)

Add a camera to the projection,the coordinates of the pose are given in absolute Coordinates, they are transformed to relative coordinates to the first camera internally.

Parameters
ppBPointer to ProjectionParametersBase, the Object is copied and stored in vecParameters_
Author
ischiller
Date
07/07
Examples:
ExampleTransformToCartesian.cpp.

Definition at line 199 of file Projection.cpp.

References BIAS::CoordinateTransform3D::BecomeRelativeTransform(), BIAS::ProjectionParametersBase::Clone(), BIAS::ProjectionParametersBase::GetPose(), and BIAS::ProjectionParametersBase::SetPose().

void Projection::AddRelativeCamera ( ProjectionParametersBase ppb)

Add a camera to the projection,the coordinates of the pose are given in relative Coordinates, first cam is origin.

Parameters
ppBPointer to ProjectionParametersBase, the Object is copied and stored in vecParameters_
Author
ischiller
Date
07/07

Definition at line 194 of file Projection.cpp.

References BIAS::ProjectionParametersBase::Clone().

Referenced by BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >::GetRectificationSetup().

void BIAS::Projection::Clear ( )
inline

Delete all ProjectionParameterBase objects contained in Projection.

Definition at line 184 of file Projection.hh.

void Projection::CreatePerspective ( const BIAS::Pose pose,
const BIAS::KMatrix K,
int  width,
int  height,
BIAS_ProjParaPersp_DISTORTION_TYPE  radDistType = DISTYPE_DEF,
const std::vector< double > &  UndistortionCoefficients = std::vector<double>(4, 0.0) 
)
void Projection::CreateSpherical ( const Pose pose,
const unsigned int  width,
const int  height,
const double  principalX,
const double  principalY,
const double  radius,
const double  aspect = 1.0 
)
bool Projection::DoesPointProjectIntoImage ( const BIAS::HomgPoint3D X,
BIAS::HomgPoint2D x,
unsigned int  cam = 0,
bool  IgnoreDistortion = false 
) const
virtual

Checks if 3D point projects into specified image and returns belonging 2D image point.

Parameters
Xassumes homogenized point!
Author
bartczak
Returns
true if the point projects in the image of the camera, false if point does not project into camera image.

Definition at line 300 of file Projection.cpp.

References BIAS::HomgPoint3D::GetEuclidean(), and BIAS::HomgPoint3D::Homogenize().

Referenced by BIAS::PMDImageProc::Fit2DToDepthImage(), BIAS::TriangleMesh::GenerateDenseMesh(), BIAS::TriangleMesh::MakeTriangles_(), BIAS::EpipolarLine::ProjectEpipolarPlane(), and BIAS::TriangleMesh::SimplifyMeshSurface_().

const bool Projection::DoExtrinsicsDiffer ( const BIAS::Projection p) const
virtual

Checks whether extrinsic parameters are different.

Returns
false if all params in argument and all params (*this) have same extrinsics.

Definition at line 269 of file Projection.cpp.

References vecParameters_.

const bool Projection::DoIntrinsicsDiffer ( const BIAS::Projection p) const
virtual

Checks whether intrinsic parameters are different.

Returns
false if all params in argument and all params in (*this) have same intrinsics

Definition at line 285 of file Projection.cpp.

References vecParameters_.

Vector3<double> BIAS::Projection::GetAbsoluteC ( unsigned int  cam = 0) const
inline

Return center of camera with index cam.

If cam>0 this is an absolute position in the global coordinate system

Definition at line 261 of file Projection.hh.

Quaternion<double> BIAS::Projection::GetAbsoluteQ ( unsigned int  cam = 0) const
inline

return rotation quaternion of camera with index cam.

If cam>0 this is an absolute rotation in the global coordinate system

Definition at line 273 of file Projection.hh.

RMatrix BIAS::Projection::GetAbsoluteR ( unsigned int  cam = 0) const
inline

return RMatrix of camera with index cam.

If cam>0 this is an absolute rotation in the global coordinate system

Definition at line 250 of file Projection.hh.

Vector3<double> BIAS::Projection::GetC ( unsigned int  cam = 0) const
inline
virtual Matrix<double> BIAS::Projection::GetCov ( unsigned int  cam = 0) const
inlinevirtual

Get the Pose covariance.

Attention
The covariance of cameras with cam >0 may be incorrect
Returns
The covariance Matrix

Definition at line 306 of file Projection.hh.

Matrix3x4<double> BIAS::Projection::GetExternals ( unsigned int  cam = 0) const
inline

Obtain the external camera parameters.

Returns
Const reference to external pose parameters as Matrix3x4<double>
Attention
The Externals of cameras with cam >0 may be incorrect
Author
koeser
Date
02/2006

Definition at line 292 of file Projection.hh.

std::string BIAS::Projection::GetIdentifier ( ) const
inline

Return the identifier of the Projection such as a name.

Definition at line 483 of file Projection.hh.

Referenced by BIAS::operator<<(), and BIAS::Projection3DData::Set().

ProjectionParametersBase* BIAS::Projection::GetParameterCloneWithAbsolutePose ( unsigned int  cam = 0) const
inline

Allocates memory for parameters base type and returns pointer to it!

Attention
The responsiblity to free associated memory is passed to recipient!
Returns
NULL on error, pointer to parameters otherwise

Definition at line 218 of file Projection.hh.

References BIAS::ProjectionParametersBase::Clone(), BIAS::CoordinateTransform3D::ConcatenateLocalTransform(), BIAS::ProjectionParametersBase::GetPose(), and BIAS::ProjectionParametersBase::SetPose().

Referenced by BIAS::ProjectionParametersFactory::Load(), BIAS::clfTrimmedICP::SetDataFromDepthMap(), BIAS::clfTrimmedICP::setFromDepthMap_(), and BIAS::clfTrimmedICP::SetModelFromDepthMap().

const ProjectionParametersBase* BIAS::Projection::GetParameters ( unsigned int  cam = 0) const
inline

const parameter access function

Returns
NULL on error, pointer to parameters otherwise
Examples:
Example3DImagePlane.cpp, ExampleCalibratedPyramid.cpp, ExampleEstimateFisheyePolynomial.cpp, ExampleExtractKFromMipImage.cpp, ExampleMultipleDepthWarp.cpp, ExampleMultisampleBlit.cpp, ExampleProjection.cpp, ExampleProjectionMapping.cpp, ExampleRectification.cpp, ExampleTransformToCartesian.cpp, ExampleTriangleMesh.cpp, ExampleTriangleMeshQuad.cpp, ExampleUndistort.cpp, ExampleVRMLOutProjection.cpp, and ExampleXB3Rectification.cpp.

Definition at line 194 of file Projection.hh.

Referenced by BIAS::ThreeDOut::AddProjection(), BIAS::ImageBlender::BlendImages(), BIAS::ImageBlenderIncremental::BlendImages(), BIAS::ImageBlender::CheckFov(), BIAS::ImageBlenderIncremental::CheckFov_(), BIAS::PMDImageProc::CrossCheck(), BIAS::PMDImageProc::FitDepthTo2DImage(), BIAS::TriangleMesh::GenerateImagePlane(), BIAS::TriangleMesh::GenerateSimplifiedMesh(), BIAS::IOUtils::GetProjection(), BIAS::IOUtils::GetProjectionParametersPerspective(), BIAS::biasGLviewerGLUT::Init(), BIAS::CylindricDepthPanorama::Init(), BIAS::RectificationBase< InputStorageType, OutputStorageType >::IsInputCameraValid(), BIAS::IOUtils::LoadCamera(), BIAS::IOUtils::LoadParameters(), BIAS::TriangleMesh::MakeTriangles_(), BIAS::VideoSource_Controller_Kinect::OnLoadCalib(), BIAS::CylindricDepthTrackingPanorama::ProcessCylindricProjection(), BIAS::EpipolarLine::ProjectEpipolarPlane(), BIAS::Projection3DData::Set(), BIAS::RectificationBase< InputStorageType, OutputStorageType >::SetCameraA(), BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >::SetCameraA(), BIAS::RectificationBase< InputStorageType, OutputStorageType >::SetCameraB(), BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >::SetCameraB(), BIAS::wxProjectionPanel::SetProjection(), BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >::SetRectificationSetup(), BIAS::ForwardMappingNearestNeighbour< InputStorageType, OutputStorageType >::SetSinkCam(), and BIAS::ForwardMappingNearestNeighbour< InputStorageType, OutputStorageType >::SetSourceCam().

ProjectionParametersBase* BIAS::Projection::GetParameters ( unsigned int  cam = 0)
inline

Non-const access function to parameters.

Returns
NULL on error, pointer to parameters otherwise

Definition at line 204 of file Projection.hh.

virtual const Pose& BIAS::Projection::GetPose ( unsigned int  cam = 0) const
inlinevirtual

return complete pose object.

If cam>0 this is a relative pose in the coordinate system of cam 0

Examples:
ExampleCalcRelativeTransform.cpp, and ExampleXB3Rectification.cpp.

Definition at line 318 of file Projection.hh.

BIAS::Quaternion< double > Projection::GetQ ( unsigned int  cam = 0) const

return rotation quaternion of camera with index cam if cam>0 this is a relative pose in the coordinate system of cam 0

Examples:
ExampleMultisampleBlit.cpp.

Definition at line 524 of file Projection.cpp.

Referenced by BIAS::ThreeDOut::AddProjection(), and BIAS::SphericalDepthPanorama::ProcessSphericalProjection().

RMatrix BIAS::Projection::GetR ( unsigned int  cam = 0) const
inline

return RMatrix of camera with index cam.

If cam>0 this is a relative pose in the coordinate system of cam 0

Examples:
ExampleXB3Rectification.cpp.

Definition at line 243 of file Projection.hh.

Referenced by BIAS::Projection3DData::Set().

int Projection::InitFromCameraData ( const std::vector< CameraData > &  vcd)

initializes projection from cameradata object

Author
streckel (separated by koeser 11/06)

Definition at line 120 of file Projection.cpp.

References BIAS::ProjectionParametersFactory::Create().

bool BIAS::Projection::IsEmpty ( ) const
inline

Determine whether the Projection is Empty.

Returns
true if Projection is empty, false otherwise

Definition at line 174 of file Projection.hh.

Referenced by BIAS::ImageBlenderIncremental::BlendImages(), and BIAS::ImageBlenderIncremental::SetOutputParameters().

int Projection::Load ( const std::string &  filename)
virtual
const Projection& BIAS::Projection::operator= ( const Projection p)
inline

operator=

Definition at line 85 of file Projection.hh.

References vecParameters_.

bool BIAS::Projection::PoseValid ( unsigned int  cam = 0) const
inline

Determine whether the pose is valid or not.

Returns
true if pose valid, false otherwise.

Definition at line 359 of file Projection.hh.

HomgPoint2D Projection::Project ( const HomgPoint3D X,
unsigned int  cam = 0,
bool  IgnoreDistortion = false 
) const
virtual

returns the 2d projection of X in camera cam, where X is given in the global coordinate frame (not the rig) (needs HomgPoint3D to map points at infinity)

Returns
A HomgPoint2D with the 2D positio nof the 3D point in the image of the camera.
Examples:
ExampleProjection.cpp.

Definition at line 250 of file Projection.cpp.

References BIAS::Vector3< T >::Mult().

Referenced by BIAS::PMDImageProc::FitDepthTo2DImage(), BIAS::PMDImageProc::FitDepthTo2DImageFree_(), and BIAS::TriangleMesh::GenerateTexturedQuadStrip().

int Projection::ReadFromBBC ( const std::string &  filename,
const bool  silent = false 
)

read BBC's FreeD data from file and constructs a perspective projection (may have radial distortion)

Author
koeser
Date
11/2006

Definition at line 110 of file Projection.cpp.

References BIAS::ProjectionParametersIO::ReadFromBBC().

int Projection::ReadFromCamParamFile ( const std::string &  filename,
const bool  silent = false 
)

Reads a camera data XML file and constructs the ProjectionParametersBase-pointer, using the ProjectionParametersIO and the CameraParameter file format.

Parameters
filenameName of the XML parameter file
Examples:
ExampleProjection.cpp, and ExampleProjectionMapping.cpp.

Definition at line 99 of file Projection.cpp.

References BIAS::ProjectionParametersIO::ReadRigData().

void BIAS::Projection::Rescale ( float  ratio,
unsigned int  cam = 0 
)
inline

adapt internal params to resampled image

Parameters
ratio2.0 = downsample, 0.5 = upsample
Examples:
ExampleTriangleMesh.cpp.

Definition at line 471 of file Projection.hh.

Referenced by BIAS::CylindricDepthTrackingPanorama::GetTriangleMesh(), BIAS::SphericalDepthPanorama::GetTriangleMesh(), and BIAS::CylindricDepthPanorama::GetTriangleMesh().

virtual void BIAS::Projection::SetC ( const Vector3< double > &  C,
unsigned int  cam = 0 
)
inlinevirtual

Set center of camera with index cam.

If cam>0 this is a relative pose in the coordinate system of cam 0

Definition at line 331 of file Projection.hh.

virtual void BIAS::Projection::SetCov ( const Matrix< double > &  Cov,
unsigned int  cam = 0 
)
inlinevirtual

Set the Pose covariance.

Definition at line 324 of file Projection.hh.

void BIAS::Projection::SetIdentifier ( const std::string &  identString)
inline

Set the identifier of the Projection such as a name.

Definition at line 478 of file Projection.hh.

virtual void BIAS::Projection::SetPose ( const BIAS::Pose  pose,
unsigned int  cam = 0 
)
inlinevirtual

Set the Pose of the camera with index cam.

If cam>0 this is a relative pose in the coordinate system of cam 0

Definition at line 352 of file Projection.hh.

virtual void BIAS::Projection::SetQ ( const Quaternion< double > &  Q,
unsigned int  cam = 0 
)
inlinevirtual

Set rotation quaternion of camera with index cam.

If cam>0 this is a relative pose in the coordinate system of cam 0

Definition at line 338 of file Projection.hh.

virtual void BIAS::Projection::SetR ( const RMatrix R,
unsigned int  cam = 0 
)
inlinevirtual

Set rotation matrix of camera with index cam.

If cam>0 this is a relative pose in the coordinate system of cam 0

Definition at line 345 of file Projection.hh.

unsigned int BIAS::Projection::Size ( ) const
inline

Determine number of ProjectionParameterBase pointers in Projection.

Returns
The number of ProjectionParameterBase and derived objects in Projection

Definition at line 178 of file Projection.hh.

Referenced by BIAS::ThreeDOut::AddProjection(), BIAS::ProjectionParametersFactory::Load(), and BIAS::operator<<().

Matrix3x3< double > Projection::UnProjectToCovLocal ( const HomgPoint2D pos,
const Matrix3x3< double > &  cov2D,
const double &  depth,
unsigned int  camSystem = 0,
unsigned int  cam = 0,
bool  IgnoreDistortion = false,
bool  Normalize = false 
) const

calculate 3D point and associated covariance by unprojection

Author
woelk 03/2006

Definition at line 403 of file Projection.cpp.

Vector3< double > Projection::UnProjectToPoint ( const HomgPoint2D pos,
double  depth,
unsigned int  cam = 0,
bool  IgnoreDistortion = false 
) const

calculates a 3D point in the global (not the rig) coordinate system, which belongs to the image position pos with distance depth to the camera center of cam.

Examples:
ExampleTriangleMeshQuad.cpp.

Definition at line 349 of file Projection.cpp.

References BIAS::Vector3< T >::Normalize(), and BIAS::Vector3< T >::NormL2().

Referenced by BIAS::PMDImageProc::Fit2DToDepthImage(), BIAS::PMDImageProc::FitDepthTo2DImage(), BIAS::PMDImageProc::FitDepthTo2DImageFree_(), BIAS::TriangleMesh::GenerateDenseMesh(), and BIAS::CylindricDepthPanorama::ProcessCylindricProjection().

Vector3< double > Projection::UnProjectToPointLocal ( const HomgPoint2D pos,
const double &  depth,
unsigned int  camSystem = 0,
unsigned int  cam = 0,
bool  IgnoreDistortion = false 
) const

calculates a 3D point in a local camera coordinate system specified by camSystem, which belongs to the image position pos in cam with distance depth to the camera center cam.

Author
koeser

Definition at line 368 of file Projection.cpp.

References BIAS::HomgPoint3D::GetEuclidean(), BIAS::CoordinateTransform3D::GlobalToLocal(), and BIAS::CoordinateTransform3D::LocalToGlobal().

void Projection::UnProjectToRay ( const HomgPoint2D pos,
Vector3< double > &  origin,
Vector3< double > &  rayDir,
unsigned int  cam = 0,
bool  IgnoreDistortion = false 
) const

calculates the viewing ray in the global coordinate frame (not the rig) from the camera center which belongs to the given image position.

The resulting vector3 may have any length.

Returns
Vector3<double> with ray parameters.

Definition at line 323 of file Projection.cpp.

Referenced by BIAS::TriangleMesh::MakeTriangles_().

void Projection::UnProjectToRay ( const HomgPoint2D pos,
Vector3< double > &  rayDir,
unsigned int  cam = 0,
bool  IgnoreDistortion = false 
) const

calculates the viewing ray in the global coordinate frame (not the rig) from the camera center which belongs to the given image position.

The resulting vector3 may have any length.

Returns
Vector3<double> with ray parameters.

Definition at line 337 of file Projection.cpp.

void Projection::UnProjectToRayLocal ( const HomgPoint2D pos,
Vector3< double > &  origin,
Vector3< double > &  rayDir,
unsigned int  camSystem = 0,
unsigned int  cam = 0,
bool  IgnoreDistortion = false 
) const

calculates a 3D ray in a local camera coordinate system specified by camSystem, which belongs to the image position pos in cam.

Definition at line 419 of file Projection.cpp.

References BIAS::Matrix3x3< T >::Transpose().

xmlNodePtr XMLBase::XMLAdd ( const xmlNodePtr  Node,
XMLIO XMLObject 
) const
inherited

call this to add the class to a node of a given xml tree

Attention
interface changed 3/2008: return value now nodeptr of added node!

Definition at line 26 of file XMLBase.cpp.

References BIAS::XMLIO::addAttribute(), and BIAS::XMLIO::addChildNode().

int Projection::XMLGetClassName ( std::string &  TopLevelTag,
double &  Version 
) const
virtual

specialization of XML block name function for BIAS::Projection.

returns the xml class name Projection

Implements BIAS::XMLBase.

Definition at line 461 of file Projection.cpp.

int Projection::XMLIn ( const xmlNodePtr  Node,
XMLIO XMLObject 
)
virtual
int Projection::XMLOut ( const xmlNodePtr  Node,
XMLIO XMLObject 
) const
virtual

specialization of XML write function for BIAS::Projection.

Called if the function XMLWrite is called.

Implements BIAS::XMLBase.

Definition at line 468 of file Projection.cpp.

References BIAS::XMLIO::addAttribute(), BIAS::XMLIO::addChildNode(), and BIAS::XMLIO::addContent().

int XMLBase::XMLRead ( const std::string &  Filename)
inherited
int XMLBase::XMLReadFromString ( const std::string &  str)
inherited

reconstruct xml tree from string

Author
evers
Examples:
ExampleProjection.cpp.

Definition at line 111 of file XMLBase.cpp.

References BIAS::XMLIO::clear(), BIAS::XMLIO::getAttributeValueDouble(), BIAS::XMLIO::getNodeName(), and BIAS::XMLIO::ReadFromString().

Referenced by BIAS::IOUtils::GetProjection().

int XMLBase::XMLWrite ( const std::string &  Filename,
int  CompressionLevel = 0,
bool  AutoAddCompressionSuffix = true,
std::string  encoding = "UTF-8" 
) const
inherited
int XMLBase::XMLWriteToString ( std::string &  str,
std::string  encoding = "UTF-8" 
) const
inherited

serialize xml tree to string

Author
evers
Examples:
ExampleProjection.cpp.

Definition at line 61 of file XMLBase.cpp.

References BIAS::XMLIO::addAttribute(), BIAS::XMLIO::clear(), BIAS::XMLIO::create(), BIAS::XMLIO::SetEncoding(), and BIAS::XMLIO::WriteToString().

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Projection p 
)
friend

The outstream operator, used in XMLOut, etc.

Definition at line 503 of file Projection.hh.

Member Data Documentation

std::string BIAS::Projection::identifier_
protected

Multifunctional identifier.

Definition at line 499 of file Projection.hh.

std::vector<ProjectionParametersBase* > BIAS::Projection::vecParameters_
protected

the intrinsics (like K, ...) of the camera usually only one only in rig mode there may be many, in that case vecIntrinsics[0] holds the external pose while the others hold the internal pose (pose in the coordinate system of the first camera)

Definition at line 496 of file Projection.hh.

Referenced by DoExtrinsicsDiffer(), DoIntrinsicsDiffer(), BIAS::operator<<(), and operator=().


The documentation for this class was generated from the following files: