Package io.scanbot.document
Class JniDocumentScanner
-
- All Implemented Interfaces:
public final class JniDocumentScanner extends SelfDisposable
Performs document scanning.
-
-
Field Summary
Fields Modifier and Type Field Description private final DocumentScannerConfiguration
config
-
Constructor Summary
Constructors Constructor Description JniDocumentScanner(DocumentScannerConfiguration config)
-
Method Summary
Modifier and Type Method Description final DocumentScannerConfiguration
getConfig()
final DocumentDetectionResult
scan(ByteArray nv21, Integer width, Integer height)
Tries to scan a polygon from the given image. final DocumentDetectionResult
scanFromJpeg(ByteArray data)
Tries to scan a polygon from the given image. final 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. final DocumentDetectionResult
scanFromFile(String filePath)
Tries to scan a polygon from the given file. final DocumentDetectionResult
scanFromBitmap(Bitmap bitmap)
Tries to scan a polygon from the given image. final Unit
setParameters(DocumentScannerParameters scanningParameters)
Set the scanning parameters to use. final Unit
resetPolygonHistory()
Calling this method will reset the polygon smoothing history. -
-
Constructor Detail
-
JniDocumentScanner
JniDocumentScanner(DocumentScannerConfiguration config)
- Parameters:
config
- Scanner configuration.
-
-
Method Detail
-
getConfig
final DocumentScannerConfiguration getConfig()
-
scan
@Synchronized() final DocumentDetectionResult scan(ByteArray nv21, Integer width, Integer height)
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() final DocumentDetectionResult scanFromJpeg(ByteArray data)
Tries to scan a polygon from the given image.
- Parameters:
data
- Encoded image (e.g.
-
scanInArea
@Synchronized() final 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 in this area
-
scanFromFile
@Synchronized() final DocumentDetectionResult scanFromFile(String filePath)
Tries to scan a polygon from the given file.
- Parameters:
filePath
- Encoded file path (e.g.
-
scanFromBitmap
@Synchronized() final DocumentDetectionResult scanFromBitmap(Bitmap bitmap)
Tries to scan a polygon from the given image.
- Parameters:
bitmap
- The image
-
setParameters
@Synchronized() final Unit setParameters(DocumentScannerParameters scanningParameters)
Set the scanning parameters to use.
-
resetPolygonHistory
@Synchronized() final Unit resetPolygonHistory()
Calling this method will reset the polygon smoothing history.
-
-
-
-