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);
}
Aggregations