【发布时间】:2020-04-21 04:44:00
【问题描述】:
我有两个 ndArray。
ex:
x = np.array([110,200, 500,100])
y = np.array([50,150,30,70])
现在基于它们的价值,我创建了一个图像。
x_shape = np.max(x) #x_shape=500
y_shape = np.max(y) #y-shape=150
image = np.zeros((x_shape+1, y_shape+1))
根据我现在的数据,我的图像大小是 (501,151)
现在,如何将 (x, y) 中的数据作为 x,y 对插入?我的意思是像素值: (110,50), (200,150), (500,30), (100,70) 我希望图像是白色的,其余像素是暗的。我怎样才能做到这一点?
【问题讨论】:
标签: python numpy numpy-ndarray