LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Picture variable to image (IMAQ)

Solved!
Go to solution

I am trying to convert a "picture" type to "image type" . The "picture" type is from Graphics & Sound toolbox and image type comes from Vision and Motion toolbox.

Writing to a file like jpg and rereading it as an image is not an option.

The picuture is a color XY plot or similar.

 

  As suggested at the forum but not confirmed by anybody I tried to use the trio: Picture it Pixmap, Unflatten Pixmap and IMAQ ArrayToImage. Well, no errors but when I tried to display it, nothing shows up. To be correct it displayed the plot once in black and white and never again. I tried to use all kinds of combination of the ports between Unflatten and IMAQ without any luck.

 

I use LB 2009 SP1 and I am somewhat familiar with the IMAQ stuff but I am missing something here for sure. Is there a more detailed explanation of the output ports of Unflatten Pixmap and the input ports of IMAQ ArrayToImage?

thanks

0 Kudos
Message 1 of 7
(5,008 Views)

Update.

It works when I set a maching image type in IMAQ Create. Lets say I use the U16 port on IMAQ ArrayToImage so the type has to be set to U16 in IMAQ Create. I am used to the fact that LB  IMAQ functions were switching to a proper type when necessary, apparently not this function.

 

I am still not able to get the color out to the Image type. It is all B&W and forcing the RGB type in IMAQ Create gives an error.

 

Below, the are three files: The data to read, a subvi to process the data and the vi to convert the plot to picture' graph idea1.vi

Download All
0 Kudos
Message 2 of 7
(5,000 Views)
Solution
Accepted by topic author AndyN

The solution is... to read the small font. IMAQ ArrayToImage  does not deal with colors.

When IMAQ ArrayToColorImage is used everything is just fine.

 

Quite confusing though. It would be nice to either combine those two or provide a better description.

0 Kudos
Message 3 of 7
(4,989 Views)

I had the same problem. Tried to solve it by saving the picture to a .bmp file, then loading the file as an IMAQ image. This method is much simpler. Thanks! 🙂

 

Still, I think NI should provide a picture -> IMAQ image function. Why should we have to worry about creating and unflattening pixmaps? LabVIEW is supposed to do all that kind of stuff for us.

0 Kudos
Message 4 of 7
(4,811 Views)

LV is great in the way you can very quickly hook up almost any hardware to it and start using it instantly. However, I noticed that different teams are working on different modules, yet similar in nature, and they do not provide the same interface or a way to transition from one to another. Like here.

0 Kudos
Message 5 of 7
(4,803 Views)

Hi everyone,

 

Thanks for your suggestion.  I have included the suggestion into our LabVIEW Idea Exchange, so feel free to Kudo the idea here.

 

R&D looks into these ideas and incorporates a select few into future versions of LabVIEW.  Thanks!

 

Kim W.

Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(4,786 Views)

The "Picture_to_ImaqImage.vi" in this zip file should worl for you.

Message 7 of 7
(4,776 Views)