public class

FritzVisionPoint

extends Object
java.lang.Object
   ↳ ai.fritz.fritzvisionsegmentation.FritzVisionPoint

Summary

Public Constructors
FritzVisionPoint(Point outputPoint, float probability)
Public Methods
RectF calculateScaledPixel(float scaleWidth, float scaleHeight, int offsetWidth, int offsetHeight)
void drawOnCanvas(Canvas canvas, Paint paint)
Draw on the canvas and specify a custom paint color.
void drawOnCanvas(Canvas canvas, Paint paint, float scaleFactorWidth, float scaleFactorHeight)
Draw on the canvas and scale the pixels to fit a new screen size.
Point getOutputPoint()
float getProbability()
RectF getScaledBox()
void setSegmentBox(RectF scaledPixelBox)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FritzVisionPoint (Point outputPoint, float probability)

Public Methods

public RectF calculateScaledPixel (float scaleWidth, float scaleHeight, int offsetWidth, int offsetHeight)

public void drawOnCanvas (Canvas canvas, Paint paint)

Draw on the canvas and specify a custom paint color.

public void drawOnCanvas (Canvas canvas, Paint paint, float scaleFactorWidth, float scaleFactorHeight)

Draw on the canvas and scale the pixels 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 Point getOutputPoint ()

public float getProbability ()

public RectF getScaledBox ()

public void setSegmentBox (RectF scaledPixelBox)