mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-05 11:09:00 +08:00
11 lines
207 B
Python
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
|