public class PolygonHelper
Helper to make it easier to draw polygon on view
public static boolean checkPolygonSize(java.util.List<android.graphics.Point> polygon)
polygon - true if polygon edges sizes less than PolygonHelper#MIN_EDGE_LENGTH_PX, false - otherwisepublic void setRotation(int degrees)
Set rotation in degrees for polygon
degrees - usually camera rotation angle is used herepublic void setImageSize(int width,
int height)
Set scaled image size that will be drawn on screen
width - height - public void setLayout(int left,
int top,
int right,
int bottom)
Sets layout of surface inside parent to compensate differences between viewport and preview sizes and draw polygon correctly
left - top - right - bottom - public void polygonToLinePoints(java.util.List<android.graphics.PointF> polygon,
kotlin.Array[] points)
Calculates lines points from polygon multiplying 0..1 values by view dimensions and applying rotation matrix. Usually used on preview as it has camera rotation
polygon - points - public void polygonToPoints(java.util.List<android.graphics.PointF> polygon,
kotlin.Array[] points)
Calculates points from polygon multiplying 0..1 values by view dimensions and applying rotation matrix. Usually used on preview as it has camera rotation
polygon - points - public void getDrawingPolygon(java.util.List<android.graphics.PointF> polygon,
java.util.List<android.graphics.PointF> drawingPolygon)
Processes original polygon with coordinates 0..1 to drawing polygon by multiplying them by view dimensions
polygon - drawingPolygon - public void getPolygonFromDrawingPolygon(java.util.List<android.graphics.PointF> drawingPolygon,
java.util.List<android.graphics.PointF> polygon)
Processes drawing polygon coordinates to polygon with coordinates 0..1 by dividing them by view dimensions
drawingPolygon - polygon - public java.util.List<io.scanbot.sdk.core.contourdetector.Line2D> scaleLines(java.util.List<io.scanbot.sdk.core.contourdetector.Line2D> lines)
Performs scaling from 0..1 values to image pixel values
lines -