Kofax Mobile SDK API Reference
|
Public Member Functions | |
OnDeviceIdExtractor (Context ctx) | |
OnDeviceIdExtractor (Context ctx, IProjectProvider projectProvider) | |
void | extractFields (IdExtractionParameters parameters) |
void | cancel () |
On-device ID extractor.
This class enables field extraction of images of ID documents without having to call to a remote server.
OnDeviceIdExtractor | ( | Context | ctx | ) |
Create an extractor using the default IProjectProvider.
ctx | This context |
OnDeviceIdExtractor | ( | Context | ctx, |
IProjectProvider | projectProvider | ||
) |
Create an extractor using the given IProjectProvider.
To override the default project provider, create one, and pass it to the extractor constructor (this configuration uses the default):
To override the default project provider, cache or both, create custom classes and pass the custom project provider the extractor:
Here's an example of customizing just the IProjectProvider, but using default cache:
ctx | This context |
projectProvider | The IProjectProvider to use for config/models |
void cancel | ( | ) |
Cancel an outstanding extraction process. If this method is called while no extraction is outstanding a ErrorInfo#KMC_EV_CANCEL_OPERATION_SUCCESS exception is thrown directly.
If cancellation was not possible, the listener is called with results and/or AggregateException as normal.
If cancellation was successful, the listener is called with null results, and ErrorInfo#KMC_EV_CANCEL_OPERATION_SUCCESS as the exception returned from AggregateException#getFrontException()
Implements IIdExtractor.
void extractFields | ( | IdExtractionParameters | parameters | ) |
It is required to have an On-device extraction license before calling this method.
This method is asynchronous and will call the listener within the parameters object.
This method is not re-entrant. An exception will be thrown if the method is entered while extraction is outstanding.
Regardless of whether classification succeeds, the MRZ or barcode data on the image may be parsed. Barcode data overrides MRZ data, and MRZ data overrides any extracted OCR data if there are conflicts.
Images passed to this method may be pre-processed for crop and de-skew; however, pre-processing can lower the reliability of reading any barcodes that may be present. When sending raw images, any processing required will be handled internally by the SDK. If images are to be pre-processed using the com.kofax.kmc.ken.engines.ImageProcessor, the image must be processed by loading the IdExtractionParameters#PREPROCESS_STRING string into your com.kofax.kmc.ken.engines.processing.ImageProcessorConfiguration
parameters | The extraction parameters |
Implements IIdExtractor.