Exemplo n.º 1
0
def test_image_extract_channels_multiple_reversed():
    image = Image(np.random.rand(120, 120, 3))
    extracted = image.extract_channels([2, 0])
    assert_equal(extracted.pixels[..., 0], image.pixels[..., 2])
    assert_equal(extracted.pixels[..., 1], image.pixels[..., 0])
Exemplo n.º 2
0
def test_image_extract_channels_multiple_reversed():
    image = Image(np.random.rand(3, 120, 120), copy=False)
    extracted = image.extract_channels([2, 0])
    assert_equal(extracted.pixels[0], image.pixels[2])
    assert_equal(extracted.pixels[1], image.pixels[0])
Exemplo n.º 3
0
def test_image_extract_channels():
    image = Image(np.random.rand(120, 120, 3))
    extracted = image.extract_channels(0)
    assert_equal(extracted.pixels, image.pixels[..., [0]])
Exemplo n.º 4
0
def test_image_extract_channels_multiple_reversed():
    image = Image(np.random.rand(120, 120, 3))
    extracted = image.extract_channels([2, 0])
    assert_equal(extracted.pixels[..., 0], image.pixels[..., 2])
    assert_equal(extracted.pixels[..., 1], image.pixels[..., 0])
Exemplo n.º 5
0
def test_image_extract_channels():
    image = Image(np.random.rand(3, 120, 120), copy=False)
    extracted = image.extract_channels(0)
    assert_equal(extracted.pixels, image.pixels[[0], ...])
Exemplo n.º 6
0
def test_image_extract_channels():
    image = Image(np.random.rand(120, 120, 3))
    extracted = image.extract_channels(0)
    assert_equal(extracted.pixels, image.pixels[..., [0]])
Exemplo n.º 7
0
def test_image_extract_channels_multiple_reversed():
    image = Image(np.random.rand(3, 120, 120), copy=False)
    extracted = image.extract_channels([2, 0])
    assert_equal(extracted.pixels[0], image.pixels[2])
    assert_equal(extracted.pixels[1], image.pixels[0])
Exemplo n.º 8
0
def test_image_extract_channels():
    image = Image(np.random.rand(3, 120, 120), copy=False)
    extracted = image.extract_channels(0)
    assert_equal(extracted.pixels, image.pixels[[0], ...])
Exemplo n.º 9
0
def test_image_extract_channels_multiple():
    image = Image(np.random.rand(3, 120, 120))
    extracted = image.extract_channels([0, 2])
    assert_equal(extracted.pixels[0], image.pixels[0])
    assert_equal(extracted.pixels[1], image.pixels[2])
Exemplo n.º 10
0
def test_image_extract_channels_multiple():
    image = Image(np.random.rand(3, 120, 120))
    extracted = image.extract_channels([0, 2])
    assert_equal(extracted.pixels[0], image.pixels[0])
    assert_equal(extracted.pixels[1], image.pixels[2])