From 13c294d32c9f5deb062fc5c51729e79dbf84be39 Mon Sep 17 00:00:00 2001 From: Arka <41378373+serapheon98@users.noreply.github.com> Date: Sun, 17 Mar 2019 10:27:03 +0530 Subject: [PATCH] Create wtfry.py To run, open the terminal up and run: $ python wtfry.py --image images/(randomimg).jpg --- wtfry.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 wtfry.py diff --git a/wtfry.py b/wtfry.py new file mode 100644 index 0000000..8f57081 --- /dev/null +++ b/wtfry.py @@ -0,0 +1,22 @@ +import numpy as np +import argparse +import cv2 + +def wtfry(image): + # split the image into its BGR components + (B, G, R) = cv2.split(image) + Max = np.maximum(np.maximum(R, G), B) + R[R < Max] = 0 + G[G < Max] = 0 + B[B < Max] = 0 + + return cv2.merge([B, G, R]) + ap = argparse.ArgumentParser() +ap.add_argument("-i", "--image", required=True, + help="path to input image") +args = vars(ap.parse_args()) + +image = cv2.imread(args["image"]) +fry = wtfry(image) +cv2.imshow("Images", np.hstack([image, fry])) +cv2.waitKey(0)