Configure the detection process
Use Take Picture Mode vs Frames mode
You can choose between two different approaches to capture the document image: take picture mode
or regular frames mode
.
Take Picture mode
: It uses the camera shutter to take a full resolution picture.Frames mode
(default): In this mode, the camera is contionously capturing lower resolution frames.
Choosing a mode
If no configuration is present, regular frames mode
is chosen by default. You can enable take picture mode
by creating a MobbScanConfiguration object as follows:
val mobbScanConfiguration = MobbScanConfiguration()
mobbScanConfiguration.useTakePictureMode(true)
MobbScanConfiguration mobbScanConfiguration = new MobbScanConfiguration();
mobbScanConfiguration.useTakePictureMode(true);
Checks
Quality control
This set of checks ensures that the detected image have the necessary quality to later scan the document. The performed checks are:
- Luminosity of the image, in order to ensure that the image is not too bright or too dark.
- Document distance, in order to ensure that the user is holding the document close enough from the device to obtain a high quality document image. It also checks that the document is not too close, so partial images of documents cannot be detected.
- Also ensures that no sparkles are present in the document making impossible to obtain the information from some parts of the document.
False positive control
MobbScan also performs some checks over the document so no false documents can be detected and a feedback message will be showed to the user.
Enable or disable controls.
In case you might not want to perform these controls (since they are enabled by default) you can disable them by creating a MobbScanConfiguration
object and passing it to the MobbScan instance as follows:
val mobbScanConfiguration = MobbScanConfiguration()
mobbScanConfiguration.falsePositiveControl = false
mobbScanConfiguration.qaControl = false
MobbScanConfiguration mobbScanConfiguration = new MobbScanConfiguration();
mobbScanConfiguration.setFalsePositiveControl(false);
mobbScanConfiguration.setQaControl(false);
It may be the case that you only want some of these controls, in that case you have to do it as follows:
val mobbScanConfiguration = MobbScanConfiguration().apply {
checkDocumentPosition = false
checkDocumentSparkles = false
checkDocumentLightness = false
checkDocumentBlurring = false
checkFacialPosition = false
checkFacialFocus = false
checkFacialLightness = false
checkFacialMask = false
}
MobbScanConfiguration mobbScanConfiguration = new MobbScanConfiguration();
mobbScanConfiguration.setCheckDocumentPosition(false);
mobbScanConfiguration.getCheckDocumentSparkles(false);
mobbScanConfiguration.setCheckDocumentLightness(false);
mobbScanConfiguration.setCheckDocumentBlurring(false);
mobbScanConfiguration.setCheckFacialPosition(false);
mobbScanConfiguration.setCheckFacialFocus(false);
mobbScanConfiguration.setCheckFacialLightness(false);
mobbScanConfiguration.setCheckFacialMask(false);
Document Detection QA Checks
Parameter | Comment |
---|---|
checkDocumentLightness | Check the ambient light is neither too dark nor too shiny. |
checkDocumentPosition | Check the document is placed within the detection box, and it is neither too far nor too near. |
checkDocumentSparkles | Check there are no sparkles on the document image. |
checkDocumentBlurring | Check if the document is blurred. |
falsePositive | Check the document side is the one we are looking for. |
Facial Detection QA Checks
Parameter | Comment |
---|---|
checkFacialLightness | Check the ambient light is neither too dark nor too shiny. |
checkFacialPosition | Check the face of the user is placed within the frame, and it is neither too far nor too near. |
checkFacialMask | Check the face is not covered by a mask. |
checkFacialFocus | Check the image of the face is focused. |
Once you have your MobbScanConfiguration instance with the desire configuration, you have to include this object in the initAPI
method.
If you want to know more about this method please check the basic configuration.
MobbScanAPI.getInstance().initAPI("YOUR_LICENSE_HERE", this, object : LicenseStatusListener {
override fun onLicenseStatusChecked(licenseResult: MobbScanLicenseResult?, licenseValidTo: Date?) {
// Your code for the listener here...
}
}, mobbScanConfiguration)
MobbScanAPI.getInstance().initAPI("YOUR_LICENSE_HERE", this, new LicenseStatusListener() {
@Override
public void onLicenseStatusChecked(MobbScanLicenseResult licenseResult, Date licenseValidTo) {
// Your code for the listener here...
}
}, mobbScanConfiguration);