class_docstr: Blur/Denoise an image using a bilateral filter.
  
  Bilateral filters blur homogenous and textured areas, while trying to
  preserve edges.
  
  See
  http://docs.opencv.org/2.4/modules/imgproc/doc/filtering.html#bilateralfilter
  for more information regarding the parameters.
  
  **Supported dtypes**:
  
      * ``uint8``: yes; not tested
      * ``uint16``: ?
      * ``uint32``: ?
      * ``uint64``: ?
      * ``int8``: ?
      * ``int16``: ?
      * ``int32``: ?
      * ``int64``: ?
      * ``float16``: ?
      * ``float32``: ?
      * ``float64``: ?
      * ``float128``: ?
      * ``bool``: ?
  
  Parameters
  ----------
  d : int or tuple of int or list of int or imgaug.parameters.StochasticParameter, optional
      Diameter of each pixel neighborhood with value range ``[1 .. inf)``.
      High values for `d` lead to significantly worse performance. Values
      equal or less than ``10`` seem to be good. Use ``<5`` for real-time
      applications.
  
          * If a single ``int``, then that value will be used for the
            diameter.
          * If a tuple of two ``int`` s ``(a, b)``, then the diameter will
            be a value sampled from the interval ``[a..b]``.
          * If a list, then a random value will be sampled from that list
            per image.
          * If a ``StochasticParameter``, then ``N`` samples will be drawn
            from that parameter per ``N`` input images, each representing
            the diameter for the n-th image. Expected to be discrete.
  
  sigma_color : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
      Filter sigma in the color space with value range ``[1, inf)``. A
      large value of the parameter means that farther colors within the
      pixel neighborhood (see `sigma_space`) will be mixed together,
      resulting in larger areas of semi-equal color.
  
          * If a single ``int``, then that value will be used for the
            diameter.
          * If a tuple of two ``int`` s ``(a, b)``, then the diameter will
            be a value sampled from the interval ``[a, b]``.
          * If a list, then a random value will be sampled from that list
            per image.
          * If a ``StochasticParameter``, then ``N`` samples will be drawn
            from that parameter per ``N`` input images, each representing
            the diameter for the n-th image. Expected to be discrete.
  
  sigma_space : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
      Filter sigma in the coordinate space with value range ``[1, inf)``. A
      large value of the parameter means that farther pixels will influence
      each other as long as their colors are close enough (see
      `sigma_color`).
  
          * If a single ``int``, then that value will be used for the
            diameter.
          * If a tuple of two ``int`` s ``(a, b)``, then the diameter will
            be a value sampled from the interval ``[a, b]``.
          * If a list, then a random value will be sampled from that list
            per image.
          * If a ``StochasticParameter``, then ``N`` samples will be drawn
            from that parameter per ``N`` input images, each representing
            the diameter for the n-th image. Expected to be discrete.
  
  seed : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
      See :func:`~imgaug.augmenters.meta.Augmenter.__init__`.
  
  name : None or str, optional
      See :func:`~imgaug.augmenters.meta.Augmenter.__init__`.
  
  random_state : None or int or imgaug.random.RNG or numpy.random.Generator or numpy.random.BitGenerator or numpy.random.SeedSequence or numpy.random.RandomState, optional
      Old name for parameter `seed`.
      Its usage will not yet cause a deprecation warning,
      but it is still recommended to use `seed` now.
      Outdated since 0.4.0.
  
  deterministic : bool, optional
      Deprecated since 0.4.0.
      See method ``to_deterministic()`` for an alternative and for
      details about what the "deterministic mode" actually does.
  
  Examples
  --------
  >>> import imgaug.augmenters as iaa
  >>> aug = iaa.BilateralBlur(
  >>>     d=(3, 10), sigma_color=(10, 250), sigma_space=(10, 250))
  
  Blur all images using a bilateral filter with a `max distance` sampled
  uniformly from the interval ``[3, 10]`` and wide ranges for `sigma_color`
  and `sigma_space`.
class_docstr_tok: ["Blur\/Denoise","an","image","using","a","bilateral","filter",".","Bilateral","filters","blur","homogenous","and","textured","areas",",","while","trying","to","preserve","edges",".","See","http",":","\/\/docs.opencv.org\/2.4\/modules\/imgproc\/doc\/filtering.html","#","bilateralfilter","for","more","information","regarding","the","parameters",".","*","*","Supported","dtypes","*","*",":","*","``","uint8","``",":","yes",";","not","tested","*","``","uint16","``",":","?","*","``","uint32","``",":","?","*","``","uint64","``",":","?","*","``","int8","``",":","?","*","``","int16","``",":","?","*","``","int32","``",":","?","*","``","int64","``",":","?","*","``","float16","``",":","?","*","``","float32","``",":","?","*","``","float64","``",":","?","*","``","float128","``",":","?","*","``","bool","``",":","?","Parameters","--","--","--","--","--","d",":","int","or","tuple","of","int","or","list","of","int","or","imgaug.parameters.StochasticParameter",",","optional","Diameter","of","each","pixel","neighborhood","with","value","range","``","[","1","..","inf",")","``",".","High","values","for","`","d","`","lead","to","significantly","worse","performance",".","Values","equal","or","less","than","``","10","``","seem","to","be","good",".","Use","``","<","5","``","for","real-time","applications",".","*","If","a","single","``","int","``",",","then","that","value","will","be","used","for","the","diameter",".","*","If","a","tuple","of","two","``","int","``","s","``","(","a",",","b",")","``",",","then","the","diameter","will","be","a","value","sampled","from","the","interval","``","[","a","..","b","]","``",".","*","If","a","list",",","then","a","random","value","will","be","sampled","from","that","list","per","image",".","*","If","a","``","StochasticParameter","``",",","then","``","N","``","samples","will","be","drawn","from","that","parameter","per","``","N","``","input","images",",","each","representing","the","diameter","for","the","n-th","image",".","Expected","to","be","discrete",".","sigma_color",":","number","or","tuple","of","number","or","list","of","number","or","imgaug.parameters.StochasticParameter",",","optional","Filter","sigma","in","the","color","space","with","value","range","``","[","1",",","inf",")","``",".","A","large","value","of","the","parameter","means","that","farther","colors","within","the","pixel","neighborhood","(","see","`","sigma_space","`",")","will","be","mixed","together",",","resulting","in","larger","areas","of","semi-equal","color",".","*","If","a","single","``","int","``",",","then","that","value","will","be","used","for","the","diameter",".","*","If","a","tuple","of","two","``","int","``","s","``","(","a",",","b",")","``",",","then","the","diameter","will","be","a","value","sampled","from","the","interval","``","[","a",",","b","]","``",".","*","If","a","list",",","then","a","random","value","will","be","sampled","from","that","list","per","image",".","*","If","a","``","StochasticParameter","``",",","then","``","N","``","samples","will","be","drawn","from","that","parameter","per","``","N","``","input","images",",","each","representing","the","diameter","for","the","n-th","image",".","Expected","to","be","discrete",".","sigma_space",":","number","or","tuple","of","number","or","list","of","number","or","imgaug.parameters.StochasticParameter",",","optional","Filter","sigma","in","the","coordinate","space","with","value","range","``","[","1",",","inf",")","``",".","A","large","value","of","the","parameter","means","that","farther","pixels","will","influence","each","other","as","long","as","their","colors","are","close","enough","(","see","`","sigma_color","`",")",".","*","If","a","single","``","int","``",",","then","that","value","will","be","used","for","the","diameter",".","*","If","a","tuple","of","two","``","int","``","s","``","(","a",",","b",")","``",",","then","the","diameter","will","be","a","value","sampled","from","the","interval","``","[","a",",","b","]","``",".","*","If","a","list",",","then","a","random","value","will","be","sampled","from","that","list","per","image",".","*","If","a","``","StochasticParameter","``",",","then","``","N","``","samples","will","be","drawn","from","that","parameter","per","``","N","``","input","images",",","each","representing","the","diameter","for","the","n-th","image",".","Expected","to","be","discrete",".","seed",":","None","or","int","or","imgaug.random.RNG","or","numpy.random.Generator","or","numpy.random.BitGenerator","or","numpy.random.SeedSequence","or","numpy.random.RandomState",",","optional","See",":","func",":","`","~imgaug.augmenters.meta.Augmenter.__init__","`",".","name",":","None","or","str",",","optional","See",":","func",":","`","~imgaug.augmenters.meta.Augmenter.__init__","`",".","random_state",":","None","or","int","or","imgaug.random.RNG","or","numpy.random.Generator","or","numpy.random.BitGenerator","or","numpy.random.SeedSequence","or","numpy.random.RandomState",",","optional","Old","name","for","parameter","`","seed","`",".","Its","usage","will","not","yet","cause","a","deprecation","warning",",","but","it","is","still","recommended","to","use","`","seed","`","now",".","Outdated","since","0.4.0.","deterministic",":","bool",",","optional","Deprecated","since","0.4.0",".","See","method","``","to_deterministic","(",")","``","for","an","alternative","and","for","details","about","what","the","``","deterministic","mode","''","actually","does",".","Examples","--","--","--","--",">",">",">","import","imgaug.augmenters","as","iaa",">",">",">","aug","=","iaa.BilateralBlur","(",">",">",">","d=","(","3",",","10",")",",","sigma_color=","(","10",",","250",")",",","sigma_space=","(","10",",","250",")",")","Blur","all","images","using","a","bilateral","filter","with","a","`","max","distance","`","sampled","uniformly","from","the","interval","``","[","3",",","10","]","``","and","wide","ranges","for","`","sigma_color","`","and","`","sigma_space","`","."]
code: def _augment_batch_(self, batch, random_state, parents, hooks):
      # pylint: disable=invalid-name
      if batch.images is None:
          return batch
  
      images = batch.images
  
      # Make sure that all images have 3 channels
      assert all([image.shape[2] == 3 for image in images]), (
          "BilateralBlur can currently only be applied to images with 3 "
          "channels. Got channels: %s"
          % ([image.shape[2] for image in images],)
      )
  
      nb_images = len(images)
      rss = random_state.duplicate(3)
      samples_d = self.d.draw_samples((nb_images,), random_state=rss[0])
      samples_sigma_color = self.sigma_color.draw_samples(
          (nb_images,), random_state=rss[1]
      )
      samples_sigma_space = self.sigma_space.draw_samples(
          (nb_images,), random_state=rss[2]
      )
      gen = enumerate(
          zip(
              images,
              samples_d,
              samples_sigma_color,
              samples_sigma_space,
          )
      )
      for i, (image, di, sigma_color_i, sigma_space_i) in gen:
          has_zero_sized_axes = image.size == 0
          if di != 1 and not has_zero_sized_axes:
              batch.images[i] = cv2.bilateralFilter(
                  _normalize_cv2_input_arr_(image),
                  di,
                  sigma_color_i,
                  sigma_space_i,
              )
      return batch
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  from scipy import ndimage
  import cv2
  import six.moves
  import imgaug
  from imgaug.imgaug import _normalize_cv2_input_arr_
  from .None import meta
  from .None import convolutional
  from ..None import parameters
  from ..None import dtypes
label_desc: Use image node_id 2 for calling the BilateralBlur obj's underlying member method code with example usage: obj._augment_batch_(batch, random_state, parents, hooks) and returns: batch, batch