use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestContourTracer method funk4.
@Test
public void funk4() {
String s = "101\n" + "111\n" + "101\n";
GrayU8 pattern = stringToImage(s);
shiftContourCheck(pattern, 12, ConnectRule.FOUR);
}
use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestContourTracer method interior2.
@Test
public void interior2() {
String s = "01111\n" + "01101\n" + "11111\n";
GrayU8 input = stringToImage(s);
GrayS32 label = new GrayS32(input.width, input.height);
ContourTracer alg = new ContourTracer(ConnectRule.FOUR);
// process the image
alg.setInputs(addBorder(input), label, queue);
queue.grow();
alg.trace(2, 3 + 1, 0 + 1, false);
assertEquals(8, queue.sizeOfTail());
}
use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestContourTracer method funky3.
@Test
public void funky3() {
String s = "0100\n" + "0110\n" + "1101\n";
GrayU8 input = stringToImage(s);
GrayS32 label = new GrayS32(input.width, input.height);
ContourTracer alg = new ContourTracer(ConnectRule.EIGHT);
// process the image
alg.setInputs(addBorder(input), label, queue);
queue.grow();
alg.trace(2, 1 + 1, 0 + 1, true);
assertEquals(7, queue.totalPoints());
assertEquals(7, queue.sizeOfTail());
}
use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestLinearContourLabelChang2004 method print.
private void print(List<Point2D_I32> l, int w, int h) {
GrayU8 img = new GrayU8(w, h);
for (Point2D_I32 p : l) {
img.set(p.x, p.y, 1);
}
img.print();
System.out.println("------------------");
}
use of boofcv.struct.image.GrayU8 in project BoofCV by lessthanoptimal.
the class TestLinearContourLabelChang2004 method test1_8.
@Test
public void test1_8() {
GrayU8 input = TEST1.clone();
GrayS32 labeled = new GrayS32(input.width, input.height);
LinearContourLabelChang2004 alg = new LinearContourLabelChang2004(ConnectRule.EIGHT);
alg.process(input, labeled);
assertEquals(1, alg.getContours().size);
checkContour(alg, labeled, 8);
}
Aggregations