Take 2 images and combine it to form a single image & Take 2 images, crop some part of both the images and swap them.
#Import packages
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
def show(p):
cv2.imshow("Image", p)
cv2.waitKey()
cv2.destroyAllWindows()
#image 1
pic1 = mpimg.imread('omen.jpg')
plt.title('Orignal')
plt.imshow(pic1)
show(pic1)
#Image2
pic2 = mpimg.imread('Chamber.jpg')
plt.title('Orignal')
plt.imshow(pic2)
show(pic2)
#Now Combine the image
merge = np.hstack((pic1,pic2))
plt.imshow(merge)
show(merge)
Comments
Post a Comment