ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

converting black and white to false color map

I have 16 bit images of a diffration pattern and I want to convert them to a false color image like 'Matlab Color Map' so I can make a false color avi. Does anyone have a quickey routine written for that? Does this already exist somewhere in Imaq and I missed it?

0 Kudos
Message 1 of 11
(9,329 Views)

Hi,

 

Have you tried using the "Color Palette" input of the "IMAQ Windraw.vi" (external display palette) ?

Or with the "Palette=>User Palette" property of the "Vision Image Display" control ?

 

If your image has 10-bit bitdepth, passI's  an array of RGB values with 1024 entries.

It's been a long time i haven't used this feature, so i am not sure it will work with 16-bit image, but give it a try.

 

Best Regards.

 

JC Benoit

Vision Engineer

Alliance Vision

www.alliancevision.com

 

0 Kudos
Message 2 of 11
(9,312 Views)

I'll look at windraw, but the obhject us to save the image as a false color map similar to the matlab function. Simply displaying it with the display palette is not enough.

0 Kudos
Message 3 of 11
(9,308 Views)

OK, it appears this might work, sort of. The color map 'rainbow' is acceptpable but I don't really like the color scheme. I would prefer the color map as follows;

 

1) No light would be black,

2) little bit of light transitions to red

3) At the top end, getting hot would be blue,

5) The max intensity would be white.

 

 

0 Kudos
Message 4 of 11
(9,304 Views)

You should also be able to specify a custom palette, simply input your custom array of RGB clusters to "IMAQ Windraw.vi".

You can also input a custom color map to the "IMAQ Write File.vi", if you need to record the images to the hard disk.

 

Best Regards.

 

JC Benoit

Vision Engineer

Alliance Vision

www.alliancevision.com

0 Kudos
Message 5 of 11
(9,299 Views)

Actually I take it back. It doesnt seem to work at all. I need to be able to save the false color image. False color images are invaluable in scientific image processing.

0 Kudos
Message 6 of 11
(9,298 Views)

It sounds like the "gradient" palette might work for you.  I think it goes black -> red -> blue -> white (with a few colors in between).

 

I would use the color palette as a lookup table to convert your grayscale image to a color one.  I am sure there is a way to do it, but I haven't ever tried.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 11
(9,295 Views)

I solved it. Pretty easy actually.

0 Kudos
Message 8 of 11
(9,263 Views)

Looks like it works, but it is a bit complicated.  I was thinking something a little simpler, like this:

 

Gray to Color.png

 

This just converts the palette to color lookup tables and uses the color lookup vi to convert the image.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 9 of 11
(9,260 Views)

Hello,
I need to use this for a black and white luninacne graph. is there a way to display a scale as well to show which colour means how much,

0 Kudos
Message 10 of 11
(8,062 Views)