LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I get the default color map ?

Hi there,
 
I've been doing some analysis of some grey scale video images in labview.
 
When I display the images using the "Draw flattened Pixmap" vi, I leave the color map terminal
unwired and get a really useful display, with Labview's default color map enhancing the contrast in the monochrome images very nicely.
 
I now want to write these images to disk, so I can re-assemble them into an AVI file, unfortunately in order
to get the bmp files on disk to use the same color map as the on-screen display, I'd need a copy of the default color map, which I cannot find anywhere. Wiring the color map input of the 'writebmp to file' vi to an empty constant gives a different result to the on screen display.
 
Greg mentioned that the default color map is based on a 6x6x6 cube with some extar colors thrown in, is this color map available as a csv or similar file, or could someone post an algorithm to create the default color map.
 
regards
 
dave Langstaff
 
0 Kudos
Message 1 of 11
(4,566 Views)

What is your LabVIEW version?

(Newer versions of "draw flattened pixmap" don't have a color map terminal (the color map is part of the image data cluster).)

0 Kudos
Message 2 of 11
(4,559 Views)

Sorry, I should have mentioned that I'm using v6.1

dave

0 Kudos
Message 3 of 11
(4,549 Views)
Hi Dave,
 
Do you have any sample images at all?
It looks to me that the function to open a bmp file actually uses the same blank colourmap so there shouldn't be any real difference.
If you could post what images you are getting from each (and maybe the code) I will have a look for you and see what is going on.
 
Thanx
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 4 of 11
(4,531 Views)

Adam,

 

Many thanks for the interest....

I've attached 3 jpegsshowing what I'm after. Monochrome.jpg is the original fast video camera image

DefaultMap.jpg is the same frame with the color map input left unwired on the "DrawFlattenedPixmap.vi" component,

this is the color map I'd like to get hold of.

MyRainbow.jpg is my attempt, produced by taking a rainbow bitmap and modulating this with a repeating greyscale to give 'fringes' repeating every 8 intensity values. It helps with the job but doesn't look as clear to follow as the default map.

regards

 

dave Langstaff

 

Download All
0 Kudos
Message 5 of 11
(4,527 Views)

Hi Dave,

Quick question. Is there anyway you could post the code you are using to write the images to file and to open them back up again (or just a screen shot)

The open file options include a use colourmap input (as far as I can remember) is it possible you need to change these settings?

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 6 of 11
(4,506 Views)

Adam,

 

Here is the vi that I've used to create the bmp files, its in LV6.1 and I've marked up the wire that I can remove to get the display using the 'default' map.

 

I'm reading them beack in using paintshop/ms preview etc

0 Kudos
Message 7 of 11
(4,500 Views)

Dave,

 

If you double click the draw unflattened pixmap vi and look at the colour map what does this show? (my default is completely blank (they all look grey)

I can not get the default to display anything near to the colours you have there.

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 8 of 11
(4,496 Views)

Dave,

(sorry, I no longer have LabVIEW 6.1 installed, but maybe you can do something similar to the following. (Some of the image tools got enhanced in post 6.1, so things might be a bit different in your setup).

Once you have the desired picture on the front panel, have you tried one of the following two possibilities:

  1. Use an invoke node on the actual picture indicator with item "get image"?
  2. Use subVI "picture to pixmap"?

Then save the resulting output? (You could even unbundle the color table from the image data cluster for future use).

Message 9 of 11
(4,489 Views)

Adam,

Under 6.1, the default value for the color map on "draw flattened pixmap.vi" is empty. Looking at the code inside the vi, it detects this and sends an empty color map to the picture component.

By flattening the data sent to the picture component to a string and looking at it as hex, I can see the color map in the data, it starts at offset 38 into the data string and then goes on for a further 2048 bytes. Each 32bit word in the table is expanded into 8 bytes of the color map by repeating each byte.

It looks from this that the default color table is provided by the picture component...

0 Kudos
Message 10 of 11
(4,470 Views)