Put It Into Reverse: Image Color to Value
hegedus
Here is the problem I am busy singing (well not actually singing because for me that would be a very bad thing) the praises if IP with one of my clients and the request comes up. They do CFD simulations and often times the internal client says well what is the difference between the two cases. At this time they have images (bmp files) of the analysis which takes 24 hours to run and the exported data is many GB.
So the request was can you just subtract one image from the other? And yes you can with some caveats about using a float wave to preserve the negative numbers. In a proof of concept I converted the color bmp to grayscale and did the subtraction. What I really should do is convert the color of the pixel to an accurate value. For arguments sake let's assume that the color mapping is a rainbow and I know the values of minimum and maximum, say rainbow going from 0 to 50. What would be the methodology to read the pixel color and translate it back to a value within the range?
Andy
You can make colour tables with
It's worth reading this excellent blog post by Jim Prouty which has a method for extracting values from a colour key.
https://www.igorpro.net/blog/2016/10/4/get-to-know-a-feature-color-tabl…
June 21, 2017 at 11:43 pm - Permalink
But if that is not possible and you have a color-scale image and want to convert it to actual values, I would not convert it to grey scale, since two colors (and therefore two values) might be the same shade of grey. I would probably do the conversion using only one channel red, green or blue. Or you could do all three channels separately and compare the result. If the conversion factor is linear you could do:
ActualValue[][]=a+b*RedChannel[p][q]
If the conversion is not linear you will need to create a conversion factor wave and do:
ActualValue[][]=ConversionWave(RedChannel[p][q])
June 21, 2017 at 11:53 pm - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
June 22, 2017 at 11:34 am - Permalink