diff --git a/image_processing/processing/transformation.py b/image_processing/processing/transformation.py index e69de29bb..a726ada29 100644 --- a/image_processing/processing/transformation.py +++ b/image_processing/processing/transformation.py @@ -0,0 +1,8 @@ +from skimage.transform import resize + +def resize_image(image, proportion): + assert 0 <= proportion <= 1, "Specify a valid proportion between 0 and 1." + height = round(image.shape[0] * proportion) + width = round(image.shape[1] * proportion) + image_resized = resize(image, (height, width), anti_aliasing=True) + return image_resized \ No newline at end of file