Quadrangle

constructor()

Create an empty quadrangle, meaning document detection has not been run, or it has detected no document in the image.


constructor(points: Array<Float>)

Create a quadrangle from an array of coordinates. The order of the corners must be: TopLeft (x, y), TopRight (x, y), BottomLeft (x, y), BottomRight (x, y). Each coordinate must be between 0 and 1. x values are relative to the width of the image, y values are relative to the height of the image.

Parameters

points

The relative coordinates of the four corners of the quadrangle. This array must have a length of 8.


constructor(x1: Float, y1: Float, x2: Float, y2: Float, x3: Float, y3: Float, x4: Float, y4: Float)

Create a quadrangle from the coordinates of the corners. See Quadrangle for more details.