26 #include "HomographyMapping.hh"
27 #include <Geometry/RMatrix.hh>
28 #include <Base/Image/ImageConvert.hh>
29 #include <Base/Geometry/HomgPoint2D.hh>
33 template <
class InputStorageType,
class OutputStorageType>
39 template <
class InputStorageType,
class OutputStorageType>
46 template <
class InputStorageType,
class OutputStorageType>
54 template <
class InputStorageType,
class OutputStorageType>
64 template <
class InputStorageType,
class OutputStorageType>
69 H_.Mult(sink, source);
74 template <
class InputStorageType,
class OutputStorageType>
78 H_.GetJacobian(sink, Jacobian);
85 template <
class InputStorageType,
class OutputStorageType>
88 unsigned int sinkwidth,
unsigned int sinkheight,
158 brx = ( int)sinkwidth-1;
159 bry = ( int)sinkheight-1;
165 template <
class InputStorageType,
class OutputStorageType>
171 HTrans[0][2]=offsetX_;
172 HTrans[1][2]=offsetY_;
183 #if defined(BUILD_IMAGE_CHAR)
189 #if defined(BUILD_IMAGE_USHORT)
193 #if defined(BUILD_IMAGE_SHORT)
197 #if defined(BUILD_IMAGE_SHORT)&&defined(BUILD_IMAGE_USHORT)
201 #if defined(BUILD_IMAGE_INT)
205 #if defined(BUILD_IMAGE_USHORT)
209 #if defined(BUILD_IMAGE_USHORT) && defined(BUILD_IMAGE_INT)
213 #if defined(BUILD_IMAGE_DOUBLE)
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
virtual ~HomographyMapping()
virtual int GetSourceCoordinates_(const HomgPoint2D &sink, HomgPoint2D &source) const
reimplementation for homography, takes sink and computes coords in source
a 3x3 Matrix describing projective transformations between planes
Maps image src to image sink with homography H (software implementation)
HomgPoint2D & Homogenize()
homogenize class data member elements to W==1 by divison by W
virtual int GetBoundingBox(unsigned int srcwidth, unsigned int srcheight, unsigned int sinkwidth, unsigned int sinkheight, int &tlx, int &tly, int &brx, int &bry)
calculates the bounding box in sink image, where to do the backward mapping.
HomographyMapping< InputStorageType, OutputStorageType > & operator=(const HomographyMapping &src)
required because of const members
HMatrix H_
the homography for backward mapping: run over sink and compute source = H_ * sink ...
virtual int GetJacobian_(const HomgPoint2D &sink, Matrix2x2< double > &Jacobian) const
analytic jacobian
HMatrix GetChangedHomography() const
if Map() is called with newDist=true, the real applied Homography is changed
void SetIdentity()
set the elements of this matrix to the identity matrix (possibly overriding the inherited method) ...