Mapping function values to colors

  • Thread starter Thread starter spx2
  • Start date Start date
  • Tags Tags
    Function Mapping
AI Thread Summary
The discussion revolves around creating a score function for a grid with a large number of cells (400x600 or 800x600) and the need for visual representation of the score function's values. The aim is to plot these values as colors on the grid to facilitate better understanding and analysis, particularly when using metrics like Euclidean distance. The challenge lies in effectively mapping the score values to colors, ensuring a smooth and visually relevant transition from low to high values. One suggestion made is to explore generating colors using the HSV (Hue, Saturation, Value) model, which may offer a more intuitive approach to color representation compared to traditional methods. The discussion highlights the importance of visual clarity in interpreting numerical data and the complexities involved in color mapping for effective visualization.
spx2
Messages
2
Reaction score
0
Hi,

I'm trying to write a score function.
The score function is applied to each cell of a grid
and because the grid has many cells ( 400x600 or 800x600 )
If I want to experiment with different score functions to
see which one is best I'd have to see some kind of visual results.
I thought of plotting that score function to the screen
(because viewing just numbers isn't enough any more)
and all it's values will be colors of pixels on a grid.
The problem is choosing the colors and the transition between low-values to
big values of the score function so that they show up as beeing relevant
and smooth to the eye.
Let's take euclidean distance as the score function for example.
If we have 2 objects,one fixed at the bottom right of the screen and one
starting in the upper left and moving towards upper right,then a transition of colors should
be made for the area where the fixed object is , and the signification of this will be
that the distance between these objects is getting smaller and smaller.
I have tried getting the euclidean distance normalized to fit in the color spectrum and then
plotting but that turns out to not be so good either.
I'm having difficulties finding the best mapping between colors->distance.

Has anyone tried this ?

Thank you
 
Technology news on Phys.org
SPX,

I don't know if this is actually helpful but have you looked into generating HSV colors? HSV is a numerical representation of color that is a lot closer to what we might think of as how a color is defined intuitively.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
What percentage of programmers have learned to touch type? Have you? Do you think it's important, not just for programming, but for more-than-casual computer users generally? ChatGPT didn't have much on it ("Research indicates that less than 20% of people can touch type fluently, with many relying on the hunt-and-peck method for typing ."). 'Hunt-and-peck method' made me smile. It added, "For programmers, touch typing is a valuable skill that can enhance speed, accuracy, and focus. While...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top