30 #ifndef _NONA_SPACETRANSFORM_H
31 #define _NONA_SPACETRANSFORM_H
33 #include <vigra/diff2d.hxx>
67 typedef void (*
trfn)(
double x_dest,
double y_dest,
double* x_src,
double* y_src,
const _FuncParams ¶ms );
100 const vigra::Diff2D & destSize,
108 const vigra::Diff2D & destSize,
118 void InitRadialCorrect(
const vigra::Size2D & sz,
const std::vector<double> & radDist,
124 void InitRadialCorrect(
const SrcPanoImage & src,
int channel=1);
126 void InitInvRadialCorrect(
const SrcPanoImage & src,
int channel=1);
133 void createTransform(
const PanoramaData & pano,
unsigned int imgNr,
135 vigra::Diff2D srcSize=vigra::Diff2D(0,0));
138 void createInvTransform(
const PanoramaData & pano,
unsigned int imgNr,
140 vigra::Diff2D srcSize=vigra::Diff2D(0,0));
142 void createTransform(
const vigra::Diff2D & srcSize,
145 const vigra::Diff2D &destSize,
150 void createInvTransform(
const vigra::Diff2D & srcSize,
153 const vigra::Diff2D & destSize,
167 bool transformImgCoord(
double & x_dest,
double & y_dest,
double x_src,
double y_src)
const;
171 return transformImgCoord(dest.
x, dest.
y, src.
x, src.
y);
179 return m_Stack.empty();
185 void AddTransform(
trfn function_name,
double var0,
double var1 = 0.0f,
double var2 = 0.0f,
double var3 = 0.0f,
double var4=0.0f,
double var5=0.0f,
double var6=0.0f,
double var7=0.0f );
212 template <
class VECTOR>
221 template <
class TRANSFORM>
224 vigra::Rect2D & inside,
225 vigra::Rect2D & boundingBox);
257 template <
class VECTOR>
260 double d3 = p[3]*p[3]*p[3];
261 c[0] = (3*q[1]*p[3]*p[3]*p[2]+q[3]*p[0]+q[2]*(2*p[3]*p[1]+p[2]*p[2])+q[0]*d3*p[3]);
262 c[1] = (2*q[2]*p[3]*p[2]+q[1]*d3+q[3]*p[1]);
263 c[2] = (q[3]*p[2]+q[2]*p[3]*p[3]);
280 template <
class TRANSFORM>
281 void traceImageOutline(vigra::Size2D sz, TRANSFORM & transf, vigra::Rect2D & inside, vigra::Rect2D & boundingBox)
283 boundingBox = vigra::Rect2D();
284 inside = vigra::Rect2D();
289 transf.transformImgCoord(xd,yd, x,y);
297 for (y=0; y < sz.y; y++) {
298 transf.transformImgCoord(xd,yd, x,y);
304 for (y=0; y < sz.y; y++) {
305 transf.transformImgCoord(xd,yd, x,y);
311 for (x=0; x < sz.x; x++) {
312 transf.transformImgCoord(xd,yd, x,y);
318 for (x=0; x < sz.x; x++) {
319 transf.transformImgCoord(xd,yd, x,y);
323 inside.setUpperLeft(vigra::Point2D(left, top));
324 inside.setLowerRight(vigra::Point2D(right, bottom));
void traceImageOutline(vigra::Size2D sz, TRANSFORM &transf, vigra::Rect2D &inside, vigra::Rect2D &boundingBox)
Internal function to estimate the image scaling required to avoid black stripes at the image borders...
void combinePolynom4(const VECTOR &p, const VECTOR &q, VECTOR &c)
combine 4rd degree polynomials
general : Matrix3 is a class for handling 3x3 Matrix manipulation.
void(* trfn)(double x_dest, double y_dest, double *x_src, double *y_src, const _FuncParams ¶ms)
Transformation function type.
Parameters for transformation calls Can be just one double, two double, 4 double, a matrix...
Function descriptor to be executed by exec_function.
std::map< std::string, Variable > VariableMap
double estRadialScaleCrop(const std::vector< double > &coeff, int width, int height)
Calculate effective scaling factor.
double estScaleFactorForFullFrame(const SrcPanoImage &src)
Calculate effective scaling factor for a given source image.
ProjectionFormat
Projection of final panorama.
All variables of a source image.
struct HuginBase::Nona::_fDesc fDescription
Function descriptor to be executed by exec_function.