为什么用相同的数组形状广播错误

时间:2017-09-15 06:01:30

标签: python opencv

img1 = cv2.imread("lena.jpg")
img2 = cv2.imread('rsz_katrina.jpg')

img1+img2


ValueError                                
Traceback (most recent call last)
<ipython-input-46-475bd2d47c0f> in <module>()
      2 img2 = cv2.imread('rsz_katrina.jpg')
      3 
----> 4 img1+img2

ValueError: operands could not be broadcast together with shapes (225,225,3) (255,255,3) 

1 个答案:

答案 0 :(得分:1)

仔细查看错误消息中的尺寸:尺寸不同(225和255)。