image2palette() parses image into pixels in L/a/b space, and returns major color components clustered by k-means method. It also returns the name of colors and palette.
--- Usage example
%% (1) Version 1. Pre-defined image
nCluster = 4;
imagefullpath = [pwd, '\' 'football.jpg'];
image2palette( nCluster, imagefullpath );
%% (2) Version 2. Select image using GUI handle
nCluster = 4;
image2palette( nCluster )
Color label reference: https://en.wikipedia.org/wiki/Web_colors
引用格式
Hio-Been Han (2018). image2palette: Simple K-means color clustering, MATLAB Central File Exchange. Retrieved November 28, 2018.
MATLAB 版本兼容性
创建方式
R2018b
兼容任何版本
平台兼容性
Windows macOS Linux类别
- Image Processing and Computer Vision > Image Processing Toolbox > Image Segmentation and Analysis > Image Segmentation > Color Segmentation >
在 Help Center 和 MATLAB Answers 中查找有关 Color Segmentation 的更多信息
标签
致谢
参考作品: rgb2hex and hex2rgb
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!