Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

data in labview PNG file

We have IMAQ 1409 to capture 10-bit images from camera and save them into 16-bit PNG files.
But I have trouble to obtain correct data from PNG files with third party softwares (such as matlab). After loading PNG file into matlab, I found the values of pixels are much bigger than 1024. So I guess the labview has converted the 10-bit data into 16-bit data based on some rule. Can I convert them back? because I really need the raw data.
By the way, this happens in the newest version of Vision. When we used IMAQ-vision 5.0, the 16-bit PNG file preserved the 10-bit data, in other word, the data are always smaller than 1024.  
0 Kudos
Message 1 of 4
(3,965 Views)
What vi are you using to write the image to a PNG file?  Also, have you tried reading the file back into LabVIEW and displaying it? Certain imaqe file types use different styles of compression and bit arrangement, and it may be that Matlab interprets these different than LabVIEW.  Please let me know.
 
Jason N
0 Kudos
Message 2 of 4
(3,946 Views)
Dear Jason,
Both "IMAQ Write File" and "IMAQ Write PNG File" were tried. We got the same results. And we also used labview to read the 16-bit PNG files and displayed them, there is no problem.  When I put cursor on a certain pixel, the value is always smaller than 1024.
 
The reasons we think that the format of labview PNG changed are as following:
1) we have some old 10-bit images which saved in 16-bit PNG files with labview 5.0/IMAQ Vision 5.0, their values are still within 10 bits if opened with matlab.
2) If we use windows picture and fax viewer to see those old 10-bit images saved with IMAQ vision 5.0, they are totally black, which means those old PNG files only contain values within 10 bits although they are 16-bit PNG. But if we view the 16-bit PNG files created by new version of Vision, we see pleasant images. Unfortunately, we want raw date instead of pleasant viewing.
 
When we use "IMAQ Write PNG file" vi, we set "image quality" at 1000. We also noticed that the new version of "IMAQ Write PNG File" has one more argument than the old version. It is "Use Bit Depth?". We guess this argument might be related to our problem. But simply setting it at either true or false doesn't solve the problem.
Thanks!
RC
0 Kudos
Message 3 of 4
(3,935 Views)
Good afternoon RC,
 
If you weret open these new images up in LabVIEW, and then convert the image to an array, would those values also be greater than 1024?  Or are those larger values only seen in Matlab?  I snapped a 10-bit image, and then wrote it to file.  I then, in a separate VI, opened that image, converted it to an array, using IMAQ ImagetoArray.VI, and then took the max value.  The max value was 1023.  Is this behavior the same that you see?
 
Respectfully,
0 Kudos
Message 4 of 4
(3,907 Views)