Exemplo n.º 1
0
def test_colors():
    f = mahotas.imread('mahotas/demos/data/luispedro.jpg')
    lab = rgb2lab(f)
    assert np.max(np.abs(lab)) <= 100.
    assert np.max(np.abs(xyz2rgb(rgb2xyz(f)) - f)) < 1.
    lab8 = rgb2lab(f, dtype=np.uint8)
    assert lab.dtype != np.uint8
    assert lab8.dtype == np.uint8
Exemplo n.º 2
0
def test_colors():
    f = mahotas.imread('mahotas/demos/data/luispedro.jpg')
    lab = rgb2lab(f)
    assert np.max(np.abs(lab)) <= 100.
    assert np.max(np.abs(xyz2rgb(rgb2xyz(f)) - f)) < 1.
    lab8 = rgb2lab(f, dtype=np.uint8)
    assert lab.dtype != np.uint8
    assert lab8.dtype == np.uint8
Exemplo n.º 3
0
def test_colors():
    f = mahotas.imread("mahotas/demos/data/luispedro.jpg")
    lab = rgb2lab(f)
    assert np.max(np.abs(lab)) <= 100.0
    assert np.max(np.abs(xyz2rgb(rgb2xyz(f)) - f)) < 1.0

    lab8 = rgb2lab(f, dtype=np.uint8)
    assert lab.dtype != np.uint8
    assert lab8.dtype == np.uint8

    xyz = rgb2xyz(f, dtype=np.uint8)
    assert xyz.shape == f.shape
    assert xyz.dtype == np.uint8
Exemplo n.º 4
0
def test_colors():
    f = luispedro_jpg()
    lab = rgb2lab(f)
    assert np.max(np.abs(lab)) <= 100.
    assert np.max(np.abs(xyz2rgb(rgb2xyz(f)) - f)) < 1.

    lab8 = rgb2lab(f, dtype=np.uint8)
    assert lab.dtype != np.uint8
    assert lab8.dtype == np.uint8

    xyz = rgb2xyz(f, dtype=np.uint8)
    assert xyz.shape == f.shape
    assert xyz.dtype == np.uint8