Skip to content

Instantly share code, notes, and snippets.

@muthuspark
Created August 11, 2020 14:12
Show Gist options
  • Select an option

  • Save muthuspark/f8afe3f56a9a6ea70a0e043db6a6db47 to your computer and use it in GitHub Desktop.

Select an option

Save muthuspark/f8afe3f56a9a6ea70a0e043db6a6db47 to your computer and use it in GitHub Desktop.

Revisions

  1. muthuspark created this gist Aug 11, 2020.
    15 changes: 15 additions & 0 deletions rgb to lab
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    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)