Package io.scanbot.sdk.document
Class DefaultDocumentScanner
-
- All Implemented Interfaces:
-
io.scanbot.sdk.document.DocumentScanner
public final class DefaultDocumentScanner implements DocumentScanner
-
-
Constructor Summary
Constructors Constructor Description DefaultDocumentScanner(DocumentScannerConfiguration initialConfig)
-
Method Summary
Modifier and Type Method Description DocumentScannerConfiguration
copyCurrentConfiguration()
Returns a copy of the current configuration. Unit
setConfiguration(DocumentScannerConfiguration configuration)
Sets the configuration for the document scanner. DocumentDetectionResult
scan(ByteArray nv21, Integer width, Integer height, Integer frameOrientation)
Tries to scan a polygon from the given image. DocumentDetectionResult
scanFromJpeg(ByteArray data)
Tries to scan a polygon from the given image. DocumentDetectionResult
scanInArea(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect areaRect)
Decode the nv21 within the finder rectangle, and time how long it took. DocumentDetectionResult
scanFromFile(String filePath)
Tries to scan a polygon from the given file. DocumentDetectionResult
scanFromBitmap(Bitmap bitmap)
Tries to scan a polygon from the given image. Unit
setParameters(DocumentScannerParameters scanningParameters)
Set the scanning parameters to use. Unit
resetPolygonHistory()
Calling this method will reset the polygon smoothing history. -
-
Constructor Detail
-
DefaultDocumentScanner
DefaultDocumentScanner(DocumentScannerConfiguration initialConfig)
-
-
Method Detail
-
copyCurrentConfiguration
@Synchronized() DocumentScannerConfiguration copyCurrentConfiguration()
Returns a copy of the current configuration.
-
setConfiguration
@Synchronized() Unit setConfiguration(DocumentScannerConfiguration configuration)
Sets the configuration for the document scanner.
- Parameters:
configuration
- The configuration to set.
-
scan
@Synchronized() DocumentDetectionResult scan(ByteArray nv21, Integer width, Integer height, Integer frameOrientation)
Tries to scan a polygon from the given image.
- Parameters:
nv21
- NV21 encoded camera imagewidth
- Width of the image pixelsheight
- Height of the image in pixels
-
scanFromJpeg
@Synchronized() DocumentDetectionResult scanFromJpeg(ByteArray data)
Tries to scan a polygon from the given image.
- Parameters:
data
- Encoded image (e.g.
-
scanInArea
@Synchronized() DocumentDetectionResult scanInArea(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect areaRect)
Decode the nv21 within the finder rectangle, and time how long it took.
- Parameters:
nv21
- The YUV preview frame.width
- The width of the preview frame.height
- The height of the preview frame.frameOrientation
- The frame orientation degrees.areaRect
- decode area
-
scanFromFile
@Synchronized() DocumentDetectionResult scanFromFile(String filePath)
Tries to scan a polygon from the given file.
- Parameters:
filePath
- Encoded file path (e.g.
-
scanFromBitmap
@Synchronized() DocumentDetectionResult scanFromBitmap(Bitmap bitmap)
Tries to scan a polygon from the given image.
- Parameters:
bitmap
- The image
-
setParameters
@Synchronized() Unit setParameters(DocumentScannerParameters scanningParameters)
Set the scanning parameters to use.
-
resetPolygonHistory
@Synchronized() Unit resetPolygonHistory()
Calling this method will reset the polygon smoothing history.
-
-
-
-