Commit
·
667e093
1
Parent(s):
f19b0c8
Update channel_functions.py
Browse files- channel_functions.py +5 -2
channel_functions.py
CHANGED
|
@@ -112,8 +112,6 @@ def which_channel_dominates(img_arr, original_image_plot = 'yes', original_image
|
|
| 112 |
|
| 113 |
print(np.max(red_channel), np.max(green_channel), np.max(blue_channel))
|
| 114 |
|
| 115 |
-
if original_image_plot == 'yes':
|
| 116 |
-
plt.imshow(cv2.cvtColor(img_arr,cv2.COLOR_BGR2RGB), alpha=original_image_opacity)
|
| 117 |
|
| 118 |
which_channel_dominates = np.zeros((img_arr.shape[0],img_arr.shape[1]))
|
| 119 |
|
|
@@ -135,8 +133,13 @@ def which_channel_dominates(img_arr, original_image_plot = 'yes', original_image
|
|
| 135 |
|
| 136 |
#Map the color code to the image
|
| 137 |
fig, ax = plt.subplots(figsize=(8,8))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
plot = plt.imshow(which_channel_dominates, cmap=cmap, alpha=channel_opacity)
|
| 139 |
|
|
|
|
| 140 |
#Customize the ticks of the colorbar
|
| 141 |
plt.colorbar(plot, orientation='vertical',
|
| 142 |
ticks = [],
|
|
|
|
| 112 |
|
| 113 |
print(np.max(red_channel), np.max(green_channel), np.max(blue_channel))
|
| 114 |
|
|
|
|
|
|
|
| 115 |
|
| 116 |
which_channel_dominates = np.zeros((img_arr.shape[0],img_arr.shape[1]))
|
| 117 |
|
|
|
|
| 133 |
|
| 134 |
#Map the color code to the image
|
| 135 |
fig, ax = plt.subplots(figsize=(8,8))
|
| 136 |
+
|
| 137 |
+
if original_image_plot == 'yes':
|
| 138 |
+
plt.imshow(cv2.cvtColor(img_arr,cv2.COLOR_BGR2RGB), alpha=original_image_opacity)
|
| 139 |
+
|
| 140 |
plot = plt.imshow(which_channel_dominates, cmap=cmap, alpha=channel_opacity)
|
| 141 |
|
| 142 |
+
|
| 143 |
#Customize the ticks of the colorbar
|
| 144 |
plt.colorbar(plot, orientation='vertical',
|
| 145 |
ticks = [],
|