class_docstr: Module for robust geometry estimation with RANSAC. https://en.wikipedia.org/wiki/Random_sample_consensus.
  
  Args:
      model_type: type of model to estimate: "homography", "fundamental", "fundamental_7pt",
          "homography_from_linesegments".
      inliers_threshold: threshold for the correspondence to be an inlier.
      batch_size: number of generated samples at once.
      max_iterations: maximum batches to generate. Actual number of models to try is ``batch_size * max_iterations``.
      confidence: desired confidence of the result, used for the early stopping.
      max_local_iterations: number of local optimization (polishing) iterations.
class_docstr_tok: ["Module","for","robust","geometry","estimation","with","RANSAC",".","https",":","\/\/en.wikipedia.org\/wiki\/Random_sample_consensus",".","Args",":","model_type",":","type","of","model","to","estimate",":","``","homography","''",",","``","fundamental","''",",","``","fundamental_7pt","''",",","``","homography_from_linesegments","''",".","inliers_threshold",":","threshold","for","the","correspondence","to","be","an","inlier",".","batch_size",":","number","of","generated","samples","at","once",".","max_iterations",":","maximum","batches","to","generate",".","Actual","number","of","models","to","try","is","``","batch_size","*","max_iterations","``",".","confidence",":","desired","confidence","of","the","result",",","used","for","the","early","stopping",".","max_local_iterations",":","number","of","local","optimization","(","polishing",")","iterations","."]
code: def __init__(
      self,
      model_type: str = "homography",
      inl_th: float = 2.0,
      batch_size: int = 2048,
      max_iter: int = 10,
      confidence: float = 0.99,
      max_lo_iters: int = 5,
  ) -> None:
      super().__init__()
      self.supported_models = [
          "homography",
          "fundamental",
          "fundamental_7pt",
          "homography_from_linesegments",
      ]
      self.inl_th = inl_th
      self.max_iter = max_iter
      self.batch_size = batch_size
      self.model_type = model_type
      self.confidence = confidence
      self.max_lo_iters = max_lo_iters
      self.model_type = model_type
  
      self.error_fn: Callable[..., Tensor]
      self.minimal_solver: Callable[..., Tensor]
      self.polisher_solver: Callable[..., Tensor]
  
      if model_type == "homography":
          self.error_fn = oneway_transfer_error
          self.minimal_solver = find_homography_dlt
          self.polisher_solver = find_homography_dlt_iterated
          self.minimal_sample_size = 4
      elif model_type == "homography_from_linesegments":
          self.error_fn = line_segment_transfer_error_one_way
          self.minimal_solver = find_homography_lines_dlt
          self.polisher_solver = find_homography_lines_dlt_iterated
          self.minimal_sample_size = 4
      elif model_type == "fundamental":
          self.error_fn = symmetrical_epipolar_distance
          self.minimal_solver = find_fundamental
          self.minimal_sample_size = 8
          self.polisher_solver = find_fundamental
      elif model_type == "fundamental_7pt":
          self.error_fn = symmetrical_epipolar_distance
          self.minimal_solver = partial(
              find_fundamental, method="7POINT"
          )
          self.minimal_sample_size = 7
          self.polisher_solver = find_fundamental
      else:
          raise NotImplementedError(
              f"{model_type} is unknown. Try one of {self.supported_models}"
          )
  
file_path: kornia/kornia/geometry/ransac.py
imports: import math
  from functools import partial
  from typing import Callable, Optional, Tuple
  import torch
  from kornia.core import Device, Module, Tensor, zeros
  from kornia.core.check import KORNIA_CHECK_SHAPE
  from kornia.geometry import find_fundamental, find_homography_dlt, find_homography_dlt_iterated, find_homography_lines_dlt, find_homography_lines_dlt_iterated, symmetrical_epipolar_distance
  from kornia.geometry.homography import line_segment_transfer_error_one_way, oneway_transfer_error, sample_is_valid_for_homography
label_desc: Use image node_id 1 to create a new RANSAC object from inherited base classes: Module with example: obj = RANSAC(model_type, inl_th, batch_size, max_iter, confidence, max_lo_iters)