LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract image from CWIMAQ control into LabVIEW

I am extracting an image from VisionBuilder into LabVIEW using the image method from the CWIMAQ control.  The image displays properly on the CWIMAQ Viewer but I need save that image as a PNG file.  When I try to display the image in a LabVIEW image control, it displays as the mirror image and the color is incorrect.  The image type is reported as "cwimaqImageTypeRGB32".  Attached is an image of my code.
 
Thanks.
0 Kudos
Message 1 of 4
(3,368 Views)
Hi rppda,

Thank you for posting on the National Instruments discussion forums.

I have recreated this here and I am seeing the same behavior.  I was able to fix the orientation of the image using a Transpose 2D Array node.  As for the color issue, the problem is that the RGB data is being read in the incorrect order.  For instance, if the RGB values of the image are supposed to be (148,99,90), they are being passed to the IMAQ ArraytoColorImage VI as (90,99,148).

I will need to speak with R&D to see if there is an easy way to go through the array and fix this.  Because of the holidays, this may take a couple of days to do, but I will post a suggestion as soon as I have one.  In the meantime, if you are able to find a way to fix this, please reply and let me know.  Thanks.


Rishee B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,331 Views)
Hi rppda,

I have spoken to R&D, and it turns out there is a simple fix to this.  All you need to do is use the Split Number and Join Numbers VI to rearrange the RGB data in the 32-bit array.  I have attached a screenshot of the code I used to do this.  I have tested this on my system and it worked.  Please give this a try and post a reply if you have any difficulty.  Thanks.



Rishee B.
Applications Engineer
National Instruments


Message Edited by risheeb on 01-03-2008 11:24 AM
0 Kudos
Message 3 of 4
(3,293 Views)

Hi Rishee,

Sorry for the delay but I did try your solution and it worked great.  Thank you.

0 Kudos
Message 4 of 4
(3,236 Views)