Files
scikit-image/skimage/rank/generic.py
T
2012-10-17 12:07:20 +02:00

12 lines
210 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