class_docstr: Stitch two images with overlapping fields of view.
  
  Args:
      matcher: image feature matching module.
      estimator: method to compute homography, either "vanilla" or "ransac".
          "ransac" is slower with a better accuracy.
      blending_method: method to blend two images together.
          Only "naive" is currently supported.
  
  Note:
      Current implementation requires strict image ordering from left to right.
  
  .. code-block:: python
  
      IS = ImageStitcher(KF.LoFTR(pretrained='outdoor'), estimator='ransac').cuda()
      # Compute the stitched result with less GPU memory cost.
      with torch.inference_mode():
          out = IS(img_left, img_right)
      # Show the result
      plt.imshow(K.tensor_to_image(out))
class_docstr_tok: ["Stitch","two","images","with","overlapping","fields","of","view",".","Args",":","matcher",":","image","feature","matching","module",".","estimator",":","method","to","compute","homography",",","either","``","vanilla","''","or","``","ransac","''",".","``","ransac","''","is","slower","with","a","better","accuracy",".","blending_method",":","method","to","blend","two","images","together",".","Only","``","naive","''","is","currently","supported",".","Note",":","Current","implementation","requires","strict","image","ordering","from","left","to","right",".","..","code-block",":",":","python","IS","=","ImageStitcher","(","KF.LoFTR","(","pretrained='outdoor","'",")",",","estimator='ransac","'",")",".cuda","(",")","#","Compute","the","stitched","result","with","less","GPU","memory","cost",".","with","torch.inference_mode","(",")",":","out","=","IS","(","img_left",",","img_right",")","#","Show","the","result","plt.imshow","(","K.tensor_to_image","(","out",")",")"]
code: def stitch_pair(
      self,
      images_left: Tensor,
      images_right: Tensor,
      mask_left: Optional[Tensor] = None,
      mask_right: Optional[Tensor] = None,
  ) -> Tuple[Tensor, Tensor]:
      # Compute the transformed images
      input_dict = self.preprocess(images_left, images_right)
      out_shape = (
          images_left.shape[-2],
          images_left.shape[-1] + images_right.shape[-1],
      )
      correspondences = self.on_matcher(input_dict)
      homo = self.estimate_transform(**correspondences)
      src_img = warp_perspective(images_right, homo, out_shape)
      dst_img = concatenate([images_left, zeros_like(images_right)], -1)
  
      # Compute the transformed masks
      if mask_left is None:
          mask_left = torch.ones_like(images_left)
      if mask_right is None:
          mask_right = torch.ones_like(images_right)
      # 'nearest' to ensure no floating points in the mask
      src_mask = warp_perspective(
          mask_right, homo, out_shape, mode="nearest"
      )
      dst_mask = concatenate([mask_left, zeros_like(mask_right)], -1)
      return self.blend_image(src_img, dst_img, src_mask), (
          dst_mask + src_mask
      ).bool().to(src_mask.dtype)
  
file_path: kornia/kornia/contrib/image_stitching.py
imports: from typing import Dict, Optional, Tuple
  import torch
  from kornia.color import rgb_to_grayscale
  from kornia.core import Module, Tensor, concatenate, where, zeros_like
  from kornia.feature import LocalFeatureMatcher, LoFTR
  from kornia.geometry.homography import find_homography_dlt_iterated
  from kornia.geometry.ransac import RANSAC
  from kornia.geometry.transform import warp_perspective
label_desc: Use image node_id 8 for calling the ImageStitcher obj's underlying member method code with example usage: obj.stitch_pair(images_left, images_right, mask_left, mask_right) and returns: self,  unknown