drawAnnotationsNormalized static method

void drawAnnotationsNormalized(
  1. Painter painter,
  2. List<NormalizedVertex> vertices,
  3. {String color = 'red',
  4. int thickness = 3}
)

Draw a box on the supplied Painter around detected object using NormalizedVertex values.

Implementation

static void drawAnnotationsNormalized(
    Painter painter, List<NormalizedVertex> vertices,
    {String color = 'red', int thickness = 3}) {
  final topLeft = vertices.first;

  final bottomRight = vertices[2];

  painter.drawRectangle(
    (topLeft.x * painter.width).toInt(),
    (topLeft.y * painter.height).toInt(),
    (bottomRight.x * painter.width).toInt(),
    (bottomRight.y * painter.height).toInt(),
    RgbColor.name(color),
  );
}