FeatureMatch.estimate#

FeatureMatch.estimate(func: Any, method: str = 'ransac', **args: Any) → tuple[Any, ...][source][source]#

Estimate a geometric relationship from the matches

Parameters:
  • func – estimation function, for example points2F or points2H

  • method – robust estimation method passed to func, defaults to "ransac"

  • args – further options passed to func

Returns:

the estimate and any other values that func returns, but not the inlier mask if there is one

Calls func(p1, p2, method=method, **args) with the corresponding points. If the last value that func returns is an inlier mask, a boolean array with one element per match, which the robust methods "ransac" and "lmeds" return, it is kept as the inlier status of the matches (see inliers and outliers) and is not returned. Otherwise, for example with method="8p", everything that func returns is returned and the inlier status is cleared.

Changed in version 2.5.0: A non-robust method used to lose its last return value (the residual, or the estimate itself if there was no residual) and leave it as the inlier status.

Examples

F, resid = matches.estimate(CentralCamera.points2F, method="ransac", confidence=0.95)