Spaces:
Sleeping
Sleeping
Commit ·
ebacab7
1
Parent(s): 6ad333a
Update channel_functions.py
Browse files- channel_functions.py +2 -2
channel_functions.py
CHANGED
|
@@ -112,7 +112,7 @@ def which_channel_dominates(img_arr, original_image_plot = 'yes', original_image
|
|
| 112 |
blue_channel = img_arr[:,:,0]
|
| 113 |
|
| 114 |
|
| 115 |
-
print(np.max(red_channel), np.max(green_channel), np.max(blue_channel))
|
| 116 |
|
| 117 |
|
| 118 |
which_channel_dominates = np.zeros((img_arr.shape[0],img_arr.shape[1]))
|
|
@@ -131,7 +131,7 @@ def which_channel_dominates(img_arr, original_image_plot = 'yes', original_image
|
|
| 131 |
which_channel_dominates[(red_channel == 255) & (blue_channel == 255) & (green_channel == 255)] = 4
|
| 132 |
which_channel_dominates[(red_channel == 0) & (blue_channel == 0) & (green_channel == 0)] = 5
|
| 133 |
|
| 134 |
-
print(np.unique(which_channel_dominates))
|
| 135 |
|
| 136 |
#Map the color code to the image
|
| 137 |
fig, ax = plt.subplots(figsize=(8,8))
|
|
|
|
| 112 |
blue_channel = img_arr[:,:,0]
|
| 113 |
|
| 114 |
|
| 115 |
+
print("Red channel max. = ", np.max(red_channel), "Green max. = ", np.max(green_channel), "Blue max. = ",np.max(blue_channel))
|
| 116 |
|
| 117 |
|
| 118 |
which_channel_dominates = np.zeros((img_arr.shape[0],img_arr.shape[1]))
|
|
|
|
| 131 |
which_channel_dominates[(red_channel == 255) & (blue_channel == 255) & (green_channel == 255)] = 4
|
| 132 |
which_channel_dominates[(red_channel == 0) & (blue_channel == 0) & (green_channel == 0)] = 5
|
| 133 |
|
| 134 |
+
print("Unique elements of channel dominat array are: - ",np.unique(which_channel_dominates))
|
| 135 |
|
| 136 |
#Map the color code to the image
|
| 137 |
fig, ax = plt.subplots(figsize=(8,8))
|