Package com.geniusscansdk.core
Class DocumentDetector
- java.lang.Object
-
- com.geniusscansdk.core.DocumentDetector
-
public abstract class DocumentDetector extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DocumentDetector.Mode
-
Field Summary
Fields Modifier and Type Field Description protected long
nativeHandle
-
Constructor Summary
Constructors Constructor Description DocumentDetector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DocumentDetector
create(android.content.Context context)
static DocumentDetector
create(android.content.Context context, DocumentDetector.Mode mode)
Quadrangle
detectDocument(byte[] imageBuffer, int previewWidth, int previewHeight, int previewStride)
Detect document on a YUV buffer.Quadrangle
detectDocument(android.graphics.Bitmap bitmap)
Detect document in an image bitmap.Quadrangle
detectDocument(java.io.File image)
Detect document in an image file.protected void
finalize()
-
-
-
Method Detail
-
finalize
protected void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
create
public static DocumentDetector create(android.content.Context context, DocumentDetector.Mode mode)
-
create
public static DocumentDetector create(android.content.Context context)
-
detectDocument
@NonNull public Quadrangle detectDocument(java.io.File image) throws ProcessingException, LicenseException
Detect document in an image file.- Parameters:
image
- the image file- Returns:
- the quadrangle if a document is detected, an empty quadrangle otherwise.
- Throws:
ProcessingException
- if something wrong happened during detectionLicenseException
- if the license is not valid or has expired
-
detectDocument
@NonNull public Quadrangle detectDocument(android.graphics.Bitmap bitmap) throws ProcessingException, LicenseException
Detect document in an image bitmap.- Parameters:
bitmap
- the image bitmap- Returns:
- the quadrangle if a document is detected, an empty quadrangle otherwise.
- Throws:
ProcessingException
LicenseException
- See Also:
detectDocument(File)
-
detectDocument
@NonNull public Quadrangle detectDocument(byte[] imageBuffer, int previewWidth, int previewHeight, int previewStride) throws ProcessingException, LicenseException
Detect document on a YUV buffer.- Parameters:
imageBuffer
- an image buffer with format YUV420previewWidth
- the width of the imagepreviewHeight
- the height of the image- Returns:
- the quadrangle if a document is detected, an empty quadrangle otherwise.
- Throws:
ProcessingException
LicenseException
- See Also:
detectDocument(File)
-
-