Third commit

This commit is contained in:
lan daiqing
2022-07-26 21:27:11 +08:00
commit 079dd34037
11 changed files with 554 additions and 0 deletions

25
Image_Mix.py Normal file
View File

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# @Time : 2022-7-26 0026 17:44
# @Author : Qing
# @Email : derighoid@gmail.com
# @File : Image_Mix.py
# @Software: PyCharm
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
import cv2
# 阿尔法图像混合
def imageMix(imagePath1, imagePath2):
img1 = Image.open(imagePath1)
im1 = np.array(img1)
img2 = Image.open(imagePath2)
im2 = np.array(img2)
img3 = cv2.addWeighted(im1, 0.8, im2, 0.3, 0)
plt.imshow(img3)
Image.fromarray(np.uint8(img3)).save("./data/picture14.png")
plt.show()