Mahotas – RGB to XYZ Conversion
In this article we will see how we can covert rgb image to xyz image in mahotas. An RGB image, sometimes referred to as a truecolor image, is stored in MATLAB as an m-by-n-by-3 data array that defines red, green, and blue color components for each individual pixel. Xyz is an additive color space based on how the eye interprets stimulus from light. Unlike other additive rgb like Rgb, Xyz is a purely mathmatical space and the primary components are “imaginary”, meaning we can’t create the represented color in the physical by shining any sort of lights representing x, y, and z.
In this tutorial we will use “lena” image, below is the command to load it.
Below is the lena image
In order to do this we will use mahotas.colors.rgb2xyzmethod
Syntax : mahotas.colors.rgb2xyz(img)
Argument :It takes image object as argument
Return : It returns image object
Below is the implementation
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course