LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write 16 bit images into AVI file

Whew! David, I'm glad we found the problem! I can't believe I didn't catch that before, but I suppose it's just one of those things that are easy to gloss over.
0 Kudos
Message 31 of 33
(1,457 Views)


** of course some lossless compression would be nice


A simple trick is to store your files into a folder with the compress-files option set to on. Very easy and efficient in storage. Unfortunately such files are uncompressed before being copied to another storage system. Natively compressed files dont suffer this drawback of course. File compress option is a quick fix to increase local storage capacity

 

Henning

0 Kudos
Message 32 of 33
(1,340 Views)

Hi Michael,

 

I am having similar problem as David, although I am programmed in Labview not in C++. I read all the messages in this thread. I could not follow the solution given in this thread. So, I am posting my problem. 

 

I have a aim similar to David, where I want to acquire several 100 16bit images (12bit actually)  and save them without any loss of information. The procedure I followed is:

  1.  Grab the image and convert it into an Array using ImageToArray function
  2. Cast the array into U32 format.
  3. Use the ArrayToColorImage function to convert the RGB image and add into AVI file.
  4. I have a different program to again convert the RGB image back to an array and save them as ASCII text or dat files for subsequent analysis in MATLAB or other software.

See the attached VIs with the code.

 

When I do that. The program seems to be working for the first AVI file. The information is preserved between the conversion. But, the data in the second and subsequent AVI is cast differently. The number are close the maximum limit of U32 format ( 4.2950e+009 etc) rather than in the limit from 1 to 4096. I checked the pixel values after casting to U32 and the pixel values as same as in the 16bit array. Similarly, the data from the first AVI has pixel values from 1 to 4096. 

 

Similar to David's problem, when I exit from Labview and restart the program the first AVI works and the remaining gives the same problem. 

I further analyzed the arrays extracted from the first and the second AVI. I took data from a standard image for the first and the second AVI. When I determine the minimum pixel value and subtract the value from the all the pixels of the image, the pixel values of the two images becomes same. That is the minimum pixel value (value near 4.2950e+009) of the image from second AVI  is subtracted from other pixels and the minimum pixel value (around 250) of the image from first AVI is subtracted from respective image. Then both the images look the same. 

 

That is somehow on subsequent AVIs the ArrayToColorImage function is converting the values differently. I am attaching the VIs. I have been trying to figure it out for a while. 

 

I appreciate any help in this matter. 

 

Thank You,

Ravi.

Download All
0 Kudos
Message 33 of 33
(1,280 Views)