25 #include <Base/Common/BIASpragmaStart.hh>
27 #ifndef __ProjectionMapping_hh__
28 #define __ProjectionMapping_hh__
30 #include <Image/BackwardMapping.hh>
31 #include <Geometry/HMatrix.hh>
32 #include <Geometry/Projection.hh>
33 #include <Base/Geometry/HomgPlane3D.hh>
75 template <
class InputStorageType,
class OutputStorageType>
97 calcRelativeRSinkToSource_();
111 calcRelativeRSinkToSource_();
112 depthMapSink_ = sinkdepth;
113 if (depthMapSink_!=NULL) accountForDifferentCameraCenters_ =
true;
118 mappingPlane_ = plane;
119 depthMapSink_ = NULL;
120 accountForDifferentCameraCenters_ =
true;
130 virtual int GetBoundingBox(
unsigned int srcwidth,
131 unsigned int srcheight,
132 unsigned int sinkwidth,
133 unsigned int sinkheight,
143 if (SourceP_.PoseValid() && SinkP_.PoseValid())
144 relativeRSinkToSource_ = SourceP_.GetR().Transpose()*SinkP_.GetR();
150 virtual int GetSourceCoordinates_(
const HomgPoint2D& sink,
179 #include <Base/Common/BIASpragmaEnd.hh>
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
BIAS::Projection GetSourceCam()
const Image< float > * depthMapSink_
depth map used for sink if camera centers differ
void SetSinkCam(const Projection &P, const Image< float > *sinkdepth=NULL)
Set your sink projection before calling Map(),.
void SetSourceCam(const Projection &P)
Set your source projection before calling Map()
Abstract base class to map an image (texture) src to an image sink with an arbitrary continuous funct...
Maps source pixel to sink pixel of given projections.
HomgPlane3D mappingPlane_
map via this plane
RMatrix relativeRSinkToSource_
bool accountForDifferentCameraCenters_
dont map across plane at infinity
This class hides the underlying projection model, like projection matrix, spherical camera...
BIAS::Projection GetSinkCam()
void calcRelativeRSinkToSource_()
void SetPlane(const BIAS::HomgPlane3D &plane)
sets the scene to be a plane
A homogeneous plane (in P^3) All points X on the plane p fulfill p ' * X = 0.