1、add和addWeighted
:用于图像融合
cv2.add(加法)和cv2.subtract(减法)
import cv2
import numpy as np
x = np.uint8([250])
y = np.uint8([10])
print(cv2.add(x,y)) # [[255]]
print(cv2.subtract(y,x)) # [[0]]
cv2.addWeighted
import cv2
img1 = cv2.imread('img/1.jpg')
img2 = cv2.imread('img/35.jpg')
img = cv2.add(img1,img2)
dst = cv2.addWeighted(img1, 0.7, img2, 0.3, 0)
cv2.imshow("...",dst)
cv2.waitKey(0)
2、图像位运算
参数中有mask
cv2.bitwise_and:屏蔽
cv2.bitwise_or:相加
cv2.bitwise_not:取反
cv2.bitwise_xor:清零