Files
scikit-image/skimage/rank/generic.py
T
2012-10-05 12:09:03 +02:00

11 lines
207 B
Python

import numpy as np
def find_bitdepth(image):
"""returns the max bith depth of a uint16 image
"""
umax = np.max(image)
if umax>2:
return int(np.log2(umax))
else:
return 1