我有一个像这样的形象(numpy.ndarray):
In : print(img.shape)
Out : (240, 320, 1)
In : print(img) # The output it's simplified
Out:[[[121]
[119]
[118]
...,
[ 39]
[ 43]
[ 44]]
我需要添加副本,如下所示:
shape (240, 320, 3)
[[[121 121 121]
[119 119 119]
[118 118 118]
...,
[ 39 39 39]
[ 43 43 43]
[ 44 44 44]]
有关如何实现这一目标的任何提示?