笔记
简单例子
import cv2 as cv
import numpy as np
img1=cv.imread(r"C:\Users\19583\Desktop\lingshi\1120171.jpg",cv.IMREAD_COLOR)
img2=cv.imread(r"C:\Users\19583\Desktop\lingshi\11.jpg",cv.IMREAD_COLOR)
gj1=img1
gj2=img2
# gj1[:,:,1]=0
# gj1[:,:,2]=0
# gj2[:,:,1]=0
# gj2[:,:,0]=0
cv.namedWindow('怎么你也要窗口',cv.CV_32SC3)
print(np.shape(gj1))
gj1=cv.resize(gj1,(400,500))#一定要接收一下,以后用之前看一下函数有无返回值,有返回值多半不会改
gj2=cv.resize(gj2,(400,500))
print(np.shape(gj1))
gj3=cv.addWeighted(gj1,0.4,gj2,0.6,0)
cv.imshow('怎么你也要窗口',gj3)
cv.waitKey(0)
注释掉的地方是对单个通道(某层)的数全部置零,这样这个颜色就不发光了(就看不见了)
发现那个改大小可以改变模糊程度(马赛克化)