0

I have a numpy array which dimension is (5, 3024, 4032) and data type float64. It is a 5 channel image and my question is: how can I visualize each channel one by one?

My input:

data_gt = np.load('220200803_174029.npy')
data_gt.shape
# (5, 3024, 4032)


data_gt.dtype
# dtype('float64')

1 Answers1

1
import numpy as np
from matplotlib import pyplot as plt

data_gt = np.load('220200803_174029.npy') 
for i, channel in enumerate(data_gt):
   plt.title("channel %i"%(i+1))
   plt.imshow(channel, cmap="Greys", vmin=data_gt.min(), vmax=data_gt.max())
   plt.show()