Sir , for display a only that part of fig whose pixel of some particular color .
new_img_exp = np.ones((330*500,3),dtype=‘uint8’)
for ix in range (new_img_exp.shape[0]) :
#print(km.labels_[ix])
if km.labels_[ix] == 1 :
new_img_exp[ix] = colors[km.labels_[ix]]
new_img_exp = new_img_exp.reshape((original_shape))
plt.imshow(new_img_exp)
Is this correct ? Here , rest of the notations are same as in code .