This example shows how to identify different colors in fabric by analyzing the L*a* b* colorspace.
www.mathworks.com