In [1]:
import cv2
In [2]:
import matplotlib.pyplot as plt
In [3]:
img1 = cv2.imread('demo1.jpg', cv2.IMREAD_GRAYSCALE)
In [4]:
img2 = cv2.imread('nature.jpg', cv2.IMREAD_GRAYSCALE)
In [5]:
plt.figure(figsize=(10,8))
Out[5]:
In [6]:
plt.subplot(1,2,1)
Out[6]:
In [7]:
plt.title('Shooter')
Out[7]:
In [8]:
plt.imshow(img1, cmap='gray')
Out[8]:
In [9]:
plt.subplot(1,2,2)
Out[9]:
In [10]:
plt.title('Nature')
Out[10]:
In [11]:
plt.imshow(img2, cmap='gray')
Out[11]:
In [12]:
plt.show()
In [13]:
alpha = 0.3
In [14]:
img = (alpha*img1) + ((1-alpha)*img2)
In [15]:
plt.imshow(img, cmap='gray')
Out[15]:
In [16]:
plt.show()