Skip to content

Instantly share code, notes, and snippets.

@Nithilaa
Created October 27, 2021 06:41
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Nithilaa/bcbf6050a57ab8c3170d20ae31d21df8 to your computer and use it in GitHub Desktop.
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