25 #ifndef __BIAS_ProjectionParametersCylindric_hh__
26 #define __BIAS_ProjectionParametersCylindric_hh__
28 #include <bias_config.h>
32 #include <Base/Common/BIASpragmaStart.hh>
34 #include <Geometry/ProjectionParametersBase.hh>
77 const double phiMin,
const double phiMax,
78 const unsigned int width,
79 const unsigned int height)
88 SetCylinderType(AXIS_ORTHOGONAL);
89 UseAxisOffset_ =
false;
97 const unsigned int height = 0)
104 focallengthPhi_ = 1.0;
108 SetCylinderType(AXIS_ORTHOGONAL);
109 UseAxisOffset_ =
false;
114 const double phiMin,
const double phiMax,
115 const unsigned int width,
116 const unsigned int height){
152 bool IgnoreDistortion =
false)
const;
162 bool IgnoreDistortion =
false)
const;
176 bool IgnoreDistortion =
false)
const;
183 const double& depth = 1.0,
184 bool IgnoreDistortion =
false)
const;
189 bool IgnoreDistortion =
false)
const;
205 bool IgnoreDistortion =
false)
const;
212 bool IgnoreDistortion =
false)
const;
224 #ifdef BIAS_HAVE_XML2
226 virtual int XMLGetClassName(std::string &TopLevelTag,
227 double &Version)
const;
230 virtual int XMLOut(
const xmlNodePtr Node,
XMLIO &XMLObject)
const;
233 virtual int XMLIn(
const xmlNodePtr Node,
XMLIO &XMLObject);
240 void SetCylinderRotation(
const Vector3<double> &rotAxis,
double rotAngle,
241 const ProjectionCylinderAxisEnum axisType = AXIS_ORTHOGONAL);
244 const ProjectionCylinderAxisEnum axisType = AXIS_ORTHOGONAL);
246 void SetCylinderType(
const ProjectionCylinderAxisEnum axisType);
250 virtual void Rescale(
double ratio,
const double offset = 0.0){
252 BIASASSERT(
Equal(focallengthX_,
double(width_)/(xMax_-xMin_)));
253 BIASASSERT(
Equal(principalX_, (-1.0)*xMin_*focallengthX_));
254 BIASASSERT(
Equal(focallengthPhi_,
double(height_)/(phiMax_-phiMin_)));
255 BIASASSERT(
Equal(principalY_, (-1.0)*phiMin_*focallengthPhi_));
260 virtual void Rescale(
unsigned int width,
unsigned int height){
262 BIASASSERT(
Equal(focallengthX_,
double(width_)/(xMax_-xMin_)));
263 BIASASSERT(
Equal(principalX_, (-1.0)*xMin_*focallengthX_));
264 BIASASSERT(
Equal(focallengthPhi_,
double(height_)/(phiMax_-phiMin_)));
265 BIASASSERT(
Equal(principalY_, (-1.0)*phiMin_*focallengthPhi_));
281 xPhi[1] = atan2(point[1], point[2]);
289 double phiMin_, phiMax_;
294 void UpdateFromQuasiK_();
299 void UpdateQuasiK_();
328 os <<
"ProjectionParametersCylindric:" << std::endl;
331 os <<
"- principalX_ = " << p.
principalX_ << std::endl;
332 os <<
"- principalY_ = " << p.
principalY_ << std::endl;
333 os <<
"- xMin_ = " << p.
xMin_ << std::endl;
334 os <<
"- xMax_ = " << p.
xMax_ << std::endl;
335 os <<
"- phiMin_ = " << p.
phiMin_ << std::endl;
336 os <<
"- phiMax_ = " << p.
phiMax_ << std::endl;
337 os <<
"- width_ = " << p.
width_ << std::endl;
338 os <<
"- height_ = " << p.
height_ << std::endl << std::endl;
342 os <<
"- cylinder axis adaption rotation axis is "
343 << axis[0] <<
"," << axis[1] <<
"," << axis[2]
344 <<
", rotation angle is " << 180.0*angle/M_PI <<
", offset is "
353 #include <Base/Common/BIASpragmaEnd.hh>
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
ProjectionParametersCylindric(const unsigned int width=0, const unsigned int height=0)
virtual void Rescale(double ratio, const double offset=0.0)
Adapt internal parameters to resampled image.
void SetParameters(const double xMin, const double xMax, const double phiMin, const double phiMax, const unsigned int width, const unsigned int height)
void ProjectToNormalizedCoords_(const Vector3< double > &point, Vector2< double > &xPhi) const
Vector3< double > AxisOffset_
Offset for cylinder axis origin (optional)
double focallengthPhi_
quasi K (principle point already contained in base class)
double GetFocallengthPhi()
int GetAxisAngle(Vector3< QUAT_TYPE > &axis, QUAT_TYPE &angle) const
Returns rotation in axis and angle notation (angle in radians).
ProjectionParametersCylindric & operator=(const ProjectionParametersCylindric &P)
ProjectionParametersCylindric(const double xMin, const double xMax, const double phiMin, const double phiMax, const unsigned int width, const unsigned int height)
Note: Angles are given in radians.
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
Quaternion< double > AxisRotation_
Rotation of cylinder axis.
unsigned int height_
height of image in pixels
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
bool Equal(const T left, const T right, const T eps)
comparison function for floating point values See http://www.boost.org/libs/test/doc/components/test_...
unsigned int width_
width of image in pixels
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
virtual void Rescale(unsigned int width, unsigned int height)
adapt internal parameters to new image size
double phiMin_
Description of coordinate range in normalized frame.
Quaternion< double > AxisRotationInv_
double principalX_
principal point in pixel coordinates (one for all zoom settings)
ProjectionParametersCylindric(const ProjectionParametersCylindric &P)
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
virtual ~ProjectionParametersCylindric()
virtual void Rescale(double ratio, const double offset=0.0)
Adapt internal parameters to resampled image.
ProjectionCylinderAxisEnum
Enumeration of typical directions of the cylinder axis, i.e.
Vector3< double > AxisOffsetInv_
virtual ProjectionParametersCylindric * Clone() const
covariant virtual copy constructor for use in Projection
virtual ProjectionParametersBase & operator=(const ProjectionParametersBase &p)