Create a multi-channel image from pixel coordinates extracted from another image

Thanks very much @kbarni

I tried to use cv2.merge to check whether I get the same image but I’m getting this image ?

  new_img[:,:,0] = np.all(mask==benign,axis=2).astype(np.uint8)
  new_img[:,:,1] = np.all(mask==blue,axis=2).astype(np.uint8)
  new_img[:,:,2] = np.all(mask==yel,axis=2).astype(np.uint8)
  new_img[:,:,3] = np.all(mask==red,axis=2).astype(np.uint8)
  new_img[:,:,4] = np.all(mask==white,axis=2).astype(np.uint8)


test_img=cv2.merge((new_img[:,:,3],new_img[:,:,4],new_img[:,:,1]))

plt.imshow(test_img)

:Capture