Merge pull request #975 from jni/isrgb-depr

Remove deprecated functions is_gray and is_rgb
This commit is contained in:
Stefan van der Walt
2014-04-09 12:21:58 +02:00
4 changed files with 1 additions and 45 deletions
-2
View File
@@ -23,8 +23,6 @@ Version 0.10
* Remove deprecated parameter `depth` in `skimage.segmentation.random_walker`
* Remove deprecated logger function in `skimage/__init__.py`
* Remove deprecated function `filter.median_filter`
* Remove deprecated `skimage.color.is_gray` and `skimage.color.is_rgb`
functions
* Enable doctests of experimental `skimage.feature.brief`
* Remove deprecated `skimage.segmentation.visualize_boundaries`
* Remove deprecated `skimage.morphology.greyscale_*`
+1 -5
View File
@@ -44,9 +44,7 @@ from .colorconv import (convert_colorspace,
rgb_from_ahx,
ahx_from_rgb,
rgb_from_hpx,
hpx_from_rgb,
is_rgb,
is_gray)
hpx_from_rgb)
from .colorlabel import color_dict, label2rgb
@@ -100,8 +98,6 @@ __all__ = ['convert_colorspace',
'ahx_from_rgb',
'rgb_from_hpx',
'hpx_from_rgb',
'is_rgb',
'is_gray',
'color_dict',
'label2rgb',
'deltaE_cie76',
-26
View File
@@ -90,32 +90,6 @@ def guess_spatial_dimensions(image):
raise ValueError("Expected 2D, 3D, or 4D array, got %iD." % image.ndim)
@deprecated()
def is_rgb(image):
"""Test whether the image is RGB or RGBA.
Parameters
----------
image : ndarray
Input image.
"""
return (image.ndim == 3 and image.shape[2] in (3, 4))
@deprecated()
def is_gray(image):
"""Test whether the image is gray (i.e. has only one color band).
Parameters
----------
image : ndarray
Input image.
"""
return image.ndim in (2, 3) and not is_rgb(image)
def convert_colorspace(arr, fromspace, tospace):
"""Convert an image array to a new color space.
-12
View File
@@ -35,7 +35,6 @@ from skimage.color import (rgb2hsv, hsv2rgb,
lab2rgb, rgb2lab,
xyz2luv, luv2xyz,
luv2rgb, rgb2luv,
is_rgb, is_gray,
lab2lch, lch2lab,
guess_spatial_dimensions
)
@@ -355,17 +354,6 @@ def test_gray2rgb_rgb():
assert_equal(x, y)
def test_is_rgb():
color = data.lena()
gray = data.camera()
assert is_rgb(color)
assert not is_gray(color)
assert is_gray(gray)
assert not is_gray(color)
if __name__ == "__main__":
from numpy.testing import run_module_suite
run_module_suite()