mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-05 13:21:12 +08:00
Speed up _convert
This commit is contained in:
@@ -502,14 +502,8 @@ def _convert(matrix, arr):
|
||||
The converted array.
|
||||
"""
|
||||
arr = _prepare_colorarray(arr)
|
||||
arr = np.swapaxes(arr, 0, -1)
|
||||
oldshape = arr.shape
|
||||
arr = np.reshape(arr, (3, -1))
|
||||
out = np.dot(matrix, arr)
|
||||
out.shape = oldshape
|
||||
out = np.swapaxes(out, -1, 0)
|
||||
|
||||
return np.ascontiguousarray(out)
|
||||
return np.dot(arr, matrix.T.copy())
|
||||
|
||||
|
||||
def xyz2rgb(xyz):
|
||||
|
||||
Reference in New Issue
Block a user