LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open 32-bit jpeg & convert to intensity graph form (LV8.5 & Vision 8.5)

I will cross-post this in the Machine Vision forum as well.  I have an LLB to open images with IMAQ vision utilities, and then attempt to convert to intensity graph format. I obtain the color table of the image from a Vision utility, and subsequently apply to the intensity graph in hopes of duplicating the vision container contents.  I  am unsuccessful in converting 32-bit jpeg and was hoping for some help.  Please let me know if this in fact is even possible to do.  Attached is an example jpeg image file.

Sincerely,

Don
0 Kudos
Message 1 of 12
(4,313 Views)

I don't have IMAQ loaded so I am of limited use.

Are you keeping the color table under 256 colors?

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 12
(4,300 Views)

I have a color table translater subvi (color_table_translater_scanner.vi) that converts the array of clusters color table format output by imaq vision ReadFile fx into the proper format required by the color table property node for an intensity graph.  At least I thought it did.  But the 32-bit format must be confounding it.

 

The issue really boils down to this - how can we open and display this image file properly in a LabVIEW intensity graph? The standard open graphic file fx Read JPEG File.vi does not seem to open this file properly which is why I went to the Vision ReadFile fx in the first place.

 

Sincerely,

 

Don

0 Kudos
Message 3 of 12
(4,285 Views)
Don,
 
I get your VI working.   You made 2 mistakes:
1. jpg files are 24 bit images, which has no color table.  Your color table VI should return an empty array.
2. Convert from color to gray isn't just pickup one color.
 
 
George Zou
 


Message Edited by zou on 11-28-2007 10:10 AM
George Zou
Download All
0 Kudos
Message 4 of 12
(4,275 Views)
But the intensity graph just shows up as greyscale. I did a similar workaround to yours just using the Read Jpeg File.vi where I ended up applying just a greyscale color table to the data if the color table output was empty.
 
How do I get the colors of the image (those seen in the vision control) to be applied to the intensity graph image? In other words, even if no official color table, the iimage has an "effective color table."
 
Also - note that the vision control information indicator has this as a 32-bit image.
 
Sincerely,
 
Don
0 Kudos
Message 5 of 12
(4,268 Views)
Don,
 
The effective color table size for a 24 bit image can be 2^24 long.  Not suitable for intensity graph anyway.
 
To display the jpeg image as color in intensity graph, you have to convert the image to 8 bit first.  An 8 bit image have color table.
 
 
George Zou
 


Message Edited by zou on 11-28-2007 10:29 AM
George Zou
0 Kudos
Message 6 of 12
(4,265 Views)

Since the jpeg does not carry the color table information, I thought using IMAQ ReadFile fx, which has a 'color palette out' terminal might 'magically' interpret / create the necessary color table information (which I then could convert to the 256-bit color table format for the intensity graph using my 'color_table_translater_scanner.vi').

I just grabbed one 8-bit color plane (rather than the resolved color) to use as my raw data prior to applying the color table. That was my attempt to convert from the 24-bit to the 8-bit image (addressing your comment above regarding converting to 8-bit image).

So basically you are saying this is a hopeless exercise as far as you know?

 

Sincerely,

 

Don



Message Edited by DonRoth on 11-28-2007 11:01 AM
0 Kudos
Message 7 of 12
(4,258 Views)

>I just grabbed one 8-bit color plane (rather than the resolved color) to use as my raw data prior to applying the color table.

>That was my attempt to convert from the 24-bit to the 8-bit image (addressing your comment above regarding converting to 8-bit image).

You're getting single color by using this converting method.  Greyscale looks better than single color.

You've to use a better method to do the convertion.  If IMAQ can't do it, my Image Toolbox can.  Or you can use Photoshop to do the convertion before use your VI.

 

>So basically you are saying this is a hopeless exercise as far as you know?

Display an 8 bit color image in intensity graph is possible.

 

By the way, Read Jpeg File.vi works fine for your jpeg image.

 

George Zou

http://gtoolbox.yeah.net

 

George Zou
0 Kudos
Message 8 of 12
(4,247 Views)

Hi George:

Yes - I understand I am getting only one color plane. 

 

With LabVIEW / Vision only, can this jpeg image be displayed in an intensity graph with the proper (original) color information? You say the LabVIEW Read Jpeg File.vi reads this image fine - but how do you display the output of this fx in an intensity graph with the original / proper color information (again using only LabVIEW / Vision, or maybe your toolkit)?

 

Do you know why the Vision container specifies 32-bit RGB for this image?

 

ps. I do have an older version of your toolkit that I bought several years back. Probably need to update it for LabVIEW 8.5.

 

Sincerely,

 

Don

0 Kudos
Message 9 of 12
(4,214 Views)


DonRoth wrote:

Hi George:

Yes - I understand I am getting only one color plane. 

With LabVIEW / Vision only, can this jpeg image be displayed in an intensity graph with the proper (original) color information? You say the LabVIEW Read Jpeg File.vi reads this image fine - but how do you display the output of this fx in an intensity graph with the original / proper color information (again using only LabVIEW / Vision, or maybe your toolkit)?


Unless it is an 8 bit color image already you can always down sample it to 8 bit. I think the IMAQ Cast function should do that, otherwise there is for sure some function to change color depth. Colors will of course change slightly as it is very unlikely that a 24bit image especially if it is a photo, has only 256 unique colors used.
 
Once you converted your IMAQ image into an 8 bit image extracting the bitmap and color dtable is easy and then applying it to an intensity graph of course too. Remains the question why you wouldn't want to use the IMAQ control. If it is about IMAQ license costs then of course you won't be able to use other IMAQ functions either so this advice won't help then.
 
Rolf Kalbemratter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 10 of 12
(4,207 Views)