MCPcopy
hub / github.com/aleju/imgaug / augment_image

Method augment_image

imgaug/augmenters/meta.py:739–771  ·  view source on GitHub ↗

Augment a single image. Parameters ---------- image : (H,W,C) ndarray or (H,W) ndarray The image to augment. Channel-axis is optional, but expected to be the last axis if present. In most cases, this array should be of dtype ``uint8``,

(self, image, hooks=None)

Source from the content-addressed store, hash-verified

737 return batch
738
739 def augment_image(self, image, hooks=None):
740 """Augment a single image.
741
742 Parameters
743 ----------
744 image : (H,W,C) ndarray or (H,W) ndarray
745 The image to augment.
746 Channel-axis is optional, but expected to be the last axis if
747 present. In most cases, this array should be of dtype ``uint8``,
748 which is supported by all augmenters. Support for other dtypes
749 varies by augmenter -- see the respective augmenter-specific
750 documentation for more details.
751
752 hooks : None or imgaug.HooksImages, optional
753 HooksImages object to dynamically interfere with the augmentation
754 process.
755
756 Returns
757 -------
758 ndarray
759 The corresponding augmented image.
760
761 """
762 assert ia.is_np_array(image), (
763 "Expected to get a single numpy array of shape (H,W) or (H,W,C) "
764 "for `image`. Got instead type %d. Use `augment_images(images)` "
765 "to augment a list of multiple images." % (
766 type(image).__name__),)
767 assert image.ndim in [2, 3], (
768 "Expected image to have shape (height, width, [channels]), "
769 "got shape %s." % (image.shape,))
770 iabase._warn_on_suspicious_single_image_shape(image)
771 return self.augment_images([image], hooks=hooks)[0]
772
773 def augment_images(self, images, parents=None, hooks=None):
774 """Augment a batch of images.

Callers 15

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 1

augment_imagesMethod · 0.95