I am using the https://pub.dev/packages/ncnn_yolox_flutter package for object detection in my Flutter app. I want the border outline of detections to look similar to the image below; curved corners only. (Different opacity not necessary, although if anyone knows how to draw that dynamically I would be interested).
What I'm looking for:
I currently have two options working.
- Curved corners, but drawing the entire rectangle... Code and picture below (
e
references my detection results anddrawRectPaint
is my decoration):
final rect = ui.Rect.fromLTWH(
e.x,
e.y,
e.width,
e.height,
);
canvas.drawRRect(
RRect.fromRectAndRadius(rect, Radius.circular(10.0)),
drawRectPaint,
);
- Corners only but without the curve. (Code for just the top left corner below):
var topLeftPath = Path();
topLeftPath.addPolygon([
Offset((e.x), (e.y + 40)),
Offset((e.x), (e.y)),
Offset((e.x + 40), (e.y)),
], false);
canvas.drawPath(
topLeftPath,
drawRectPaint,
);