def max_samples_by_conf(n_inl: int, num_tc: int, sample_size: int, conf: float) -> float:
        """Update max_iter to stop iterations earlier https://en.wikipedia.org/wiki/Random_sample_consensus."""
        eps = 1e-9
        if num_tc <= sample_size:
            return 1.0
        if n_inl == num_tc:
            return 1.0
        return math.log(1.0 - conf) / min(-eps, math.log(max(eps, 1.0 - math.pow(n_inl / num_tc, sample_size))))
Update max_iter to stop iterations earlier https://en.wikipedia.org/wiki/Random_sample_consensus.
kornia/geometry/ransac.py