DebasishDhal99 commited on
Commit
7c684da
·
1 Parent(s): be8ca19

Update channel_functions.py

Browse files
Files changed (1) hide show
  1. channel_functions.py +5 -2
channel_functions.py CHANGED
@@ -105,7 +105,7 @@ def which_channel_dominates(img_arr, original_image_plot = 'yes', original_image
105
  print(np.unique(which_channel_dominates))
106
 
107
  #Map the color code to the image
108
- # fig, ax = plt.subplots(figsize=(8,8))
109
  plot = plt.imshow(which_channel_dominates, cmap=cmap, alpha=channel_opacity)
110
 
111
  #Customize the ticks of the colorbar
@@ -117,4 +117,7 @@ def which_channel_dominates(img_arr, original_image_plot = 'yes', original_image
117
 
118
  text = "Which channel dominates in the image below?\nWhite : R=G=B=255, Black : R=G=B=0\nGray : 0 < R=G=B< 255"
119
  plt.title(text)
120
- plt.plot()
 
 
 
 
105
  print(np.unique(which_channel_dominates))
106
 
107
  #Map the color code to the image
108
+ fig, ax = plt.subplots(figsize=(8,8))
109
  plot = plt.imshow(which_channel_dominates, cmap=cmap, alpha=channel_opacity)
110
 
111
  #Customize the ticks of the colorbar
 
117
 
118
  text = "Which channel dominates in the image below?\nWhite : R=G=B=255, Black : R=G=B=0\nGray : 0 < R=G=B< 255"
119
  plt.title(text)
120
+ fig.canvas.draw()
121
+ # plt.plot()
122
+ image_array = np.array(fig.canvas.renderer.buffer_rgba())
123
+ return image_array