ipfml.processing.movement¶
All movements that can be applied on image such as rotations, fusions, flips
Functions
fusion_images (images[, pil]) |
Fusion array of images into single image |
rotate_image (image[, angle, pil]) |
Rotate image using specific angle |
-
ipfml.processing.movement.
fusion_images
(images, pil=True)[source]¶ Fusion array of images into single image
Parameters: - images – array of images (PIL Image or Numpy array)
- pil – block type returned as PIL Image (default True)
Returns: merged image from array of images
Raises: ValueError
– if images is not an array or is emptyNumpyShapeComparisonException
– if images array contains images with different shapes
Example:
>>> import numpy as np >>> from ipfml.processing import movement >>> image_values_1 = np.random.randint(255, size=(800, 800, 3)) >>> image_values_2 = np.random.randint(255, size=(800, 800, 3)) >>> merged_image = movement.fusion_images([image_values_1, image_values_2], pil=False) >>> merged_image.shape (800, 800, 3)
-
ipfml.processing.movement.
rotate_image
(image, angle=90, pil=True)[source]¶ Rotate image using specific angle
Parameters: - image – PIL Image or Numpy array
- angle – Angle value of the rotation
- pil – block type returned as PIL Image (default True)
Returns: Image with rotation applied
Example:
>>> from PIL import Image >>> import numpy as np >>> from ipfml.processing import movement >>> image_values = Image.open('./images/test_img.png') >>> rotated_image = movement.rotate_image(image_values, 90, pil=False) >>> rotated_image.shape (200, 200, 3)