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 get_first_level(
      self, input: Tensor
  ) -> tuple[Tensor, float, float]:
      pixel_distance = 1.0
      cur_sigma = 0.5
      # Same as in OpenCV up to interpolation difference
      if self.double_image:
          x = upscale_double(input)
          pixel_distance = 0.5
          cur_sigma *= 2.0
      else:
          x = input
  
      if self.init_sigma > cur_sigma:
          sigma = max(
              math.sqrt(self.init_sigma**2 - cur_sigma**2), 0.01
          )
          ksize = self.get_kernel_size(sigma)
          cur_level = gaussian_blur2d(x, (ksize, ksize), (sigma, sigma))
          cur_sigma = self.init_sigma
      else:
          cur_level = x
      return cur_level, cur_sigma, pixel_distance
  
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 4 for calling the ScalePyramid obj's underlying member method code with example usage: obj.get_first_level(input) and returns: cur_level,  cur_sigma,  pixel_distance