Class LucasKanadeMatcher

java.lang.Object
imagingbook.common.image.matching.lucaskanade.LucasKanadeMatcher
Direct Known Subclasses:
LucasKanadeForwardMatcher, LucasKanadeInverseMatcher

public abstract class LucasKanadeMatcher extends Object

This is the common super-class for different variants of the Lucas-Kanade matcher [1]. See Ch. 24 of [2] for additional details.

[1] B. D. Lucas and T. Kanade. "An iterative image registration technique with an application to stereo vision". In Proceedings of the 7th International Joint Conference on Artificial Intelligence IJCAI’81, pp. 674–679, Vancouver, BC (1981).
[2] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/12/16
  • Method Details

    • getReferenceMappingTo

      Calculates the projective transformation that maps the reference image R (centered at the origin) to some other quad Q.
      Parameters:
      Q - an arbitrary quad (should be inside the search image I)
      Returns:
      the transformation from R's bounding rectangle to Q
    • getReferencePoints

      Returns the corner points of the bounding rectangle of R, centered at the origin.
      Returns:
      the corner points of the bounding rectangle of R
    • getMatch

      Performs the full optimization on the given image pair (I, R).
      Parameters:
      Tinit - the transformation from the reference image R to the initial search patch, assuming that R is centered at the coordinate origin!
      Returns:
      the transformation to the best-matching patch in the search image I (again assuming that R is centered at the coordinate origin) or null if no match was found.
    • iterateOnce

      Performs a single matching iteration on the given image pair (I, R).
      Parameters:
      Tp - the warp transformation from the reference image R to the initial search patch, assuming that R is centered at the coordinate origin!
      Returns:
      a new warp transformation (again assuming that R is centered at the coordinate origin) or null if the iteration was unsuccessful.
    • hasConverged

      public abstract boolean hasConverged()
      Checks if the matcher has converged.
      Returns:
      true if minimization criteria have been reached.
    • getRmsError

      public abstract double getRmsError()
      Measures the RMS intensity difference between the reference image R and the patch in the search image I defined by the current warp Tp.
      Returns:
      the RMS error under the current warp
    • getIteration

      public int getIteration()
      Returns the current iteration number.
      Returns:
      the current iteration number