合并两张图片

#!  usr/bin/python
#   coding=utf-8

import numpy as np
import cv2

img = cv2.imread('/Users/jax/Desktop/invert.jpg')
img2 = cv2.imread('/Users/jax/Desktop/sl.jpg')

sigma = 0
blurred = cv2.GaussianBlur(img, (11, 11), sigma)

cv2.imwrite('blurred.jpg', blurred)

alpha = 0.7
beta = 1.0 - alpha
gamma = 0

res = cv2.addWeighted(img, alpha, img2, beta, gamma)
cv2.imwrite('res.jpg', res)

你可能感兴趣的:(合并两张图片)