From a06bae3e89a472a98ea80a9cf4470c0e66ceed9f Mon Sep 17 00:00:00 2001 From: Aditya Rakhecha Date: Mon, 21 Jan 2019 22:28:57 +0530 Subject: [PATCH] Create openGenus_mark.py Initial code added, it can be further altered to make it compatible to main script. The default ON option is to be added on main script file. --- openGenus_mark.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 openGenus_mark.py diff --git a/openGenus_mark.py b/openGenus_mark.py new file mode 100644 index 0000000..3a233cd --- /dev/null +++ b/openGenus_mark.py @@ -0,0 +1,34 @@ +import numpy as np +import cv2 + +img = cv2.imread("input.jpg", cv2.IMREAD_UNCHANGED) + +#print('Original Dimensions : ',img.shape) + +scale_percent = 60 # percent of original size +width = int(img.shape[1] * scale_percent / 100) +height = int(img.shape[0] * scale_percent / 100) +dim = (width, height) +# resize image +resized = cv2.resize(img, dim, interpolation = cv2.INTER_AREA) + +#print('New Dimensions : ',img.shape) + +font = cv2.FONT_HERSHEY_SIMPLEX +bottomRightCornerOfText = (220,440) +fontScale = 1 +fontColor = (0,255,255) +lineType = 2 + +cv2.putText(img,'OpenGenus.org', + bottomRightCornerOfText, + font, + fontScale, + fontColor, + lineType) + +cv2.imshow("img",img) + +cv2.imwrite("dst.jpg", img) + +cv2.waitKey(0)