I used python's list to add multiple numpy.array images read by opencv:
[array([[[167, 145, 121],
[164, 142, 118],
[167, 145, 121],
...,
[248, 243, 214],
[246, 242, 213],
[249, 245, 216]],
[[172, 150, 126],
[168, 146, 122],
[163, 141, 117],
...,
[249, 244, 214],
[246, 242, 213],
[248, 244, 215]],
...,]
I want to turn the outermost list into a numpy array, that is, a 4-axis tensor np.array:
array([[[[167, 145, 121],
[164, 142, 118],
[167, 145, 121],
...,
[248, 243, 214],
[246, 242, 213],
[249, 245, 216]],
[[168, 146, 122],
[164, 142, 118],
[164, 142, 118],
...,
[248, 243, 214],
[246, 242, 213],
[249, 245, 216]],
[[172, 150, 126],
[168, 146, 122],
[163, 141, 117],
...,
[249, 244, 214],
[246, 242, 213],
[248, 244, 215]],
...,]
However, if I use np.array(mylist) directly, it becomes:
array([array([[[167, 145, 121],
[164, 142, 118],
[167, 145, 121],
...,
[248, 243, 214],
[246, 242, 213],
[249, 245, 216]],
[[168, 146, 122],
[164, 142, 118],
[164, 142, 118],
...,
[248, 243, 214],
[246, 242, 213],
[249, 245, 216]],
...,
[249, 244, 214],
[246, 242, 213],
[248, 244, 215]],
....]
Is there a way to convert this?