colors - Grayscale image and L*a*b space in MATLAB -
i have bunch of images, vast majority of color (rgb) images. need apply spatial features in 3 different channels of lab color space. conversion rgb color space lab color space straightforward through rgb2gray
. however, naturally fails when image grayscale (consists of 1 channel only, numerical representation being double
, uint8
, really).
i familiar fact "luminance" (l) channel of lab color space grayscaled original rgb image. question, however, of different nature; i'm asking is: given image grayscale, trivially l channel in lab color space. what should , b channels be? should zero? following example, using pre-build "peppers" image, shows visual effect of doing so:
i = imread('peppers.png'); figure; imshow(i, []); lab = rgb2gray(i); lab(:, :, 2) = 0; lab(:, :, 3) = 0; figure; imshow(lab, []);
if run code, note second imshow
outputs reddish version of first image, resembling old dark room. admit not being knowledgeable , b color channels represent in order understand how should deal them in grayscale images, , looking assistance.
Comments
Post a Comment