12-21-2010 12:00 PM
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
Solved! Go to Solution.
12-21-2010 12:29 PM
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
12-21-2010 04:03 PM
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.
07-07-2011 01:50 AM
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.
07-07-2011 11:48 AM
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.
07-08-2011 09:07 AM
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.
07-08-2011 11:26 AM
The "Picture_to_ImaqImage.vi" in this zip file should worl for you.