ootnitsuj
02-28-2006, 06:57 AM
Hi Guys,
I need some help here. I have some monochrome (grayscale) images (.bmp format) here and i need to convert them into pseudo colored images making use of a lookup table (LUT).
What's going on here is:
I have some images that have just been captured by an IR Camera. To make these hotspots more visible to the user, I need to match certain temperature higher than a certain threshold to a color say Red.
Question:
Since the image is monochrome, the image will consists of the pixel values and not temperature information right? (or is it that this pixel values/intensities of the thermal image are the temperature information?)
So now, how do I create a LUT to match the temperature to a certain pixel value? I am rather confused with this temperature, pixel value and color concept. Can someone help me with this?
Can someone guide me with this conversion of monochrome image to a pseudo colored image? I am stucked here for quite a while now. Your help will be greatly appreciated
Thanks alot guys.....
Regards,
Justin
GavinO
02-28-2006, 09:45 AM
Generally to recolor an image like this, you're going to generate a mapped from each shade of grey to a color value. You can store these mappings in a big array, and then index into the array using the value you're looking up. Simply looking up each pixel in the image and replotting it with the value from the table should work. This is kind of slow, however, so you might want to consider looking into the various API functions dealing with palettes (which allow you to redefine the palette for the entire image at once).
A difficult part of the process may be simply generating the palette mappings. Obviously, there are two naive solutions:
- Define 3-4 ranges of values, and assign a flat color to each. This kills your image definition.
- Simply scale the RGB color space over the greyscale values that you have. That is, if you have 255 greyscale values and a 24-bit color space, simply solve the proportion value/255=mapped_color/2^24-1. This is going to give you a pretty random spread of color.
The solution that you're looking for is a bridge between these solutions. You have an idea of what colors you want mapped to each range of values, but you want there to be a smooth blend between them. I would suggest a system where you define the color at a few points along the greyscale gamut, and then interpolate the values in between.
ootnitsuj
03-01-2006, 10:16 AM
Hi GavinO,
Thank you for your advice. I would appreciate if u can provide some sample coding on how this can be done. Sites that explain this concept will be of some help to me too.
I am new to graphics programming so I am not sure not very sure of some concepts that you have stated in your last reply.Ii hope that I can achieve as much as possible from this discussion because I need this bit to kick start my project that I am currently on. Your help will be greatly appreciated bro...
Cheers,
Justin
mkaras
03-07-2006, 04:01 AM
Check out the picture at this link. It should give you some ideas on false color selections.
http://en.wikipedia.org/wiki/Thermographic_camera
Let me add:
When you get into coding this up it may be a good idea to first scan the monochrome bitmap first to find the range of grey scale pixel values first. Then extend the the intended color range just across the pixel range in the picture instead of across the full range of possible color values. For example a bitmap with 8 bits/pixel could support a range of pixel values from 0 to 255 while in reality the thermal image picture may only comprise picture pixel values in the range of 37 to 144. You would then map the color range across this range with say 37 = near black and 144 going toward white with your mapped colors in between. In any color mapping I would suggest some type of low end threshold (on the cold side) that would map the initial range of pixel values all to say black. In the above example say you set this threshold to 4, then the pixel values from 37 to 40 would all map to the near black color and start the color range at 41. This will help define object edges some.
mkaras
03-07-2006, 04:24 AM
Here is a link to some more false color ranging table ideas.
http://www.wavemetrics.com/products/igorpro/creatinggraphs/colortab.htm