36#ifndef VIGRA_POLYNOMIAL_REGISTRATION_HXX
37#define VIGRA_POLYNOMIAL_REGISTRATION_HXX
39#include "mathutil.hxx"
41#include "linear_solve.hxx"
42#include "tinyvector.hxx"
43#include "splineimageview.hxx"
79 weights[
weight_idx] = pow(x,(
double)order-
i)*pow(y,(
double)
i);
111template <
int PolynomOrder,
112 class SrcPointIterator,
113 class DestPointIterator>
114linalg::TemporaryMatrix<double>
122 std::vector<double> weights;
133 b1(
i,0)=(*s)[0];
b2(
i,0)=(*s)[1];
136 if(!vigra::linearSolve( A,
b1,
res1 ) || !vigra::linearSolve( A,
b2,
res2 ))
137 vigra_fail(
"polynomialMatrix2DFromCorrespondingPoints(): singular solution matrix.");
143 res(c,0) =
res1(c,0);
144 res(c,1) =
res2(c,0);
218 "polynomialWarpImage(): matrix doesn't represent a polynomial transformation of given degreee in 2D coordinates.");
225 for(
double y = 0.0; y <
h; ++y, ++
dul.y)
227 typename DestIterator::row_iterator rd =
dul.rowIterator();
228 for(
double x=0.0; x < w; ++x, ++rd)
247template <
int PolynomOrder,
249 class DestIterator,
class DestAccessor,
253 triple<DestIterator, DestIterator, DestAccessor> dest,
254 MultiArrayView<2, double, C>
const & polynomialMatrix)
256 polynomialWarpImage<PolynomOrder>(src, dest.first, dest.second, dest.third, polynomialMatrix);
260template <
int PolynomOrder,
266 MultiArrayView<2, T2, S2> dest,
267 MultiArrayView<2, double, C>
const & polynomialMatrix)
269 polynomialWarpImage<PolynomOrder>(src, destImageRange(dest), polynomialMatrix);
Class for a single RGB value.
Definition rgbvalue.hxx:128
linalg::TemporaryMatrix< double > polynomialMatrix2DFromCorrespondingPoints(SrcPointIterator s, SrcPointIterator s_end, DestPointIterator d)
Create polynomial matrix of a certain degree that maps corresponding points onto each other.
Definition polynomial_registration.hxx:115
std::vector< double > polynomialWarpWeights(double x, double y, unsigned int polynom_order)
Definition polynomial_registration.hxx:67
void polynomialWarpImage(...)
Warp an image according to an polynomial transformation.