class_docstr: Container for all keypoints on a single image.
  
  Parameters
  ----------
  keypoints : list of imgaug.augmentables.kps.Keypoint
      List of keypoints on the image.
  
  shape : tuple of int
      The shape of the image on which the objects are placed, i.e. the
      result of ``image.shape``.
      Should include the number of channels, not only height and width.
  
  Examples
  --------
  >>> import numpy as np
  >>> from imgaug.augmentables.kps import Keypoint, KeypointsOnImage
  >>>
  >>> image = np.zeros((70, 70))
  >>> kps = [Keypoint(x=10, y=20), Keypoint(x=34, y=60)]
  >>> kps_oi = KeypointsOnImage(kps, shape=image.shape)
class_docstr_tok: ["Container","for","all","keypoints","on","a","single","image",".","Parameters","--","--","--","--","--","keypoints",":","list","of","imgaug.augmentables.kps.Keypoint","List","of","keypoints","on","the","image",".","shape",":","tuple","of","int","The","shape","of","the","image","on","which","the","objects","are","placed",",","i.e",".","the","result","of","``","image.shape","``",".","Should","include","the","number","of","channels",",","not","only","height","and","width",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","imgaug.augmentables.kps","import","Keypoint",",","KeypointsOnImage",">",">",">",">",">",">","image","=","np.zeros","(","(","70",",","70",")",")",">",">",">","kps","=","[","Keypoint","(","x=10",",","y=20",")",",","Keypoint","(","x=34",",","y=60",")","]",">",">",">","kps_oi","=","KeypointsOnImage","(","kps",",","shape=image.shape",")"]
docstr: Create an ``(H,W,N)`` image with keypoint coordinates set to ``255``.
  
  This method generates a new ``uint8`` array of shape ``(H,W,N)``,
  where ``H`` is the ``.shape`` height, ``W`` the ``.shape`` width and
  ``N`` is the number of keypoints. The array is filled with zeros.
  The coordinate of the ``n``-th keypoint is set to ``255`` in the
  ``n``-th channel.
  
  This function can be used as a helper when augmenting keypoints with
  a method that only supports the augmentation of images.
  
  Parameters
  -------
  size : int
      Size of each (squared) point.
  
  Returns
  -------
  (H,W,N) ndarray
      Image in which the keypoints are marked. ``H`` is the height,
      defined in ``KeypointsOnImage.shape[0]`` (analogous ``W``).
      ``N`` is the number of keypoints.
docstr_tok: ["Create","an","``","(","H",",","W",",","N",")","``","image","with","keypoint","coordinates","set","to","``","255","``",".","This","method","generates","a","new","``","uint8","``","array","of","shape","``","(","H",",","W",",","N",")","``",",","where","``","H","``","is","the","``",".shape","``","height",",","``","W","``","the","``",".shape","``","width","and","``","N","``","is","the","number","of","keypoints",".","The","array","is","filled","with","zeros",".","The","coordinate","of","the","``","n","``","-th","keypoint","is","set","to","``","255","``","in","the","``","n","``","-th","channel",".","This","function","can","be","used","as","a","helper","when","augmenting","keypoints","with","a","method","that","only","supports","the","augmentation","of","images",".","Parameters","--","--","--","-","size",":","int","Size","of","each","(","squared",")","point",".","Returns","--","--","--","-","(","H",",","W",",","N",")","ndarray","Image","in","which","the","keypoints","are","marked",".","``","H","``","is","the","height",",","defined","in","``","KeypointsOnImage.shape","[","0","]","``","(","analogous","``","W","``",")",".","``","N","``","is","the","number","of","keypoints","."]
code: def to_keypoint_image(self, size=1):
      """Create an ``(H,W,N)`` image with keypoint coordinates set to ``255``.
  
      This method generates a new ``uint8`` array of shape ``(H,W,N)``,
      where ``H`` is the ``.shape`` height, ``W`` the ``.shape`` width and
      ``N`` is the number of keypoints. The array is filled with zeros.
      The coordinate of the ``n``-th keypoint is set to ``255`` in the
      ``n``-th channel.
  
      This function can be used as a helper when augmenting keypoints with
      a method that only supports the augmentation of images.
  
      Parameters
      -------
      size : int
          Size of each (squared) point.
  
      Returns
      -------
      (H,W,N) ndarray
          Image in which the keypoints are marked. ``H`` is the height,
          defined in ``KeypointsOnImage.shape[0]`` (analogous ``W``).
          ``N`` is the number of keypoints.
  
      """
      height, width = self.shape[0:2]
      image = np.zeros(
          (height, width, len(self.keypoints)), dtype=np.uint8
      )
      assert (
          size % 2 != 0
      ), "Expected 'size' to have an odd value, got %d instead." % (
          size,
      )
      sizeh = max(0, (size - 1) // 2)
      for i, keypoint in enumerate(self.keypoints):
          # TODO for float values spread activation over several cells
          # here and do voting at the end
          y = keypoint.y_int
          x = keypoint.x_int
  
          x1 = np.clip(x - sizeh, 0, width - 1)
          x2 = np.clip(x + sizeh + 1, 0, width)
          y1 = np.clip(y - sizeh, 0, height - 1)
          y2 = np.clip(y + sizeh + 1, 0, height)
  
          if x1 < x2 and y1 < y2:
              image[y1:y2, x1:x2, i] = 128
          if 0 <= y < height and 0 <= x < width:
              image[y, x, i] = 255
      return image
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  import scipy.spatial.distance
  import six.moves
  from ..None import imgaug
  from .base import IAugmentable
  from .utils import normalize_imglike_shape, project_coords, _remove_out_of_image_fraction_, _handle_on_image_shape
label_desc: Use image node_id 21 for calling the KeypointsOnImage obj's underlying member method code with example usage: obj.to_keypoint_image(size) and returns: image