com.google.api.services.vision.v1.model.Vertex

Here are the examples of the java api class com.google.api.services.vision.v1.model.Vertex taken from open source projects.

1. FaceDetectApp#annotateWithFace()

Project: cloud-vision
Source File: FaceDetectApp.java
View license
/**
   * Annotates an image {@code img} with a polygon defined by {@code face}.
   */
private static void annotateWithFace(BufferedImage img, FaceAnnotation face) {
    Graphics2D gfx = img.createGraphics();
    Polygon poly = new Polygon();
    for (Vertex vertex : face.getFdBoundingPoly().getVertices()) {
        poly.addPoint(vertex.getX(), vertex.getY());
    }
    gfx.setStroke(new BasicStroke(5));
    gfx.setColor(new Color(0x00ff00));
    gfx.draw(poly);
}