Package io.scanbot.sdk.documentscanner
Class DocumentScanner
- java.lang.Object
-
- io.scanbot.sdk.documentscanner.DocumentScanner
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class DocumentScanner extends java.lang.Object implements java.lang.AutoCloseableAPI for document detection and scanning. Required licence feature(s): DocumentScanner.
-
-
Constructor Summary
Constructors Constructor Description DocumentScanner(DocumentScannerConfiguration configuration)Constructs DocumentScanner with the given params.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearResult()Clears the accumulated results.voidclose()Closes native resources held by the object.protected voidfinalize()DocumentDetectionResultrun(ImageRef image)Detect the document contour in the given image.DocumentScanningResultscan(ImageRef image)Detect the document contour in the given image and crop it.
-
-
-
Constructor Detail
-
DocumentScanner
public DocumentScanner(DocumentScannerConfiguration configuration) throws LicenseException
Constructs DocumentScanner with the given params.- Parameters:
configuration- The configuration for the document detector.- Throws:
LicenseException- If license requirements for the API are not met
-
-
Method Detail
-
run
public DocumentDetectionResult run(ImageRef image) throws InvalidImageRefException, LicenseException
Detect the document contour in the given image.- Parameters:
image- The image to detect the document contour in.- Returns:
- The detection result.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
scan
public DocumentScanningResult scan(ImageRef image) throws InvalidImageRefException, LicenseException
Detect the document contour in the given image and crop it.- Parameters:
image- The image to detect the document contour in.- Returns:
- The scanning result.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
clearResult
public void clearResult()
Clears the accumulated results. Should be called after a document has been detected to the customers satisfaction to prevent a poisoned cache.
-
close
public void close()
Closes native resources held by the object.- Specified by:
closein interfacejava.lang.AutoCloseable
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-