Module imagingbook.common
Class LucasKanadeMatcher
java.lang.Object
imagingbook.common.image.matching.lucaskanade.LucasKanadeMatcher
- Direct Known Subclasses:
LucasKanadeForwardMatcher
,LucasKanadeInverseMatcher
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Default parameters for the containing class and its sub-classes; a (usually modified) instance of this class is passed to the constructor of a non-abstract sub-class. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the current iteration number.getMatch
(ProjectiveMapping2D Tinit) Performs the full optimization on the given image pair (I, R).Calculates the projective transformation that maps the reference image R (centered at the origin) to some other quad Q.Pnt2d[]
Returns the corner points of the bounding rectangle of R, centered at the origin.abstract double
Measures the RMS intensity difference between the reference image R and the patch in the search image I defined by the current warp Tp.abstract boolean
Checks if the matcher has converged.abstract ProjectiveMapping2D
Performs a single matching iteration on the given image pair (I, R).
-
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
Checks if the matcher has converged.- Returns:
- true if minimization criteria have been reached.
-
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
Returns the current iteration number.- Returns:
- the current iteration number
-