Exemple #1
0
def test_daisy_values():
    image = Image([[1.0, 2.0, 3.0, 4.0], [2.0, 1.0, 3.0, 4.0], [1.0, 2.0, 3.0, 4.0], [2.0, 1.0, 3.0, 4.0]])
    daisy_img = daisy(image, step=1, rings=2, radius=1, orientations=8, histograms=8)
    assert_allclose(np.around(daisy_img.pixels[10, 0, 0], 6), 0.001355)
    assert_allclose(np.around(daisy_img.pixels[20, 0, 1], 6), 0.032237)
    assert_allclose(np.around(daisy_img.pixels[30, 1, 0], 6), 0.002032)
    assert_allclose(np.around(daisy_img.pixels[40, 1, 1], 6), 0.000163)
Exemple #2
0
def test_daisy_values():
    image = Image([[1, 2, 3, 4], [2, 1, 3, 4], [1, 2, 3, 4], [2, 1, 3, 4]])
    daisy_img = daisy(image, step=1, rings=2, radius=1, orientations=8,
                      histograms=8)
    assert_allclose(np.around(daisy_img.pixels[0, 0, 10], 6), 0.000261)
    assert_allclose(np.around(daisy_img.pixels[0, 1, 20], 6), 0.002853)
    assert_allclose(np.around(daisy_img.pixels[1, 0, 30], 6), 0.007266)
    assert_allclose(np.around(daisy_img.pixels[1, 1, 40], 6), 0.001971)
Exemple #3
0
def test_daisy_values():
    image = Image([[1., 2., 3., 4.], [2., 1., 3., 4.], [1., 2., 3., 4.],
                   [2., 1., 3., 4.]])
    daisy_img = daisy(image, step=1, rings=2, radius=1, orientations=8,
                      histograms=8)
    assert_allclose(np.around(daisy_img.pixels[10, 0, 0], 6), 0.001355)
    assert_allclose(np.around(daisy_img.pixels[20, 0, 1], 6), 0.032237)
    assert_allclose(np.around(daisy_img.pixels[30, 1, 0], 6), 0.002032)
    assert_allclose(np.around(daisy_img.pixels[40, 1, 1], 6), 0.000163)
Exemple #4
0
def test_daisy_values():
    image = Image([[1, 2, 3, 4], [2, 1, 3, 4], [1, 2, 3, 4], [2, 1, 3, 4]])
    daisy_img = daisy(image,
                      step=1,
                      rings=2,
                      radius=1,
                      orientations=8,
                      histograms=8)
    assert_allclose(np.around(daisy_img.pixels[0, 0, 10], 6), 0.000261)
    assert_allclose(np.around(daisy_img.pixels[0, 1, 20], 6), 0.002853)
    assert_allclose(np.around(daisy_img.pixels[1, 0, 30], 6), 0.007266)
    assert_allclose(np.around(daisy_img.pixels[1, 1, 40], 6), 0.001971)
Exemple #5
0
def test_daisy_channels():
    n_cases = 3
    rings = np.random.randint(1, 3, [n_cases, 1])
    orientations = np.random.randint(1, 7, [n_cases, 1])
    histograms = np.random.randint(1, 6, [n_cases, 1])
    channels = np.random.randint(1, 5, [n_cases, 1])
    for i in range(n_cases):
        image = Image(np.random.randn(channels[i, 0], 40, 40))
        daisy_img = daisy(
            image, step=4, rings=rings[i, 0], orientations=orientations[i, 0], histograms=histograms[i, 0]
        )
        assert_allclose(daisy_img.shape, (3, 3))
        assert_allclose(daisy_img.n_channels, ((rings[i, 0] * histograms[i, 0] + 1) * orientations[i, 0]))
Exemple #6
0
def test_daisy_channels():
    n_cases = 3
    rings = np.random.randint(1, 3, [n_cases, 1])
    orientations = np.random.randint(1, 7, [n_cases, 1])
    histograms = np.random.randint(1, 6, [n_cases, 1])
    channels = np.random.randint(1, 5, [n_cases, 1])
    for i in range(n_cases):
        image = Image(np.random.randn(channels[i, 0], 40, 40))
        daisy_img = daisy(image, step=4, rings=rings[i, 0],
                          orientations=orientations[i, 0],
                          histograms=histograms[i, 0])
        assert_allclose(daisy_img.shape, (3, 3))
        assert_allclose(daisy_img.n_channels,
                        ((rings[i, 0] * histograms[i, 0] + 1) * orientations[i, 0]))