RGB to LAB

Convert image from RGB colorspace to LAB colorspace and split the channels.

plantcv.rgb2gray_hsv(rgb_img, channel)

returns split image (l, a, or b channel)

Original RGB image

Screenshot

from plantcv import plantcv as pcv

# Set global debug behavior to None (default), "print" (to file), or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"

# image converted from RGB to LAB, channels are then split. Lightness ('l') channel is outputed.
l_channel=pcv.rgb2gray_lab(img, 'l')

Lightness channel image

Screenshot

from plantcv import plantcv as pcv

# Set global debug behavior to None (default), "print" (to file), or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"

# image converted from RGB to LAB, channels are then split. Green-Magenta ('a') channel is outputed.
a_channel= pcv.rgb2gray_lab(img, 'a')

Green-Magenta channel image

Screenshot

from plantcv import plantcv as pcv

# Set global debug behavior to None (default), "print" (to file), or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"

# image converted from RGB to Lab, channels are then split. Blue-Yellow ('b') channel is outputed.
b_channel=pcv.rgb2gray_lab(img, 'b')

Blue-Yellow channel image

Screenshot