Skip to content

Commit

Permalink
added resize_image function
Browse files Browse the repository at this point in the history
  • Loading branch information
Karina Tiemi committed Jul 5, 2020
1 parent 4fcb9db commit 2a47a53
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions image_processing/processing/transformation.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2a47a53

Please sign in to comment.