Skip to content

Instantly share code, notes, and snippets.

@muthuspark
Created August 11, 2020 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muthuspark/e69826a6d5bd750fc3adfad53b6aa986 to your computer and use it in GitHub Desktop.
Save muthuspark/e69826a6d5bd750fc3adfad53b6aa986 to your computer and use it in GitHub Desktop.
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