-
check
img.shape
you probably loaded the image withoutIMREAD_UNCHANGED
, which means OpenCV automatically converts it to (some type of) BGR, losing the extra channel
it may still reorder the channels. I don’t know exactly how it’ll behave. check the docs and/or run the function and check the results to be sure. -
you’re using python. you can also use numpy means:
(ch1, ch2, ch3, ch4) = np.transpose(img, axes=(2,0,1))
1 Like