#!/usr/bin/env python
import numpy as np
import argparse
import imutils
import cv2

ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="Path to the image")
args = vars(ap.parse_args())

image = cv2.imread(args["image"])
cv2.imshow("Original", image)
cv2.waitKey(0)

# resized with aspect ratio of width
r = 150.0 / image.shape[1]
dim = (150, int(image.shape[0] * r))

resized = cv2.resize(image, dim, interpolation=cv2.INTER_AREA)
cv2.imshow("Resized (width)", resized)
cv2.waitKey(0)

# resized with aspect ratio of height
r = 150.0 / image.shape[0]
dim = (int(image.shape[1] * r), 150)

resized = cv2.resize(image, dim, interpolation=cv2.INTER_AREA)
cv2.imshow("Resized (height)", resized)
cv2.waitKey(0)

resized = imutils.resize(image, width=150)
cv2.imshow("Resized (width-imutils)", resized)
cv2.waitKey(0)

resized = imutils.resize(image, height=150)
cv2.imshow("Resized (height-imutils)", resized)
cv2.waitKey(0)
