current position:Home>Python numpy ValueError: setting an array element with a sequence.

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

2023-01-25 11:29:44nickdlk

ValueError: setting an array element with a sequence.

The two matrices are not aligned

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

The shape of p is (256, 256)
The shape of img is (256, 256, 3)

Intercept img into (256, 256)

image = img[:,:,0]#Deep copyimage = np.copy(img[:,::,0])

copyright notice
author[nickdlk],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2023/025/202301251105495978.html

Random recommended