-
Notifications
You must be signed in to change notification settings - Fork 0
/
Blending images
30 lines (25 loc) · 793 Bytes
/
Blending images
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import matplotlib.pyplot as plt
import cv2
def main():
path = "C:\\Users\\edkni\\Downloads\\image_processing_files\\Dataset\\"
imgpath1 = path + "4.2.01.tiff"
imgpath2 = path + "4.2.03.tiff"
img1 = cv2.imread(imgpath1,1)
img2 = cv2.imread(imgpath2,1)
img1 = cv2.cvtColor(img1,cv2.COLOR_BGR2RGB)
img2 = cv2.cvtColor(img2,cv2.COLOR_BGR2RGB)
alpha = 0.5
beta = 0.5
gamma = 0
output = cv2.addWeighted(img1,alpha,img2,beta,gamma)
title = ["Liquid drop","mandriel color","Blending image"]
images = [img1,img2,output]
for i in range(3):
plt.subplot(1,3,i+1)
plt.imshow(images[i])
plt.title(title[i])
plt.xticks([])
plt.yticks([])
plt.show()
if __name__ == "__main__":
main()