Created
October 27, 2021 06:41
-
-
Save Nithilaa/bcbf6050a57ab8c3170d20ae31d21df8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
img1 = cv2.imread('image1_add.jpg', 1) | |
#or | |
#img1 = cv2.imread('C:\\Users\\Admin\\Downloads\\image1_add.jpg', 1) | |
cv2.imshow('Image 1', img1) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() | |
img2 = cv2.imread('image2_add.jpg', 1) | |
#or | |
#img2 = cv2.imread('C:\\Users\\Admin\\Downloads\\image2_add.jpg', 1) | |
cv2.imshow('Image 2', img2) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() | |
#Addition - weighted addition | |
added_wt_img = cv2.addWeighted(img1, 0.6, img2, 0.4, 0) | |
cv2.imshow('Added Weight Image', added_wt_img) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment