LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ ImageToArray

I want to convert my color image from a camera to an array of values. I see IMAQ ImageToArray but the outputs are 2D array of U8, I16, U16 or Float. My camera is color so I expect Red, Green, Blue values. How does that fit into a 2D array of single-valued ints or floats?

 

The device is a 2k x 2k (4 Mpixel) USB3 color camera.  Frames come into LabView 2015 through the NI Vision Acquisition Wizard.  When I display the image on my front panel, it says in the panel at the bottom 2048x2048  32-bit RGB image

0 Kudos
Message 1 of 4
(3,119 Views)

Nevermind, apparently I need to use the color version of this vi, eg.

http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_colorimagetoarray/

 

which I would like to combine with IMAQ IntegerToColorValue VI as described in the help for ColorImageToArray.

This function is supposedly on the "Vision and Motion -> Vision Utilities -> Color Utilities" palette but I cannot find this function, it does not seem to be installed on my system.  http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_integertocolorvalue/

The last online help file containing that VI is from LabView 2011, did it get removed after that? But the reference to it is still there in the help for my LabView 2015, just not the actual VI itself.

 

 

0 Kudos
Message 2 of 4
(3,102 Views)

Color images usually use 32-bit pixels, with three bytes giving R, G, B intensities using 8-bits each (leaving 8 bytes for "future expansion").  There are functions in IMAQ that can pull a Color Image apart into its R, G, and B components (I may have posted one on the Forums ...).

 

Bob Schor

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

Turns out I never installed the 2015 Vision Dev Module, although I had the 2014 version. Somehow my older code worked but that's the reason the  IMAQ IntegerToColorValue VI was missing. After installing the 2015 Vision Dev Module then I see the code and it works now.

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