LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

converting U8 image into RGB

I have a pixelink camera that when I run through the IMAQdx vi's, it produces a BW image.  When I view the image, I can select from the palette bar when I right click on the image out display and select rainbow, temperature, etc....but I can't save these colored images.  I'm guessing that the image out viewer converts the U8 image into a RGB image for display.  I would expect that there would of been a VI (or maybe there is and I haven't seen it) that would do this task and allow you to save the image as a RGB.  Is there a VI to do this?

 

Thanks,

guilio_2008

0 Kudos
Message 1 of 6
(7,266 Views)

There's a function in LV to convert color (U32) into RGB : "Color to RGB.vi"

 

You can find this VI in the function palette : Programming > Graphics & Sound > Picture Functions > Color to RGB.vi

 

Best,

 

J.

0 Kudos
Message 2 of 6
(7,260 Views)

guilio,

 

It sounds like you would like to save a bitmap of the image rendered in the control when viewing one of the mappings - temperature, rainbow, etc? 

 

If you have access to the NI Vision Development module, you can use IMAQ GetPalett.vi to generate the R, G, and B lookup tables to remap pixel values to render temperature or rainbow.  You can then use IMAQ ReplaceColorPlane.vi to combine your R, G, & B planes into an RGB image, and IMAQ Write File 2.vi to write your file as a bitmap.

 

-cb

0 Kudos
Message 3 of 6
(7,241 Views)
The IMAQ UserLookup.vi will re-map pixel values.
0 Kudos
Message 4 of 6
(7,240 Views)

I tried doing just the pallette, but it doesn't change the image when I have on front panel.  I'm guessing you need to use the open image window to get this working?  Any examples? 

 

Thanks,

guilio

0 Kudos
Message 5 of 6
(7,217 Views)

Do you have the NI Vision Development Module? If so, this sloppy little bit of code will let you change an image palette on the fly, then save out a copy of the color image you see. You can also choose a user defined palette and create your own palette with the color ramp next to the window.

 

 

 

 

-root

Message Edited by Root Canal on 05-05-2009 11:11 AM

global variables make robots angry


Download All
0 Kudos
Message 6 of 6
(7,194 Views)