diff options
author | Sudipto Mallick <smlckz@termux-alpine> | 2024-02-10 12:49:55 +0000 |
---|---|---|
committer | Sudipto Mallick <smlckz@termux-alpine> | 2024-02-10 12:49:55 +0000 |
commit | 4182a108a01df3aa28009716472f0ef291704866 (patch) | |
tree | 8fabeb2d6ddff80b930c02b3d535b5447bbd41dc /opencv/code/a8.py | |
parent | 02884d29e4f5aea71364a203dcaecd53600d8aa4 (diff) | |
download | zadania-4182a108a01df3aa28009716472f0ef291704866.tar.gz |
Complete DIP assignments main
Diffstat (limited to 'opencv/code/a8.py')
-rw-r--r-- | opencv/code/a8.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/opencv/code/a8.py b/opencv/code/a8.py new file mode 100644 index 0000000..d1cdfb5 --- /dev/null +++ b/opencv/code/a8.py @@ -0,0 +1,10 @@ +import cv2 + +image1 = cv2.imread("9i1.jpg", cv2.IMREAD_GRAYSCALE) +image2 = cv2.imread("9i2.jpg", cv2.IMREAD_GRAYSCALE) + +assert image1.shape == image2.shape, "Input images must have the same dimensions" + +averaged_image = cv2.addWeighted(image1, 0.5, image2, 0.5, 0) + +cv2.imwrite("8o.jpg", averaged_image) |