Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to retain original grayscale values, if process PNG image with Python.

Solved!
Go to solution

I need to process a 12-bit grayscale image saved in png format with Python. A monochromatic 12-bit camera was used as the signal source. The image file was created with  IMAQ Write File2.vi. The maximum pixel value is 419 counts.
When I load the image with Python3 imageio-2.32.0 imageio.imread("testimagefile"), it seems that the image is scaled automatically, the maximum value is now 55019 counts. Does IMAQ Write File2.vi store PNG Files with some kind of scaled flag? Does anyone have any ideas on how to get the original values?

0 Kudos
Message 1 of 3
(629 Views)
Solution
Accepted by topic author p4keal

Hi!

 

It was answered and solved here in the past: How do you load signed 16 bit PNG file outside of LabVIEW?

 

Python script from dgagnon05 in the attachment.

 

Andrey.

 

Message 2 of 3
(569 Views)

This is a really in-depth analysis. I assume, even Imagio developers are not aware of it.
Thanks a lot!

0 Kudos
Message 3 of 3
(528 Views)