LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

different histogram in labview and matlab.

Thanks,

Yes I have to save lossless. I am not sure who is at fault. Windows has no problem vewing or making thumbnails for the PNGs, but that does not say if they have been scaled to use up all the dynamic range. I do not know who is at fault. I have not decided if I need to convert all of my older data to JP2, but going forward this sounds like a suitable solution. Thanks for your help.

0 Kudos
Message 41 of 43
(414 Views)
The data is scaled by a certain factor when Labview saves the data as explained in the link ("http://www.libpng.org/pub/png/spec/1.2/PNG-Encoders.html"). The scaling is done by simply left shiftting the original data by some certain number of bits, which is actually recorded in the sBIT chunk of the PNG file. So we can shift the data back. Assume the sBIT data is stored in the 42nd byte (you can easily find it with a binary file viewer), try the following code: Data = imread(FileName); fid1 = fopen(FileName); fseek(fid1,41,'bof'); offset = 16-fread(fid1,1); Data = bitshift(Data,-offset);
0 Kudos
Message 42 of 43
(362 Views)

Thanks,

I will give this a try when it comes up again.

0 Kudos
Message 43 of 43
(337 Views)