For the purpose of a machine learning algorithm I'm tying to automatically scale images of arbitrary bitdepth to unit interval, i.e. I want to map pixels from [0,2x] to [0,1] simply by dividing all pixels by 2x. I want to do this without knowing anything about the pixelvalue distribution or statistics inside the image. The only thing that I know is the metadata. To open images I use
gdal in python via
data = gdal.Open(path)
The images are given in
Typically 12bit images will be saved in a 16bit format, where pixel values above 4095 won't occure. Nevertheless the meta tag bitdepth will be 16bit.
Is there any valid way to check whether an image is a true 16bit image or a 12bit image inside a 16bit image, without calculating the statistics? Is there any meta tag that serves this information?