Created
October 27, 2021 06:45
-
-
Save Nithilaa/fe978b336085f426fb599e937b762219 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() | |
sub_img = cv2.subtract(img1, img2) | |
cv2.imshow('Subtracted Image', sub_img) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment