Package io.scanbot.sdk.documentscanner
Class DocumentScanner
java.lang.Object
io.scanbot.sdk.documentscanner.DocumentScanner
- All Implemented Interfaces:
AutoCloseable
API for document detection and scanning.
Required licence feature(s): DocumentScanner.
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentScanner(DocumentScannerConfiguration configuration) Constructs DocumentScanner with the given params. -
Method Summary
-
Constructor Details
-
DocumentScanner
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 Details
-
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 interfaceAutoCloseable
-
finalize
-