36#ifndef VIGRA_PROJECTIVE_REGISTRATION_HXX
37#define VIGRA_PROJECTIVE_REGISTRATION_HXX
39#include "mathutil.hxx"
41#include "linear_solve.hxx"
42#include "tinyvector.hxx"
43#include "splineimageview.hxx"
63template <
class SrcPo
intIterator,
class DestPo
intIterator>
64linalg::TemporaryMatrix<double>
73 vigra_assert(size >= 4,
74 "projectiveMatrix2DFromCorrespondingPoints(): need at least four corresponding points.");
77 for (
int i =0;
i<size; ++
i, ++s, ++d)
81 A(
i,0)=(*d)[0]; A(
i,1)=(*d)[1]; A(
i,2)=1; A(
i,3)=0; A(
i,4)=0; A(
i,5)=0; A(
i,6)=-1*((*d)[0])*((*s)[0]); A(
i,7)=-1*((*d)[1])*((*s)[0]);
84 A(size+
i,0)=0; A(size+
i,1)=0; A(size+
i,2)=0; A(size+
i,3)=(*d)[0]; A(size+
i,4)=(*d)[1]; A(size+
i,5)=1; A(size+
i,6)=-1*((*d)[0])*((*s)[1]); A(size+
i,7)=-1*((*d)[1])*((*s)[1]);
89 bool solvable = linearSolve(A, b, res);
93 "projectiveMatrix2DFromCorrespondingPoints(): singular solution matrix.");
191template <
int ORDER,
class T,
199 "projectiveWarpImage(): matrix doesn't represent an projective transformation with homogeneous 2D coordinates.");
205 for(
double y = 0.0; y <
h; ++y, ++
dul.y)
207 typename DestIterator::row_iterator rd =
dul.rowIterator();
208 for(
double x=0.0; x < w; ++x, ++rd)
219template <
int ORDER,
class T,
220 class DestIterator,
class DestAccessor,
224 triple<DestIterator, DestIterator, DestAccessor> dest,
225 MultiArrayView<2, double, C>
const & projectiveMatrix)
231template <
int ORDER,
class T,
236 MultiArrayView<2, T2, S2> dest,
237 MultiArrayView<2, double, C>
const & projectiveMatrix)
Class for a single RGB value.
Definition rgbvalue.hxx:128
void projectiveWarpImage(...)
Warp an image according to an projective transformation.
linalg::TemporaryMatrix< double > projectiveMatrix2DFromCorrespondingPoints(SrcPointIterator s, SrcPointIterator send, DestPointIterator d)
Create homogeneous matrix that maps corresponding points onto each other.
Definition projective_registration.hxx:65