Files
scikit-image/skimage/rank/generic.py
T
2012-10-29 18:07:47 +01: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