I wish to calculate the proportion of the color in an image in the L*a *b space, but I don't how to implement in Matlab code.
The idea is as follow:
- load a png file and convert the RGB space to Lab space via "rgb2lab";
- divide the L vector into three section: [0, 30], [31, 61], [62, 100], divide the a vector into three sections: [-128, -44], [-43, 41], [42, 127], divide the b vector into three sections: [-128, -44], [-43, 41], [42, 127]. After dividing, we now have 3*3*3=27 sub-sapces in the L*a*b space;
- calculate the amount of pixel each L*a*b sub-space contains and the proportion of pixel in each L*a*b sub-space.
Could anyone tell me how to implement the idea above?
Best Answer