26 #include "Geometry/ProjectionParametersDynamicLoad.hh"
50 BIASERR(
"hndl already null, cannot possibly close it")
58 #if defined(BIAS_DEBUG) && defined(COMPILE_DEBUG) && !defined(COMPILE_NDEBUG)
62 libPaths_.push_back(
"/opt/net64/gcc48/underwaterProjection/libMIPProjectionParametersUnderwaterFlatPortD.so");
63 libPaths_.push_back(
"/opt/net64/gcc48/underwaterProjection/libMIPProjectionParametersUnderwaterDomePortD.so");
64 libPaths_.push_back(
"/opt/net64/gcc48/underwaterProjection/libMIPProjectionParametersUnderwaterFlatPortSphericalD.so");
69 libPaths_.push_back(
"/opt/net64/gcc48/underwaterProjection/libMIPProjectionParametersUnderwaterFlatPort.so");
70 libPaths_.push_back(
"/opt/net64/gcc48/underwaterProjection/libMIPProjectionParametersUnderwaterDomePort.so");
71 libPaths_.push_back(
"/opt/net64/gcc48/underwaterProjection/libMIPProjectionParametersUnderwaterFlatPortSpherical.so");
74 unsigned int libIndex = 0;
75 if(className_ ==
"ProjectionParametersUnderwaterFlatPort"){
79 if(className_ ==
"ProjectionParametersUnderwaterDomePort"){
83 if(className_ ==
"ProjectionParametersUnderwaterFlatPortSpherical"){
88 hndl_ = dlopen(libPaths_[libIndex].c_str(), RTLD_NOW);
90 cerr <<
"Dynamic Load Error: " << dlerror() << endl;
93 mkr.ptr = dlsym(hndl_,
"ppDynLoadMaker");
95 cout <<
"Dynamic Load Error: Library does not seem to be compatible. No ppDynLoadMaker found." << endl;
115 dynptr_->GetFirstBorderPixel(it);
119 return dynptr_->GetNextBorderPixel(it);
123 dynptr_->GetFirstEdgePosition(it);
127 return dynptr_->GetNextEdgePosition(it);
131 double& minPhi,
double& maxPhi,
double& centerPhi,
132 double& minTheta,
double& maxTheta){
133 return dynptr_->GetSphericalViewingRange(sphericalReferenceFrame, minPhi, maxPhi, centerPhi, minTheta, maxTheta);
140 return dynptr_->DoIntrinsicsDiffer(p);
146 bool IgnoreDistortion)
const
149 return dynptr_->DoesPointProjectIntoImageLocal(localX, x, IgnoreDistortion);
156 return dynptr_->ProjectLocal(point,IgnoreDistortion);
162 bool IgnoreDistortion)
const
165 return dynptr_->ProjectLocal(point, p2d, IgnoreDistortion);
173 dynptr_->UnProjectLocal(cPos, pointOnRay, direction, IgnoreDistortion);
178 bool IgnoreDistortion)
const
181 return dynptr_->UnProjectToImagePlane(pos, depth, IgnoreDistortion);
188 return dynptr_->Distort(point2d);
195 return dynptr_->Undistort(point2d);
200 #ifdef BIAS_HAVE_XML2
204 dynptr_->XMLGetClassName(TopLevelTag, Version);
210 dynptr_->XMLOut(Node, XMLObject);
219 dynptr_->XMLIn(Node, XMLObject);
224 #endif // BIAS_HAVE_XML2
235 bool IgnoreDistortion,
bool Normalize)
237 return dynptr_->UnProjectCovLocal(pos, cov2D, IgnoreDistortion, Normalize);
virtual void GetFirstEdgePosition(PixelIterator &it)
call this to start a run at the outer boundary of an image.
virtual int XMLOut(const xmlNodePtr Node, XMLIO &XMLObject) const
specialization of XML write function
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
virtual Matrix3x3< double > UnProjectCovLocal(const HomgPoint2D &pos, const Matrix3x3< double > &cov2D, bool IgnoreDistortion=false, bool Normalize=false)
unprojects the covariance matrices to K=Identity camera
virtual int XMLGetClassName(std::string &TopLevelTag, double &Version) const
specialization of XML block name function
virtual void UnProjectLocal(const HomgPoint2D &pos, Vector3< double > &pointOnRay, Vector3< double > &direction, bool IgnoreDistortion=false) const
calculates the unit size viewing ray from the camera center (in the camera coordinate system) which b...
virtual HomgPoint3D UnProjectToImagePlane(const HomgPoint2D &pos, const double &depth=1.0, bool IgnoreDistortion=false) const
map points from image onto unit diameter image plane in 3D.
Wrapper class for reading and writing XML files based on the XML library libxml2. ...
virtual HomgPoint2D ProjectLocal(const Vector3< double > &point, bool IgnoreDistortion=false) const
calculates the projection of a point in the local camera coordinate system to a pixel in the image pl...
virtual void GetFirstBorderPixel(PixelIterator &it)
call this to start a run at the outer boundary of an image.
virtual bool Undistort(BIAS::HomgPoint2D &point2d) const
Interface defintion for lens undistortion function, implemented by derived classes.
virtual const bool DoIntrinsicsDiffer(const ProjectionParametersBase *p) const
class HomgPoint3D describes a point with 3 degrees of freedom in projective coordinates.
virtual bool Distort(BIAS::HomgPoint2D &point2d) const
Interface defintion for lens distortion function, implemented by derived classes. ...
virtual ~ProjectionParametersDynamicLoad()
Can be used to run along the image border.
virtual bool DoesPointProjectIntoImageLocal(const Vector3< double > &localX, HomgPoint2D &x, bool IgnoreDistortion=false) const
Checks if 3D point projects into specified image and returns belonging 2D image point.
virtual bool GetNextBorderPixel(PixelIterator &it)
call this iteratively to run at the outer boundary of an image.
virtual int GetSphericalViewingRange(const CoordinateTransform3D &sphericalReferenceFrame, double &minPhi, double &maxPhi, double ¢erPhi, double &minTheta, double &maxTheta)
Determines the maximal and minimal viewing range in means of spherical coordinates.
ProjectionParametersBase *(* maker_t)()
virtual bool GetNextEdgePosition(PixelIterator &it)
call this iteratively to run at the outer edge of an image.
virtual int XMLIn(const xmlNodePtr Node, XMLIO &XMLObject)
specialization of XML read function
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...