Kofax Mobile SDK API Reference
Classes | Public Member Functions | List of all members
OnDeviceIdExtractor Class Reference
Inheritance diagram for OnDeviceIdExtractor:
IIdExtractor

Public Member Functions

 OnDeviceIdExtractor (Context ctx)
 
 OnDeviceIdExtractor (Context ctx, IProjectProvider projectProvider)
 
void extractFields (IdExtractionParameters parameters)
 
void cancel ()
 

Detailed Description

On-device ID extractor.

This class enables field extraction of images of ID documents without having to call to a remote server.

Constructor & Destructor Documentation

OnDeviceIdExtractor ( Context  ctx)

Create an extractor using the default IProjectProvider.

Parameters
ctxThis 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):

IProjectProvider projectProvider = new ServerProjectProvider(myActivity.this, "http://someServer.com/api/path");
new OnDeviceIdExtractor(MyActivity.this, projectProvider).extractFields(...);

To override the default project provider, cache or both, create custom classes and pass the custom project provider the extractor:

public class MyCustomProjectProvider implements IProjectProvider { ... }
public class MyCustomCacheProvider implements MyCustomCacheInterface { ... }
IProjectProvider projectProvider = new MyCustomProjectProvider(new MyCustomCacheProvider(), "http://someServer.com/api/path");
new OnDeviceIdExtractor(MyActivity.this, projectProvider).extractFields(...);

Here's an example of customizing just the IProjectProvider, but using default cache:

public class MyCustomProjectProvider implements IProjectProvider {
public MyCustomProjectProvider(IBundleCacheProvider cacheProvider);
...
}
File cacheFolder = new File('/storage/path/folder');
IProjectProvider projectProvider = new MyCustomProjectProvider(new BundleCacheProvider(cacheFolder), "http://someServer.com/api/path");
new OnDeviceIdExtractor(MyActivity.this, projectProvider).extractFields(...);
Parameters
ctxThis context
projectProviderThe IProjectProvider to use for config/models

Member Function Documentation

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
parametersThe extraction parameters
See also
Licensing#addVolumeLicenseEventListener(VolumeLicenseEventListener)
cancel()

Implements IIdExtractor.


The documentation for this class was generated from the following file:
Untitled Document © 2018 Kofax, Inc. All rights reserved. Use is subject to license terms.