public class

FritzVisionObject

extends Object
java.lang.Object
   ↳ ai.fritz.vision.FritzVisionObject

Class Overview

FritzVisionObject is a standard output class for FritzVisionObjectPredictor.

This object holds the output for Object Detection.

It contains a FritzVisionLabel and a bounding box.

Summary

Public Constructors
FritzVisionObject(FritzVisionLabel visionLabel, RectF boundingBox)
Public Methods
void drawOnCanvas(Context context, Canvas canvas)
Draw the bounding boxes to the canvas exactly as they are.
void drawOnCanvas(Context context, Canvas canvas, float scaleFactorWidth, float scaleFactorHeight)
Draw on the canvas and scale the boxes to fit a new screen size.
RectF getBoundingBox()
FritzVisionLabel getVisionLabel()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FritzVisionObject (FritzVisionLabel visionLabel, RectF boundingBox)

Public Methods

public void drawOnCanvas (Context context, Canvas canvas)

Draw the bounding boxes to the canvas exactly as they are.

public void drawOnCanvas (Context context, Canvas canvas, float scaleFactorWidth, float scaleFactorHeight)

Draw on the canvas and scale the boxes to fit a new screen size. This is used if you want to run object detection on a small preview sized screen and then fit the boxes for a larger screen size. In order to do this, you should calculate the scale factors before calling this method:

float scaleFactorWidth = ((float) desiredScreenSize.getWidth()) / originalBitmapUsedForPrediction.getWidth();
 float scaleFactorHeight = ((float) desiredScreenSize.getHeight()) / originalBitmapUsedForPrediction.getHeight();

 object.drawOnCanvas(context, canvas, scaleFactorWidth, scaleFactorHeight)

 

Parameters
scaleFactorWidth - factor to scale up the box widths
scaleFactorHeight - factor to scale up the box heights

public RectF getBoundingBox ()

public FritzVisionLabel getVisionLabel ()