class_docstr: Object representing heatmaps on a single image.
  
  Parameters
  ----------
  arr : (H,W) ndarray or (H,W,C) ndarray
      Array representing the heatmap(s) on a single image.
      Multiple heatmaps may be provided, in which case ``C`` is expected to
      denote the heatmap index.
      The array must be of dtype ``float32``.
  
  shape : tuple of int
      Shape of the image on which the heatmap(s) is/are placed.
      **Not** the shape of the heatmap(s) array, unless it is identical
      to the image shape (note the likely difference between the arrays
      in the number of channels).
      This is expected to be ``(H, W)`` or ``(H, W, C)`` with ``C`` usually
      being ``3``.
      If there is no corresponding image, use ``(H_arr, W_arr)`` instead,
      where ``H_arr`` is the height of the heatmap(s) array
      (analogous ``W_arr``).
  
  min_value : float, optional
      Minimum value for the heatmaps that `arr` represents. This will
      usually be ``0.0``.
  
  max_value : float, optional
      Maximum value for the heatmaps that `arr` represents. This will
      usually be ``1.0``.
class_docstr_tok: ["Object","representing","heatmaps","on","a","single","image",".","Parameters","--","--","--","--","--","arr",":","(","H",",","W",")","ndarray","or","(","H",",","W",",","C",")","ndarray","Array","representing","the","heatmap","(","s",")","on","a","single","image",".","Multiple","heatmaps","may","be","provided",",","in","which","case","``","C","``","is","expected","to","denote","the","heatmap","index",".","The","array","must","be","of","dtype","``","float32","``",".","shape",":","tuple","of","int","Shape","of","the","image","on","which","the","heatmap","(","s",")","is\/are","placed",".","*","*","Not","*","*","the","shape","of","the","heatmap","(","s",")","array",",","unless","it","is","identical","to","the","image","shape","(","note","the","likely","difference","between","the","arrays","in","the","number","of","channels",")",".","This","is","expected","to","be","``","(","H",",","W",")","``","or","``","(","H",",","W",",","C",")","``","with","``","C","``","usually","being","``","3","``",".","If","there","is","no","corresponding","image",",","use","``","(","H_arr",",","W_arr",")","``","instead",",","where","``","H_arr","``","is","the","height","of","the","heatmap","(","s",")","array","(","analogous","``","W_arr","``",")",".","min_value",":","float",",","optional","Minimum","value","for","the","heatmaps","that","`","arr","`","represents",".","This","will","usually","be","``","0.0","``",".","max_value",":","float",",","optional","Maximum","value","for","the","heatmaps","that","`","arr","`","represents",".","This","will","usually","be","``","1.0","``","."]
docstr: Change the value range of a heatmap array.
  
  E.g. the value range may be changed from the interval ``[0.0, 1.0]``
  to ``[-1.0, 1.0]``.
  
  Parameters
  ----------
  arr : ndarray
      Heatmap array to modify.
  
  source : tuple of float
      Current value range of the input array, given as a
      tuple ``(min, max)``, where both are ``float`` values.
  
  target : tuple of float
      Desired output value range of the array, given as a
      tuple ``(min, max)``, where both are ``float`` values.
  
  Returns
  -------
  ndarray
      Input array, with value range projected to the desired target
      value range.
docstr_tok: ["Change","the","value","range","of","a","heatmap","array",".","E.g",".","the","value","range","may","be","changed","from","the","interval","``","[","0.0",",","1.0","]","``","to","``","[","-1.0",",","1.0","]","``",".","Parameters","--","--","--","--","--","arr",":","ndarray","Heatmap","array","to","modify",".","source",":","tuple","of","float","Current","value","range","of","the","input","array",",","given","as","a","tuple","``","(","min",",","max",")","``",",","where","both","are","``","float","``","values",".","target",":","tuple","of","float","Desired","output","value","range","of","the","array",",","given","as","a","tuple","``","(","min",",","max",")","``",",","where","both","are","``","float","``","values",".","Returns","--","--","--","-","ndarray","Input","array",",","with","value","range","projected","to","the","desired","target","value","range","."]
code: def change_normalization(cls, arr, source, target):
      """Change the value range of a heatmap array.
  
      E.g. the value range may be changed from the interval ``[0.0, 1.0]``
      to ``[-1.0, 1.0]``.
  
      Parameters
      ----------
      arr : ndarray
          Heatmap array to modify.
  
      source : tuple of float
          Current value range of the input array, given as a
          tuple ``(min, max)``, where both are ``float`` values.
  
      target : tuple of float
          Desired output value range of the array, given as a
          tuple ``(min, max)``, where both are ``float`` values.
  
      Returns
      -------
      ndarray
          Input array, with value range projected to the desired target
          value range.
  
      """
      assert ia.is_np_array(
          arr
      ), "Expected 'arr' to be an ndarray, got type %s." % (type(arr),)
  
      def _validate_tuple(arg_name, arg_value):
          assert isinstance(arg_value, tuple), (
              "'%s' was not a HeatmapsOnImage instance, "
              "expected type tuple then. Got type %s."
              % (
                  arg_name,
                  type(arg_value),
              )
          )
          assert len(arg_value) == 2, (
              "Expected tuple '%s' to contain exactly two entries, "
              "got %d."
              % (
                  arg_name,
                  len(arg_value),
              )
          )
          assert arg_value[0] < arg_value[1], (
              "Expected tuple '%s' to have two entries with "
              "entry 1 < entry 2, got values %.4f and %.4f."
              % (arg_name, arg_value[0], arg_value[1])
          )
  
      if isinstance(source, HeatmapsOnImage):
          source = (source.min_value, source.max_value)
      else:
          _validate_tuple("source", source)
  
      if isinstance(target, HeatmapsOnImage):
          target = (target.min_value, target.max_value)
      else:
          _validate_tuple("target", target)
  
      # Check if source and target are the same (with a tiny bit of
      # tolerance) if so, evade compuation and just copy the array instead.
      # This is reasonable, as source and target will often both
      # be (0.0, 1.0).
      eps = np.finfo(arr.dtype).eps
      mins_same = (
          source[0] - 10 * eps < target[0] < source[0] + 10 * eps
      )
      maxs_same = (
          source[1] - 10 * eps < target[1] < source[1] + 10 * eps
      )
      if mins_same and maxs_same:
          return np.copy(arr)
  
      min_source, max_source = source
      min_target, max_target = target
  
      diff_source = max_source - min_source
      diff_target = max_target - min_target
  
      arr_0to1 = (arr - min_source) / diff_source
      arr_target = min_target + arr_0to1 * diff_target
  
      return arr_target
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  import six.moves
  from ..None import imgaug
  from .base import IAugmentable
label_desc: Use image node_id 15 for calling the HeatmapsOnImage obj's underlying member method code with example usage: obj.change_normalization(cls, arr, source, target) and returns: arr_target, np