LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to go from 12 bit grayscale to 24 bit RGB?

Within the same grab acquisition, is there a way to switch between acquiring 12 bit grayscale images and RGB images? For instance, in one grab I would acquire a grayscale image and then in the next cycle acquire a RGB image. I am trying to keep my dynamic range as wide as possible and thus, would like to avoid acquiring in RGB and transforming my image to grayscale.
 
To acquire 12 bit grayscale images, I know I have to first acquire in 16 bit using IMAQ Create to designate the image type. However for the RGB images, I designate the image type in IMAQ Create as 8 bit for each channel.
 
Anyone have any ideas?
 
Thanks.
0 Kudos
Message 1 of 2
(2,328 Views)

Hello jpyung,

Thanks for contacting NI.  What you can do is create two buffers outside of the while loop.  One will be for the 12 bit grayscale images (I16), and the other for RGB.  Create a case structure inside the while loop that will contain the same Grab VI in both cases.  One will receive the buffer for grayscale, and the other will receive the buffer for RGB.  The case structure will allow you to toggle between these cases and write images to each of these buffers respectively.

Regards,

Mike T

National Instruments

0 Kudos
Message 2 of 2
(2,305 Views)