26 #ifndef __BIAS_ProjectionParametersPerspectiveDepth_hh__
27 #define __BIAS_ProjectionParametersPerspectiveDepth_hh__
29 #include "bias_config.h"
30 #include <MathAlgo/Interpolator.hh>
31 #include <Base/Common/BIASpragmaStart.hh>
32 #include <Geometry/ProjectionParametersPerspective.hh>
64 const unsigned int height = 0);
75 { Init(); *
this = P; };
81 {Init(); *
this = P; };
113 DepthCalibrationParameters_.resize(6, 0.0);
127 DepthCalibrationParameters_.clear();
128 listSplineKnotPoints_.clear();
129 ReflectivityCalibrationParameters_.clear();
130 depthIntNormValues_.clear();
131 minNormIntCoeffs_.clear();
132 maxNormIntCoeffs_.clear();
133 radiusIntNormCoeffs_.clear();
155 void SetDepthCalibrationParameters (
const std::vector<double>& params,
157 float maxDepth=15000.0);
165 void SetDepthCalibrationParametersSpline (
const std::vector<double>& knots,
166 const std::vector<double>& controls,
168 float maxDepth=15000.0);
173 return DepthCalibrationModel_;
181 for(
unsigned i=0;i<DepthCalibrationParameters_.size();i++){
182 params.push_back(DepthCalibrationParameters_[i]);
191 for(
unsigned i=0;i<listSplineKnotPoints_.size();i++){
192 knots.push_back(listSplineKnotPoints_[i]);
200 minDepth = minDepth_;
201 maxDepth = maxDepth_;
208 int SetReflectivityNormalizationParameters(
const std::vector<double>& depthValues,
209 const std::vector<double>& minInt,
210 const std::vector<double>& maxInt,
211 const std::vector<double>& radiusValues,
212 const std::vector<double>& radiusIntensities);
217 void SetReflectivityCalibrationParameters (
const std::vector<double>& params);
225 for(
unsigned i=0;i<ReflectivityCalibrationParameters_.size();i++)
226 params.push_back(ReflectivityCalibrationParameters_[i]);
235 for(
unsigned i=0;i<minNormIntCoeffs_.size();i++)
236 params.push_back(minNormIntCoeffs_[i]);
246 for(
unsigned i=0;i<maxNormIntCoeffs_.size();i++)
247 params.push_back(maxNormIntCoeffs_[i]);
256 for(
unsigned i=0;i<radiusIntNormCoeffs_.size();i++)
257 params.push_back(radiusIntNormCoeffs_[i]);
264 void DistortDepth (
HomgPoint2D const &pos,
float &d,
bool bIsInCartesianCoords=
false);
270 void UnDistortDepth (
HomgPoint2D const &pos,
float &d,
bool bIsInCartesianCoords=
false);
277 int UnDistortDepthMapIP(
BIAS::Image<float>& depthMap,
bool bIsInCartesianCoords=
false) ;
293 void DistortReflectivity(
HomgPoint2D const &pos,
float &depth,
294 float &Reflectivity,
bool bIsInCartesianCoords=
false);
302 void UnDistortReflectivity(
HomgPoint2D const &pos,
float &depth,
303 float &Reflectivity,
bool bIsInCartesianCoords=
false);
312 bool bIsInCartesianCoords=
false);
321 bool bIsInCartesianCoords=
false);
326 void SetDepthDistortionToZero();
331 void SetReflectivityDepthDistortionToZero();
337 bool HasDepthDistortion()
const;
343 bool HasReflectivityDistortion()
const;
356 static unsigned GetNrOfReflectivityParameters();
360 #ifdef BIAS_HAVE_XML2
362 virtual int XMLGetClassName(std::string& TopLevelTag,
363 double& Version)
const;
366 virtual int XMLOut(
const xmlNodePtr Node,
XMLIO& XMLObject)
const;
369 virtual int XMLIn(
const xmlNodePtr Node,
XMLIO& XMLObject);
372 friend std::ostream&
operator<<(std::ostream &os,
382 void PrepareSpline_();
398 os << ppp << std::endl;
399 os <<
"ProjectionParametersPerspectiveDepth:" << std::endl;
402 os <<
"Model:"<<
"Polynom"<<std::endl;
405 os <<
"Model:"<<
"Linear"<<std::endl;
408 os <<
"Model:"<<
"Spline"<<std::endl;
411 os <<
"Model:"<<
"None"<<std::endl;
414 os <<
"Model:"<<
"Undefined"<<std::endl;
421 os<<
"DepthCalibration:"<<std::endl;
427 os<<
"Spline Knot Points:"<<std::endl;
434 os<<
"Reflectivity Calibration:"<<std::endl;
441 os<<
"Minimum Reflectivity Polynom :"<<std::endl;
443 os <<
"cmin" << i<<
": ";
449 os<<
"Maximum Reflectivity Polynom :"<<std::endl;
451 os <<
"cmax" << i<<
": ";
457 os<<
"Radial Vignetting Polynom :"<<std::endl;
459 os <<
"crad" << i<<
": ";
472 #include <Base/Common/BIASpragmaEnd.hh>
static unsigned nrOfSplineParameters_
std::vector< double > radiusIntNormValues_
std::vector< double > depthIntNormValues_
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
additional depth calibration parameters for a perspective depth camera to be used for ToF-(PMD) camer...
BIAS_TOF_DEPTH_ERROR_MODEL
BIAS::Interpolator splineInterpolatorUndist_
camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
void GetReflectivityCalibrationParameters(std::vector< double > ¶ms)
Get the reflectivity calibration parameters.
std::vector< double > maxNormIntCoeffs_
static unsigned nrOfReflectivityParameters_
void GetReflectivityMaxReflectivities(std::vector< double > ¶ms)
Get the reflectivity calibration parameters which define the max reflectivity for all depths interval...
std::vector< double > DepthCalibrationParameters_
BIAS_TOF_DEPTH_ERROR_MODEL DepthCalibrationModel_
std::vector< double > ReflectivityCalibrationParameters_
this class interpolates a function y=f(t) between given control points (the y-values) ...
ProjectionParametersPerspectiveDepth(const ProjectionParametersPerspective &P)
copy constructor with ProjectionParametersPerspective
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
long int D_DEPTH_DISTORTION
ProjectionParametersPerspectiveDepth & operator=(const ProjectionParametersPerspectiveDepth &P)
operator = with ProjectionParametersPerspectiveDepth
void GetDepthCalibrationSplineKnots(std::vector< double > &knots)
Get the depth calibration spline knot points.
std::vector< double > listSplineKnotPoints_
BIAS::Interpolator splineInterpolator_
BIAS_TOF_DEPTH_ERROR_MODEL GetDepthCalibrationModel()
Get the depth calibration model.
std::vector< double > minNormIntCoeffs_
virtual ProjectionParametersPerspectiveDepth * Clone() const
covariant virtual copy constructor for use in Projection
std::ostream & operator<<(std::ostream &os, const Array2D< T > &arg)
void GetReflectivityMinReflectivities(std::vector< double > ¶ms)
Get the reflectivity calibration parameters which define the min reflectivity for all depths interval...
void GetReflectivityRadiusNormalization(std::vector< double > ¶ms)
Get the reflectivity calibration parameters which define the radius vignetting function.
void GetMinMaxDepth(float &minDepth, float &maxDepth)
get the minimum and maximum depth values with which the calibration has been done ...
ProjectionParametersPerspectiveDepth(const ProjectionParametersPerspectiveDepth &P)
copy constructor with ProjectionParametersPerspectiveDepth
void GetDepthCalibrationParameters(std::vector< double > ¶ms)
Get the depth calibration parameters.
ProjectionParametersPerspective & operator=(const ProjectionParametersPerspective &P)
ProjectionParametersPerspectiveDepth & operator=(const ProjectionParametersPerspective &P)
operator = with ProjectionParametersPerspective
virtual ~ProjectionParametersPerspectiveDepth()
destructor which clears all vectors
std::vector< double > radiusIntNormCoeffs_