class_docstr: Create an scale pyramid of image, usually used for local feature detection.
  
  Images are consequently smoothed with Gaussian blur and downscaled.
  
  Args:
      n_levels: number of the levels in octave.
      init_sigma: initial blur level.
      min_size: the minimum size of the octave in pixels.
      double_image: add 2x upscaled image as 1st level of pyramid. OpenCV SIFT does this.
  
  Returns:
      1st output: images
      2nd output: sigmas (coefficients for scale conversion)
      3rd output: pixelDists (coefficients for coordinate conversion)
  
  Shape:
      - Input: :math:`(B, C, H, W)`
      - Output 1st: :math:`[(B, C, NL, H, W), (B, C, NL, H/2, W/2), ...]`
      - Output 2nd: :math:`[(B, NL), (B, NL), (B, NL), ...]`
      - Output 3rd: :math:`[(B, NL), (B, NL), (B, NL), ...]`
  
  Examples:
      >>> input = torch.rand(2, 4, 100, 100)
      >>> sp, sigmas, pds = ScalePyramid(3, 15)(input)
class_docstr_tok: ["Create","an","scale","pyramid","of","image",",","usually","used","for","local","feature","detection",".","Images","are","consequently","smoothed","with","Gaussian","blur","and","downscaled",".","Args",":","n_levels",":","number","of","the","levels","in","octave",".","init_sigma",":","initial","blur","level",".","min_size",":","the","minimum","size","of","the","octave","in","pixels",".","double_image",":","add","2x","upscaled","image","as","1st","level","of","pyramid",".","OpenCV","SIFT","does","this",".","Returns",":","1st","output",":","images","2nd","output",":","sigmas","(","coefficients","for","scale","conversion",")","3rd","output",":","pixelDists","(","coefficients","for","coordinate","conversion",")","Shape",":","-","Input",":",":","math",":","`","(","B",",","C",",","H",",","W",")","`","-","Output","1st",":",":","math",":","`","[","(","B",",","C",",","NL",",","H",",","W",")",",","(","B",",","C",",","NL",",","H\/2",",","W\/2",")",",","...","]","`","-","Output","2nd",":",":","math",":","`","[","(","B",",","NL",")",",","(","B",",","NL",")",",","(","B",",","NL",")",",","...","]","`","-","Output","3rd",":",":","math",":","`","[","(","B",",","NL",")",",","(","B",",","NL",")",",","(","B",",","NL",")",",","...","]","`","Examples",":",">",">",">","input","=","torch.rand","(","2",",","4",",","100",",","100",")",">",">",">","sp",",","sigmas",",","pds","=","ScalePyramid","(","3",",","15",")","(","input",")"]
code: def __init__(
      self,
      n_levels: int = 3,
      init_sigma: float = 1.6,
      min_size: int = 15,
      double_image: bool = False,
  ) -> None:
      super().__init__()
      # 3 extra levels are needed for DoG nms.
      self.n_levels = n_levels
      self.extra_levels: int = 3
      self.init_sigma = init_sigma
      self.min_size = min_size
      self.border = min_size // 2 - 1
      self.sigma_step = 2 ** (1.0 / float(self.n_levels))
      self.double_image = double_image
  
imports: from __future__ import annotations
  import math
  import torch
  import torch.nn.functional
  from kornia.core import Module, Tensor, ones, pad, stack, tensor, zeros
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_SHAPE
  from kornia.filters import filter2d, gaussian_blur2d
label_desc: Use image node_id 1 to create a new ScalePyramid object from inherited base classes: Module with example: obj = ScalePyramid(n_levels, init_sigma, min_size, double_image)