mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-26 13:37:17 +08:00
removed commented code lines; fused types work now.
This commit is contained in:
@@ -12,7 +12,6 @@ from .._shared.transform cimport integrate
|
||||
cdef extern from "numpy/npy_math.h":
|
||||
double NAN "NPY_NAN"
|
||||
|
||||
|
||||
ctypedef fused uint_8_16:
|
||||
cnp.uint8_t
|
||||
cnp.uint16_t
|
||||
|
||||
@@ -106,8 +106,6 @@ def greycomatrix(image, distances, angles, levels=None, symmetric=False,
|
||||
|
||||
image_max = image.max()
|
||||
|
||||
#if image.dtype in [np.float, np.float16, np.float32, np.float]
|
||||
#if image.dtype == np.float:
|
||||
if np.issubdtype(image.dtype, np.float):
|
||||
raise ValueError("Float images are not supported by greycomatrix. "
|
||||
"The image needs to be cast to an unsigned integer type.")
|
||||
@@ -124,9 +122,6 @@ def greycomatrix(image, distances, angles, levels=None, symmetric=False,
|
||||
|
||||
assert image_max < levels, "The image maximum needs to be smaller than `levels`."
|
||||
|
||||
# image is cast to uint16 (because of fixed typing in cython)
|
||||
#image = image.astype(np.uint16)
|
||||
|
||||
distances = np.ascontiguousarray(distances, dtype=np.float64)
|
||||
angles = np.ascontiguousarray(angles, dtype=np.float64)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user