signed

QiShunwang

“诚信为本、客户至上”

Python numpy ValueError: setting an array element with a sequence.

2021/4/26 22:36:29   来源:

ValueError: setting an array element with a sequence.

两个矩阵没有对齐

p[x, y] = img[i, j]

p的shape是(256, 256)
img的shape是(256, 256, 3)

将img截取成(256, 256)

image = img[:,:,0]
#深复制
image = np.copy(img[:,:,0])