24 #ifndef __BIAS_ProjectionParametersOrthographic_hh__
25 #define __BIAS_ProjectionParametersOrthographic_hh__
29 #include <bias_config.h>
30 #include <Base/Common/BIASpragmaStart.hh>
31 #include <Geometry/ProjectionParametersBase.hh>
45 const unsigned int width=0,
const unsigned int height=0,
46 const double dX=1,
const double dY=1)
48 BIASASSERT(rayDir.
NormL2() > 1e-7);
55 const unsigned int width,
const unsigned int height){
56 BIASASSERT(rayDir.
NormL2() > 1e-7);
77 virtual const bool DoIntrinsicsDiffer(
const PPB *p)
const;
81 bool IgnoreDistortion =
true)
const;
86 const double& depth = 1.0,
bool IgnoreDistortion =
true)
const;
91 bool IgnoreDistortion =
true)
const;
96 bool IgnoreDistortion =
true)
const{
97 p2d = ProjectLocal(point, IgnoreDistortion);
110 const double &depth,
bool IgnoreDistortion =
true)
const{
112 BIASASSERT(IgnoreDistortion);
115 res[0] += (pos[0]-principalX_)*dX_;
116 res[1] += (pos[1]-principalY_)*dY_;
125 bool ignoreDistortion =
true)
const{
127 BIASASSERT(ignoreDistortion);
134 virtual bool Undistort(
HomgPoint2D& point2d)
const;
136 virtual void Rescale(
double ratio,
const double offset = 0.0){
139 PPB::Rescale(ratio, offset);
142 virtual void Rescale(
unsigned int width,
unsigned int height){
143 dX_ /= (double)width_/(
double)width;
144 dY_ /= (double)height_/(
double)height;
145 PPB::Rescale(width, height);
151 #ifdef BIAS_HAVE_XML2
153 virtual int XMLGetClassName(std::string &TopLevelTag,
double &Version)
const;
156 virtual int XMLOut(
const xmlNodePtr Node,
XMLIO &XMLObject)
const;
159 virtual int XMLIn(
const xmlNodePtr Node,
XMLIO &XMLObject);
170 os <<
"ProjectionParametersOrthographic:" << std::endl;
171 os <<
"- principalX_ = " << p.
principalX_ << std::endl;
172 os <<
"- principalY_ = " << p.
principalY_ << std::endl;
173 os <<
"- dX_ = " << p.
dX_ << std::endl;
174 os <<
"- dY_ = " << p.
dY_ << std::endl;
175 os <<
"- width_ = " << p.
width_ << std::endl;
176 os <<
"- height_ = " << p.
height_ << std::endl << std::endl;
181 #include <Base/Common/BIASpragmaEnd.hh>
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
virtual ProjectionParametersOrthographic * Clone() const
covariant virtual copy constructor for use in Projection
virtual void UnProjectLocal(const HomgPoint2D &pos, Vector3< double > &origin, Vector3< double > &direction, bool ignoreDistortion=true) const
calculates the direction of the viewing ray from the image plane, shifted into the camera center (in ...
ProjectionParametersOrthographic & operator=(const ProjectionParametersOrthographic &P)
virtual void Rescale(double ratio, const double offset=0.0)
Adapt internal parameters to resampled image.
virtual ~ProjectionParametersOrthographic()
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
void SetParameters(Vector3< double > &rayDir, const double dX, const double dY, const unsigned int width, const unsigned int height)
unsigned int height_
height of image in pixels
Vector3< double > rayDir_
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
virtual int ProjectLocal(const Vector3< double > &point, HomgPoint2D &p2d, bool IgnoreDistortion=true) const
calculates the projection of a point in the local camera coordinate system to a pixel in the image pl...
unsigned int width_
width of image in pixels
virtual Vector3< double > UnProjectToPointLocal(const HomgPoint2D &pos, const double &depth, bool IgnoreDistortion=true) const
Calculates a 3D point in a local camera coordinate system specified by camSystem, which belongs to th...
void MultIP(const T &scalar)
double principalX_
principal point in pixel coordinates (one for all zoom settings)
ProjectionParametersOrthographic(const ProjectionParametersOrthographic &P)
ProjectionParametersOrthographic(Vector3< double > &rayDir, const unsigned int width=0, const unsigned int height=0, const double dX=1, const double dY=1)
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
Vector3< T > & Normalize()
normalize this vector to length 1
double NormL2() const
the L2 norm sqrt(a^2 + b^2 + c^2)
virtual void Rescale(unsigned int width, unsigned int height)
adapt internal parameters to new image size