fn_alignimage

Contents

Syntax

[[s grid] =] fn_alignimage(a,b[,shift[,'nouser']]['slider|edit'])

Description

display a superposition of gray-level images a and b, and allow to move
image b (includes translation, rotation and rescaling)
Input:
- a       reference image
- b       images for which the transformation with respect to a should be
          estimated
- shift   initialization of the translation part of the transformation
          [default=[0 0]]
- 'nouser'    only show the superposition, and return without showing
          controls that allow user to change the parameters of the
          transformation
- 'slider|edit'   specify the type of controls to use: 'slider' [default]
          is faster and smoother to use compared to 'edit', but less
          precise
Output:
- s       structure with translation, rotation and rescaling parameters
          note that rotation and rescaling are to be performed centered
          on the center of the image
- grid    interpolation grid: to realign b onto a use the command
          breg = interpn(b,gridb(:,:,1),gridb(:,:,2),'linear',0);
Example:
  load trees,
  Y = interp2(1:350,(1:258)',X,-4.3:344.7,(13:270)');
  shift=fn_alignimage(X,Y)

Source

Thomas Deneux

Copyright 2011-2017