DebasishDhal99 commited on
Commit
54cab1d
·
1 Parent(s): 5d445d9

Update channel_functions.py

Browse files
Files changed (1) hide show
  1. channel_functions.py +3 -3
channel_functions.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
  import cv2
5
 
6
  def individual_channel_image(img_arr, channel= 'r', ax=None):
7
- img_arr = np.array(img_arr[:,:,0:3], dtype=np.uint8)
8
 
9
  if channel in ['r','red','Red']:
10
  plot_arr = img_arr[:,:,0]
@@ -87,8 +87,8 @@ def channel_distribution_plotter(img_array):
87
  plt.title("Blue Channel")
88
 
89
  plt.subplot(2,2,4)
90
- # plt.imshow(cv2.cvtColor(img_array,cv2.COLOR_BGR2RGB))
91
- plt.imshow(cv2.cvtColor(img_array,cv2.COLOR_RGB2BGR))
92
  plt.title("Original Image")
93
 
94
  plt.suptitle("Pixel values distribution in each channel\nx-axis: pixel values, y-axis: number of pixels")
 
4
  import cv2
5
 
6
  def individual_channel_image(img_arr, channel= 'r', ax=None):
7
+ img_arr = np.array(img_arr[:,:,0:3])
8
 
9
  if channel in ['r','red','Red']:
10
  plot_arr = img_arr[:,:,0]
 
87
  plt.title("Blue Channel")
88
 
89
  plt.subplot(2,2,4)
90
+ plt.imshow(cv2.cvtColor(img_array,cv2.COLOR_BGR2RGB))
91
+ # plt.imshow(cv2.cvtColor(img_array,cv2.COLOR_RGB2BGR))
92
  plt.title("Original Image")
93
 
94
  plt.suptitle("Pixel values distribution in each channel\nx-axis: pixel values, y-axis: number of pixels")