represent vector as a color
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
This isn't specifically a MATLAB question, although a solution in MATLAB would be nice (if there is a solution).
Lets say I have some vectors, say '<1,2,7,6,10> and '<3,4,6,1,4>.
Is there any way to represent each of these vectors as a single color? I am looking for a way to "color" n-dimensional vectors with a single color - I'm not sure that it's possible.
3 commentaires
Fangjun Jiang
le 1 Sep 2011
pcolor() will show that vector [1,2,7,6,10] and [1.1, 1.9, 7, 6.1, 9.9] are similar but of course they contain multiple color grids.
Réponse acceptée
Walter Roberson
le 1 Sep 2011
If your n is 7 or higher and your vector components have infinite variability (not limited to a strictly finite set of values), then there is no known way to do what you ask.
For n=5 or 6, you might be able to use one of the LAB* representations of color and convert to RGB. But possibly only if some of the components have fixed maximum values.
For n=4, you could use CMYK and convert to RGB, but possibly only if some of the components have fixed maximum values.
If each of the components of your n dimensional vectors is discrete and has a maximum value (so all the possible values at that component could be written out in a finite list), then no matter how many dimensions you had, you could map the vector in to a unique RGB value. Only the other hand, few people have the equivalent of "absolute pitch" when it comes to color (humans are much better at distinguishing differences in colors). It is more or less the case that once you get beyond about 3000 different colors (3000 different distinct vectors in your case) that it becomes useless unless you have calibrated equipment and trained observers and controlled conditions.
6 commentaires
Daniel Shub
le 2 Sep 2011
@Walter, you have a lot going on here. Most of it seems on the right path. Quick proof for distance in reduced dimensionality. In 2-D space an equilateral triangle has 3 points that are equally far away from each other, if you project that to 1-D space the three points can no longer be equally far away from each other.
Walter Roberson
le 2 Sep 2011
Good example for distance in reduced dimensionality.
Still, Craig talked about "similarity" rather than "distance". If Craig _defined_ the "similarity" of all vectors to be a constant, then after projection downward the "similarity" could remain constant. The necessity that similarity will change thus depends upon the definition of "similarity". It seems to me to be plausible that there might be sufficiently strange geometries (e.g., of a fractal nature) in which it is not possible to define "distance" in any of the usual senses. My projective answers were based just upon counting arguments, not upon specific definitions of "distance".
Don't mind me; I haven't had a chance yet this morning to step out to the corner store and buy an argument.
Plus de réponses (1)
Daniel Shub
le 2 Sep 2011
As Walter said, color is a three dimensional precept. Printers use CMYK to generate there colors, but all this means is that there are multiple was of combining inks to produce the same color. Monitors work with RGB. There are a number of ways of reducing the dimensionality of your data set (clustering is one and principal component analysis is another). It seems like you have a grasp on this.
Basically you need to map from a N-D space to a 3-D space. You then want to map from the 3-D space to a color space. A trivial mapping would be to use the magnitude of each of the 3 dimensions to drive the R/G/B of your monitor. Unfortunately, this will result in a warped color space: some points which are close in your 3D space will be perceptually very different and some points which are far apart in you 3D space will be perceptually similar. A better mapping would be to use an LMS color space. Ideally, this would be done with a calibrated monitor, but that is probably overkill.
It looks like: href=""<http://www.mathworks.com/matlabcentral/fileexchange/28790-colorspace-transformations</a>>
can convert RGB to LMS.
0 commentaires
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!