Created
August 11, 2020 14:22
-
-
Save muthuspark/e69826a6d5bd750fc3adfad53b6aa986 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from skimage import color | |
from skimage.io import imsave | |
lab_img = color.rgb2lab(cimage) | |
copy_img = np.copy(cimage) | |
L_img = lab_img[:, :, 0] | |
A_img = lab_img[:, :, 1] | |
B_img = lab_img[:, :, 2] | |
# green a > -35 | |
x,y,z = lab_img.shape | |
for xi in range(x): | |
for yi in range(y): | |
if lab_img[xi,yi][2] > 55 and lab_img[xi,yi][1] < 0 and lab_img[xi,yi][0] > 55: | |
# this is yellow color | |
# copy_img[xi, yi] = [255,255,255] | |
pass | |
else: | |
copy_img[xi, yi] = [255,255,255] | |
fig, ax = plt.subplots(figsize=(20,20)) | |
ax.imshow(copy_img) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment