use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.
the class TestHysteresisEdgeTraceMark method standardTest.
private void standardTest(int which) {
GrayF32 inten = intensity(which);
GrayS8 dir = direction(which);
GrayU8 out = new GrayU8(inten.width, inten.height);
HysteresisEdgeTraceMark alg = new HysteresisEdgeTraceMark();
alg.process(inten, dir, 2, 5, out);
BoofTesting.assertEquals(expected(which), out, 0);
}
use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.
the class TestHysteresisEdgeTracePoints method standardTest.
private void standardTest(int which) {
GrayF32 inten = intensity(which);
GrayS8 dir = direction(which);
HysteresisEdgeTracePoints alg = new HysteresisEdgeTracePoints();
alg.process(inten, dir, 2, 5);
GrayU8 out = convert(alg.getContours(), inten.width, inten.height);
BoofTesting.assertEquals(expected(which), out, 0);
}
use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.
the class TestHysteresisEdgeTracePoints method test2.
@Test
public void test2() {
GrayS8 dir = direction(2);
HysteresisEdgeTracePoints alg = new HysteresisEdgeTracePoints();
alg.process(intensity(2), dir, 3, 5);
assertEquals(3, ImageStatistics.sum(convert(alg.getContours(), dir.width, dir.height)));
alg.process(intensity(2), dir, 2, 5);
assertEquals(4, ImageStatistics.sum(convert(alg.getContours(), dir.width, dir.height)));
}
use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.
the class TestImplEdgeNonMaxSuppression method naive4.
@Test
public void naive4() {
GrayF32 intensity = new GrayF32(3, 3);
GrayF32 output = new GrayF32(3, 3);
GrayS8 direction = new GrayS8(3, 3);
// test it against simple positive and negative cases
for (int dir = -1; dir < 3; dir++) {
direction.set(1, 1, dir);
GImageMiscOps.fill(intensity, 0);
intensity.set(1, 1, 10);
// test suppress
setByDirection4(intensity, dir, 15);
ImplEdgeNonMaxSuppression.naive4(intensity, direction, output);
assertEquals(0, output.get(1, 1), 1e-4f);
// test no suppression
setByDirection4(intensity, dir, 5);
ImplEdgeNonMaxSuppression.naive4(intensity, direction, output);
assertEquals(intensity.get(1, 1), output.get(1, 1), 1e-4f);
}
}
use of boofcv.struct.image.GrayS8 in project BoofCV by lessthanoptimal.
the class TestImplEdgeNonMaxSuppression method inner8.
@Test
public void inner8() {
GrayF32 intensity = new GrayF32(width, height);
GrayS8 direction = new GrayS8(width, height);
GrayF32 expected = new GrayF32(width, height);
GrayF32 found = new GrayF32(width, height);
BoofTesting.checkSubImage(this, "inner8", true, intensity, direction, expected, found);
}
Aggregations