CIELAB is a nonlinear transformation of RGB where the Euclidean distance between two colors is equal to their perceptual distances (for distances less than ~10 units). Algorithms that process color images often produce better results in CIELAB.
The equations implemented here come from Charles Poynton's Colour FAQ.
how exactly to use this file (to check if it works with some pic), sry for the question, but I am new in this and I need color space segmentation with Lab color space
This file is actually sRGB to Lab? sorry i am confused
This assumes an sRGB color profile, most certianly not always the case.
you can only successfully convert if you know what color profile [RGB] is used. I guess you took sRGB?
I guess "makecform" is the native command Uwe was referencing to
What native MATLAB implementation? I see lab2double but not the reverse.
I don't see the advantage over the native Matlab implementation.
To make it nicer, you should make the whitepoint and the colorspace selectable. (now it is D65 and sRGB).
Create scripts with code, output, and formatted text in a single executable document.