Search in sources :

Example 1 with GradientValue_F32

use of boofcv.struct.sparse.GradientValue_F32 in project BoofCV by lessthanoptimal.

the class TestSparseGradientSafe method checkMakeBorderSafe.

/**
 * Read in a border and see if it returns zeros
 */
@Test
public void checkMakeBorderSafe() {
    Dummy d = new Dummy();
    SparseImageGradient<GrayF32, GradientValue_F32> safe = new SparseGradientSafe<>(d);
    // read the border case
    GradientValue_F32 v = safe.compute(0, 0);
    assertTrue(v.x == 0);
    assertTrue(v.y == 0);
    // read inside and see if it has the expected results
    assertTrue(safe.compute(width / 2, height / 2) == null);
}
Also used : GrayF32(boofcv.struct.image.GrayF32) SparseGradientSafe(boofcv.struct.sparse.SparseGradientSafe) GradientValue_F32(boofcv.struct.sparse.GradientValue_F32) Test(org.junit.Test)

Aggregations

GrayF32 (boofcv.struct.image.GrayF32)1 GradientValue_F32 (boofcv.struct.sparse.GradientValue_F32)1 SparseGradientSafe (boofcv.struct.sparse.SparseGradientSafe)1 Test (org.junit.Test)1