Combine 3 separate numpy arrays to an RGB image in Python

前端 未结 5 729
遥遥无期
遥遥无期 2020-12-02 10:19

So I have a set of data which I am able to convert to form separate numpy arrays of R, G, B bands. Now I need to combine them to form an RGB image.

I tried \'Image\

5条回答
  •  天命终不由人
    2020-12-02 11:05

    rgb = np.dstack((r,g,b))  # stacks 3 h x w arrays -> h x w x 3
    

    This code doesnt create 3d array if you pass 3 channels. 2 channels remain.

提交回复
热议问题