Skip to content

Instantly share code, notes, and snippets.

@muthuspark
Created August 11, 2020 14:12
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/f8afe3f56a9a6ea70a0e043db6a6db47 to your computer and use it in GitHub Desktop.
Save muthuspark/f8afe3f56a9a6ea70a0e043db6a6db47 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]
x,y,z = lab_img.shape
for xi in range(x):
 for yi in range(y):
 if lab_img[xi,yi][1] > -35:
 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