aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/utils/image.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/utils/image.py')
-rw-r--r--bin/utils/image.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/utils/image.py b/bin/utils/image.py
new file mode 100644
index 0000000..1dd64cd
--- /dev/null
+++ b/bin/utils/image.py
@@ -0,0 +1,16 @@
+# Copyright 2016 (c) Egor Tensin <Egor.Tensin@gmail.com>
+# This file is part of the "Simple image filters" project.
+# For details, see https://github.com/egor-tensin/filters.
+# Distributed under the MIT License.
+
+import cv2
+
+def load_grayscale(path):
+ return cv2.imread(path, cv2.IMREAD_GRAYSCALE)
+
+def save(path, img):
+ cv2.imwrite(path, img)
+
+def show(img, window_title=None):
+ cv2.imshow(window_title, img)
+ cv2.waitKey()