detectDocument

Detect document in an image.

Return

the detected quadrangle.

Parameters

input

the image input

Throws

if something wrong happened during detection

if the license is not valid or has expired


open fun detectDocument(image: File): Quadrangle

Deprecated

Use detectDocument(DocumentDetectionInput) with FileInput and read the quadrangle from the result.

Replace with

detectDocument(FileInput(image)).quadrangle

Detect document in an image file.

Return

the quadrangle if a document is detected, an empty quadrangle otherwise.

Parameters

image

the image file

Throws

if something wrong happened during detection

if the license is not valid or has expired


open fun detectDocument(bitmap: Bitmap): Quadrangle

Deprecated

Use detectDocument(DocumentDetectionInput) with BitmapInput and read the quadrangle from the result.

Replace with

detectDocument(BitmapInput(bitmap)).quadrangle

Detect document in an image bitmap.

Return

the quadrangle if a document is detected, an empty quadrangle otherwise.

Parameters

bitmap

the image bitmap

See also

.detectDocument


open fun detectDocument(imageBuffer: ByteArray, previewWidth: Int, previewHeight: Int, previewStride: Int): Quadrangle

Deprecated

Use detectDocument(DocumentDetectionInput) with BufferInput and read the quadrangle from the result.

Replace with

detectDocument(BufferInput(imageBuffer, previewWidth, previewHeight, previewStride)).quadrangle

Detect document on a YUV buffer.

Return

the quadrangle if a document is detected, an empty quadrangle otherwise.

Parameters

imageBuffer

an image buffer with format NV21

previewWidth

the width of the image

previewHeight

the height of the image

See also

.detectDocument