English 中文(简体)
• 如何使用冲破碎的淋浴包
原标题:How to show contours on face using google ml kit in flutter

I want to detect face and show contours.I have detected the face but how to show contours.Any suggestions is accepted.I have searched on google but I did t find find solution; Thanks in advance.

class FacePainter extends CustomPainter {
  ui.Image image;
  List<Face> faces;
  List<Rect> rects = [];

  FacePainter(this.image, this.faces) {
    for (var i = 0; i < faces.length; i++) {
      rects.add(faces[i].boundingBox);
    }
    print("object");
  }
  @override
  void paint(ui.Canvas canvas, ui.Size size) {
    final Paint paint = Paint()
      ..style = PaintingStyle.stroke
      ..strokeWidth = 2.0
      ..color = Colors.blue;
    canvas.drawImage(image, Offset.zero, paint);
    for (var i = 0; i < faces.length; i++) {
      canvas.drawRect(rects[i], paint);
    }
  }

  @override
  bool shouldRepaint(FacePainter oldDelegate) {
    return image != oldDelegate.image || image != oldDelegate.faces;
  }
}
问题回答

暂无回答




相关问题
Flutter App cannot be installed on Android TV

I m building a Flutter app that should support Android TV and Mobile devices. Despite Google Play shows that it is supported, I cannot install app on my MiBox device. While trying to install it, both ...

Moving the icon button to the right causes rendering issues

I am trying to align the icon button to the right of the Text field, I tried the row which made the icon button not centered vertically and now I am trying out the Stack widget. Here is my code - ...

热门标签