could not broadcast input array from shape (2464,3280) into shape (2464,3280,3)

问题描述

  在could not broadcast input array from shape (2464,3280) into shape (2464,3280,3)
could not broadcast input array from shape (2464,3280) into shape (2464,3280,3)_第1张图片

解决方案:

  经过报错分析,就是不能把(2464,3280)的图像数据传入(2464,3280,3)的数据类型中,经过对数据的分析可得:

imgL = cv2.imread('test1.png',0)
print(imgL.shape)

在这里插入图片描述

imgL = cv2.imread('test1.png')
print(imgL.shape)

在这里插入图片描述
  原因是灰度化的图像无法传入三通道的数组。

你可能感兴趣的:(python小问题,python,opencv)