Search in sources :

Example 1 with SceneCommonCounts

use of boofcv.alg.structure.SceneMergingOperations.SceneCommonCounts in project BoofCV by lessthanoptimal.

the class TestSceneMergingOperations method findViewCounts.

@Test
void findViewCounts() {
    var list = new DogArray<>(SceneCommonCounts::new, SceneCommonCounts::reset);
    // First two calls should add elements. The third all look up the first one again
    SceneCommonCounts found1 = SceneMergingOperations.findViewCounts(list, 5);
    SceneCommonCounts found2 = SceneMergingOperations.findViewCounts(list, 6);
    SceneCommonCounts found3 = SceneMergingOperations.findViewCounts(list, 5);
    assertEquals(2, list.size);
    assertSame(found1, found3);
    assertEquals(5, found1.sceneIndex);
    assertEquals(6, found2.sceneIndex);
}
Also used : SceneCommonCounts(boofcv.alg.structure.SceneMergingOperations.SceneCommonCounts) DogArray(org.ddogleg.struct.DogArray) Test(org.junit.jupiter.api.Test)

Aggregations

SceneCommonCounts (boofcv.alg.structure.SceneMergingOperations.SceneCommonCounts)1 DogArray (org.ddogleg.struct.DogArray)1 Test (org.junit.jupiter.api.Test)1