Convert rgb values in a matrix to individual colors
2 次查看(过去 30 天)
显示 更早的评论
For a project I have to convert 601 individual RGB values to the corresponding colors. Below are the first 20 listed of the 601. I tried the Mathworks page about rgb values to color names but I couldn't get that to work. Can someone pls explain how to get the corresponding colors for these RGB values.
0.826665240847004 0.918863320017453 0.486336432188952
0.596699457619175 0.301468321067612 0.463472605161145
0.831844471229387 0.237518845273861 0.273950624470175
0.533388556634722 0.295645494142704 0.610774609614092
0.648157476155101 0.674715312492348 0.833035756347425
0.785996678478714 0.743072994970689 0.162974797530648
0.820760750392782 0.246369839214369 0.473102613257166
0.935361133192433 0.609834890073043 0.00814634697105110
0.736636921591175 0.232796957979210 0.780910265523148
0.298479092090089 0.551844349029450 0.583369931793372
0.0741295056180458 0.290793007581355 0.499455254969706
0.755798670982034 0.986008809289497 0.657761185842824
0.809997113666950 0.640462498940527 0.262109056954527
0.489305409661275 0.257477765936329 0.343868221101830
0.845676725256692 0.205044589055609 0.791564036217921
0.229401247067841 0.243788690471475 0.531595143222783
0.212947417953978 0.367794659420751 0.482094249381992
0.964599822444196 0.361489533426090 0.421366944842591
0.462738823084232 0.0258552759663809 0.981959490633318
0.658857677359475 0.301901449781870 0.0884363634870032
1 个评论
Karen Yadira Lliguin León
2022-10-19
Hi! i've seen a similar question is already answered :
https://es.mathworks.com/matlabcentral/answers/91036-how-do-i-split-a-color-image-into-its-3-rgb-channels
采纳的回答
Walter Roberson
2022-10-19
Color perception is non-uniform and non-linear. Unless you have a table that lists the names for those exact rgb values (to within round-off error) then you cannot reliably name colors.
There are named colors whose approximate boundaries are entirely within other named colors so you cannot just look for Euclidean distance to the centroid because the centroid of the larger area might be inside the smaller area.
Therefore you need to do research on what algorithm you are going to use for deciding color membership, and you are going to need to create nonlinear descriptions of the boundaries of each colour. For example, "skin tone" is roughly banana shaped.
MATLAB does not provide any color recognition code that I know of; there might be something in the file exchange.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!