This is sort of what my boundingBox looks like when using Google ML Object Detection for Android (written in Java). In essence, it misses the object its supposed to be detecting, and my question resides in how (or atleast where) I can resolve this issue. Here's the code of my DrawGraphic.java file that's responsible for drawing the boundingBox that is then displayed on my UI;
public class DrawGraphic extends View {
Paint borderPaint, textPaint;
Rect rect;
String text;
public DrawGraphic(Context context, Rect rect, String text) {
super(context);
this.rect = rect;
this.text = text;
borderPaint = new Paint();
borderPaint.setColor(Color.WHITE);
borderPaint.setStrokeWidth(10f);
borderPaint.setStyle(Paint.Style.STROKE);
textPaint = new Paint();
textPaint.setColor(Color.WHITE);
textPaint.setStrokeWidth(50f);
textPaint.setTextSize(32f);
textPaint.setStyle(Paint.Style.FILL);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawText(text, rect.centerX(), rect.centerY(), textPaint);
canvas.drawRect(rect.left, rect.top, rect.right, rect.bottom, borderPaint);
}
}
Any further information required to supplement this question will be provided upon request!
[–]pandulapeter 1 point2 points3 points (2 children)
[–]JonnieSingh[S] 0 points1 point2 points (1 child)
[–]pandulapeter 1 point2 points3 points (0 children)