25 #ifndef __ImageAlignment__hh__
26 #define __ImageAlignment__hh__
28 #include <Base/Common/BIASpragmaStart.hh>
30 #include <Base/Debug/Debug.hh>
31 #include <Base/Geometry/HomgPoint2D.hh>
32 #include <Base/Math/Matrix2x2.hh>
33 #include <Image/PyramidImage.hh>
34 #include <Image/TextureTransform.hh>
36 #include <Geometry/LocalAffineFrame.hh>
39 #define D_IMAGEALIGNMENT_PROGRESS 1
40 #define D_IMAGEALIGNMENT_PARAMETER 2
41 #define D_IMAGEALIGNMENT_PERPIXEL 4
42 #define D_IMAGEALIGNMENT_IMAGES 8
91 if (T_!=NULL)
delete T_;
97 { MaxIterations_ = maxiter; }
102 { MaxUpdate_ = maxerr; }
106 AffineBrightnessInvariance_ = bi;
120 int numberOfPixels = -1);
128 scale = dev2_ / dev1_;
129 shift = mean2_ - scale * mean1_;
135 LineSearch_ = lineSearch;
136 BIASASSERT(LineSearch_<1.0);
141 Dampening_ = dampening;
150 intensitySigma_ = sigma;
159 const double& pixelAccuracy = 0.3);
void SetIntensitySigma(const double &sigma)
set expected standard deviation for grey value noise
std::vector< bool > active_
void GetLastBrightnessChange(double &scale, double &shift)
return relative affine transform between i1 and i2 if AffineBrightnessInvariance was active ...
void SetAffineBrightnessInvariance(bool bi)
enable brightness variance and offset invariant computation
affine transformation of 2D image plane which relates image coordinate system and local affine featur...
class for representing parameterized image warps, such as homography, displacement, ...
std::vector< HomgPoint2D > ControlPositions_
std::vector< HomgPoint2D > ImagePositions_
double Dampening_
adds a dampening to hessian's diag: >=0: d, <0 d*largest eigvalue
void SetUpdateThreshold(const double maxerr)
if a step smaller (norm L2) than this is taken, convergence is declared and the system finishes ...
int iterationDebug_
internal counter for numbering debug images
std::vector< HomgPoint2D > TemplatePositions_
std::vector< Vector2< double > > TemplateGradients_
double intensitySigma_
how much noise is expected on intensity values
int MaxIterations_
iteration stops after
Inverse Compositional Image Alignment ("Registration")
virtual TextureTransform * Clone() const =0
virtual covariant copy constructor, caller must eventually destroy the created object ...
TextureTransform * T_
the warp model
std::vector< Vector< double > > SteepestDescentImages_
void SetLineSearch(const double &lineSearch)
enable/disable and set step width for line search: <=0 disables, 0.1 or 0.5 may be good values...
std::vector< double > TemplateGreyValues_
gradients and grey values from image 1
void SetTextureTransform(const TextureTransform &T)
pass object type which holds texture transform
bool AffineBrightnessInvariance_
compute brightness "invariant"
std::vector< double > TemplateScales_
void SetDampening(const double &dampening)
adds a dampening d to hessian's diag
double LineSearch_
if error is not reduced in one step, linesearch times this step is tried set to <=0 to disable line s...
float MaxUpdate_
iteration stops if parameter update is less than
void SetMaxIterations(const int maxiter)
number of iterations, before the system stops unsuccessfully