From 4182a108a01df3aa28009716472f0ef291704866 Mon Sep 17 00:00:00 2001 From: Sudipto Mallick Date: Sat, 10 Feb 2024 12:49:55 +0000 Subject: Complete DIP assignments --- opencv/code/a8.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 opencv/code/a8.py (limited to 'opencv/code/a8.py') 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) -- cgit 1.4.1-2-gfad0