[scikit-image] Converting RGB values from pandas dataframe to LAB

Michael O'Brien mob.irl at gmail.com
Fri Mar 3 09:43:24 EST 2017


Hi all,

I was hoping the community may be able to help me. I want to convert rgb
values to their L*A*B* value but I'm not sure of the best way to do so so
the setup will scale when the dataframe size increases.

I saw on stackoverflow that skimage's conversion method
http://scikit-image.org/docs/dev/api/skimage.color.html?highlight=rgb2lab#skimage.color.rgb2lab
 was suggested to be faster than alternatives but I'm having trouble
understanding how to use my dataframe as the input instead of an image and
if the conversion is successful how I can store the LAB values back into
the dataframe. At the moment my dataframe has a shape 

(827, 8) where Rgb_r, Rgb_g, Rgb_b are the column names I'm interested
in, you could think of the dataframe of 827 individual pixels with
associated metadata.

Is it possible to pass a pandas dataframe to scikit-image
color.rgb2.lab or should I do row by row calculates for the situation
where the number of rows increases to possibly 200,000 or more

Hope you can help me

Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20170303/377fe5fa/attachment.html>


More information about the scikit-image mailing list