mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-26 13:37:17 +08:00
use dtype.img_as_float in _convert for colorspaces.
All conversions are done as matrix multiplications with floats, so this is the only way not to lose precision.
This commit is contained in:
@@ -50,6 +50,7 @@ __docformat__ = "restructuredtext en"
|
||||
|
||||
import numpy as np
|
||||
from scipy import linalg
|
||||
from ..util import dtype
|
||||
|
||||
|
||||
def convert_colorspace(arr, fromspace, tospace):
|
||||
@@ -299,9 +300,10 @@ def _convert(matrix, arr):
|
||||
|
||||
Returns
|
||||
-------
|
||||
out : ndarray
|
||||
out : ndarray, dtype=float
|
||||
The converted array.
|
||||
"""
|
||||
arr = dtype.img_as_float(arr)
|
||||
arr = _prepare_colorarray(arr)
|
||||
arr = np.swapaxes(arr, 0, 2)
|
||||
oldshape = arr.shape
|
||||
|
||||
Reference in New Issue
Block a user