Created
October 27, 2021 06:57
-
-
Save Nithilaa/9085b7774793159aea79f5ce8a1c1b4b 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 | |
#read the images | |
img1 = cv2.imread('bitwise_image_1.jpg') | |
img2 = cv2.imread('bitwise_image_2.jpg') | |
bitwise_AND = cv2.bitwise_and(img1, img2) | |
bitwise_OR = cv2.bitwise_or(img1, img2) | |
bitwise_NOT = cv2.bitwise_not(img1) | |
cv2.imshow('img1', img1) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() | |
cv2.imshow('img2', img2) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() | |
cv2.imshow('AND', bitwise_AND) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() | |
cv2.imshow('OR', bitwise_OR) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() | |
cv2.imshow('NOT', bitwise_NOT) | |
cv2.waitKey(0) | |
cv2.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment