Np.transpose on an image

Hello, I read a .tiff image with opencv and then I use this command (found from google search):

(r,g,b,a) = np.transpose(image_, axes=(2,0,1))

in order to get the channels. Does this command change the order of the channels that I get from the image? I search on google for information about what this command does but I am not sure I understood what’s the purpose… I only need to take the channels from the .tif image in the right order obviously…

that is numpy. it rearranges the data to give the indices in a different order. it maintains the order of the colors. to learn more, explore the documentation of numpy.

1 Like