Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

acquiring Bayer 12 images without converting to RGB 24

I am using the IMAQdx VIs to acquire from a firewire camera which is set to output 12 bit Bayer images.
 
The IMAQdx Grab.vi doesn't seem to allow the full 12 bit Bayer image to be saved. I am using IMAQ WriteFile.vi to save the file and even when I configure the IMAQ file type as 64 bit, I end up with RGB24 images. I really want a 48 bit image. If there is an option to save the RAW file then that would be perfect. I can convert them with another software I use.
 
This is for an underwater imaging application and I know that the 48 bit images will be crucial in allowing adjustments to enhance the acquired images.
 
Thanks in advance for yoiu help.
0 Kudos
Message 1 of 3
(5,352 Views)

Your best option is probably to acquire the raw bayer image as a 16 bit grayscale image and process it later.  On the camera end, you need to select an output mode that will send the raw image.  On the computer end, you need to select 16 grayscale.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 3
(5,343 Views)
It is possible to acquire the raw 12-bit Bayer images with NI-IMAQdx. You have two options for extracting the 12-bit Bayer data.

1) Disable Bayer Conversion
The NI-IMAQdx driver allows you to disable Bayer conversion.  In Measurement & Automation Explorer, select the Bayer Color tab. From the Bayer Pattern droplist, select "None".  Note that this only works with NI-IMAQdx 3.0.1 or later. With the Bayer conversion disabled, the data will be returned as a 16-bit monochrome image. You may use IMAQ Write File to save the raw data to disk.




OR

2) Get Image Data
The NI-IMAQdx API has a function called IMAQdx Get Image Data. This function will return the raw data acquired from the camera with no correction or conversion. Acquire the data into a 1D array of 16-bit pixels. You may have to correct each byte for endianness if the camera is transferring the data as big endian. You will have to implement your own mechanism to save a 1D array to disk.

Currently the Vision software does not decode 12-bit Bayer images to 48-bit color. Your software can convert data to 48-bit color. Your only task would be to massage the data to be suitable for reading with your software.

Hope this helps,

JohannS



Message Edited by JohannS on 07-16-2007 09:20 AM

0 Kudos
Message 3 of 3
(5,325 Views)