26 #ifndef __BIAS_ProjectionParametersZoom_hh__
27 #define __BIAS_ProjectionParametersZoom_hh__
28 #include "bias_config.h"
30 #include <Base/Common/BIASpragmaStart.hh>
31 #include <Geometry/ProjectionParametersBase.hh>
32 #include <Base/Geometry/KMatrix.hh>
36 #ifndef __BIAS_CPDiscreteParam__
37 #define __BIAS_CPDiscreteParam__
40 struct BIASImage_EXPORT CPDiscreteParam{
45 double kc1,kc2,kc3,kc4;
60 const unsigned int height = 0)
67 kc1Zoom_=0; kc2Zoom_=0; kc3Zoom_=0; kc4Zoom_=0;
107 bool IgnoreDistortion =
false)
const;
121 bool IgnoreDistortion =
false)
const;
127 const double& depth = 1.0,
128 bool IgnoreDistortion =
false)
const;
137 bool IgnoreDistortion =
false)
const;
159 knownparams_vect_.clear();
162 int AddZoomStep(
double zoom,
double focallength,
163 double kc1,
double kc2,
double kc3,
double kc4);
193 f = focallengthZoom_;
200 double& kc3,
double& kc4)
const
213 const double AspectRatio) {
231 focallengthZoom_ = InterpolateFocalLength_();
241 zoom_=InterpolateAbsZoom_();
250 if (knownparams_vect_.size()>0) {
251 SetZoom(knownparams_vect_[0].zoom);
259 virtual inline void Rescale(
double ratio,
const double offset) {
260 BIASERR(
"unimplemented");
264 virtual inline void Rescale(
unsigned int width,
unsigned int height){
265 BIASERR(
"unimplemented");
269 #ifdef BIAS_HAVE_XML2
271 virtual int XMLGetClassName(std::string& TopLevelTag,
272 double& Version)
const;
275 virtual int XMLOut(
const xmlNodePtr Node,
XMLIO& XMLObject)
const;
278 virtual int XMLIn(
const xmlNodePtr Node,
XMLIO& XMLObject);
282 friend std::ostream&
operator<<(std::ostream &os,
299 void InterpolateDistortionFromIndex_(
unsigned int i,
double relnorm);
300 double InterpolateFocalLength_();
301 double InterpolateAbsZoom_();
314 os <<
"ProjectionParametersZoom:" << std::endl;
321 #include <Base/Common/BIASpragmaEnd.hh>
virtual void SetPrincipal(const double x, const double y)
Set principal point (in pixels relative to top left corner).
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
int SetFocalLength(const double f)
Set the current camera focal length, the zoom will be calculated.
ProjectionParametersZoom(const ProjectionParametersZoom &P)
camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
virtual const bool DoIntrinsicsDiffer(const ProjectionParametersBase *p) const
ProjectionParametersZoom(const unsigned int width=0, const unsigned int height=0)
void GetK(KMatrix &K) const
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
virtual void SetPrincipal(const double x, const double y)
Set principal point in pixels relative to top left corner, virtual overload to recalculate K_...
virtual ProjectionParametersZoom * Clone() const
covariant virtual copy constructor for use in Projection
virtual const bool DoIntrinsicsDiffer(const ProjectionParametersBase *p) const
class BIASGeometry_EXPORT PMatrix
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
virtual void Rescale(double ratio, const double offset)
adapt internal params to resampled image
std::vector< CPDiscreteParam > knownparams_vect_
virtual BIAS::PMatrix GetP() const
int SetZoom(const double abszoom)
Set the current camera zoom, the focal length will be calculated.
K describes the mapping from world coordinates (wcs) to pixel coordinates (pcs).
virtual void SetAspectratio(const double AspectRatio)
Set CCD aspect ratio (i.e.
virtual ~ProjectionParametersZoom()
void GetUndistortion(double &kc1, double &kc2, double &kc3, double &kc4) const
Get the current camera Undistortion.
describes a projective 3D -> 2D mapping in homogenous coordinates
void SetUnzoomed()
Set the zoom and focal length of a zoom camera to the default settings.
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
void GetKinv(KMatrix &invK) const
virtual void SetAspectratio(const double CellSizeX, const double AspectRatio)
Set CCD cell-size in meter, virtual overload to recalculate K_.
int GetZoom(double &zoom) const
Get the current camera zoom.
virtual void Rescale(unsigned int width, unsigned int height)
adapt internal parameters to new image size
int GetFocalLength(double &f) const
Get the current camera focal length.