Пример #1
0
 @Test
 public void testSingleDilateFull() {
   final Shape shape = new DiamondShape(1);
   @SuppressWarnings("unchecked")
   final Img<ByteType> out1 =
       (Img<ByteType>) ops.run(DefaultDilate.class, Img.class, in, shape, true);
   final Img<ByteType> out2 = Dilation.dilateFull(in, shape, 1);
   final Cursor<ByteType> c1 = out1.cursor();
   final Cursor<ByteType> c2 = out2.cursor();
   while (c1.hasNext()) assertEquals(c1.next().get(), c2.next().get());
 }
Пример #2
0
 @Test
 public void testListDilateFull() {
   final List<Shape> shapes = new ArrayList<Shape>();
   shapes.add(new DiamondShape(1));
   shapes.add(new DiamondShape(1));
   shapes.add(new RectangleShape(1, false));
   shapes.add(new HorizontalLineShape(2, 1, false));
   @SuppressWarnings("unchecked")
   final IterableInterval<ByteType> out1 =
       (IterableInterval<ByteType>)
           ops.run(ListDilate.class, IterableInterval.class, in, shapes, true);
   final Img<ByteType> out2 = Dilation.dilateFull(in, shapes, 1);
   final Cursor<ByteType> c1 = out1.cursor();
   final Cursor<ByteType> c2 = out2.cursor();
   while (c1.hasNext()) assertEquals(c1.next().get(), c2.next().get());
 }