01-10-2008 01:05 PM
01-10-2008 02:11 PM
01-11-2008 03:15 PM
OK, thanks;
I have since got most of my "save image to raw" working, for the specific raw format I am looking for. Essentially, I dump the image into a 1D array, and write to a binary file, specifying little endian byte order. However, I am getting an incorrect result.
I have attached a screenshot of my code... here are my steps:
(1) Convert image to 2D array using IMAQ ImageToArray and I16 to U16 conversion;
(2) Reshape 2D array into a consecutive 1D array;
(3) Write 1D array to a binary file, using little endian byte format.
Essentially, this is working, except that the two "halves" of my image are switched... i.e. columns 0-2047 are where 2048-4095 are supposed to be, and vice versa! (see "Split Image Display.bmp; I have included "Proper Image Display.bmp" to show the correct image... observe the horizontal sliders to see where the switch actually takes place).
The image I am trying to convert and save is a 16-bit, 4095x2048 image.
I have troubleshooted the array conversion, and it seems to be working correctly... i.e. row1=0-4095, row2=4096-8191, row3=8192-12287, and so on.
Is there anything obvious I am doing incorrectly? Is there a possible issue with how I am writing to binary file?
Any help would be appreciated! Thanks in advance!
DJH
01-14-2008 08:30 AM
01-14-2008 01:36 PM
01-15-2008 11:03 AM
Absolutely!
Please see attached for the IMQ - Save Image to File.vi;
Insofar as reading in the RAW file, here are the settings I use (these match the Save VI):
!RAW Image Setup
Image Type=Grayscale (I16)
Image Size X=4096
Image Size Y=2048
!RAW File Options
Read Raw File=Read Raw File
File Data Type=16 bits (unsigned)
Offset to Data=0
Use Min Max=Don't use min max
Optional Min Value=0
Optional Max Value=0
Byte Order=Little endian (Intel)
Hope this helps!
DJH
01-25-2008 05:40 AM