use of com.amplifyframework.predictions.models.Polygon in project amplify-android by aws-amplify.
the class RekognitionResultTransformersTest method testPolygonConversion.
/**
* Tests that the polygonal boundary from Textract in the form
* of list of points is converted to an Amplify shape for polygons.
*/
@Test
public void testPolygonConversion() {
List<Point> randomPolygon = randomPolygon();
Polygon polygon = RekognitionResultTransformers.fromPoints(randomPolygon);
List<PointF> actualPoints = polygon.getPoints();
List<PointF> expectedPoints = new ArrayList<>();
for (Point point : randomPolygon) {
expectedPoints.add(new PointF(point.getX(), point.getY()));
}
assertEquals(expectedPoints, actualPoints);
}
use of com.amplifyframework.predictions.models.Polygon in project amplify-android by aws-amplify.
the class TextractResultTransformersTest method testPolygonConversion.
/**
* Tests that the polygonal boundary from Textract in the form
* of list of points is converted to an Amplify shape for polygons.
*/
@Test
public void testPolygonConversion() {
List<Point> randomPolygon = randomPolygon();
Polygon polygon = TextractResultTransformers.fromPoints(randomPolygon);
List<PointF> actualPoints = polygon.getPoints();
List<PointF> expectedPoints = new ArrayList<>();
for (Point point : randomPolygon) {
expectedPoints.add(new PointF(point.getX(), point.getY()));
}
assertEquals(expectedPoints, actualPoints);
}