blinkid / blinkid-android Goto Github PK
View Code? Open in Web Editor NEWEverything you need to add AI-driven ID scanning into your native Android app.
Home Page: https://microblink.com/identity/identity-document-scanning/
Everything you need to add AI-driven ID scanning into your native Android app.
Home Page: https://microblink.com/identity/identity-document-scanning/
Hi, how can I add animated dots in my custom scan activity?
I get this error after including microblink library;
Error:(333) Attribute "animationDuration" has already been defined:
Source : C:\PROJEKTI2\xxx\xxx\android\app\build\intermediates\data-binding-layout-out\debug\values\values.xml
It seems it is somehow related to android databinding library.
If I remove
compile('com.microblink:blinkid:3.7.0@aar')` {
transitive = true
}
from gradle project compiles.
This are relevant gradle source lines:
dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
///...
///...
compile('com.microblink:blinkid:3.7.0@aar') {
transitive = true
}
}
Hi, may I know how to detect the default scanning activity either is portrait or landscape?
thank you
hi . i developing using xamarin for android
did blinkid for android can use using xamarin
hope can hear you soon
thank you
Can we customize our own card size? bigger / smaller than standard card size.
Thank You.
I used the function of ID Document in BlinkIdDemo, it's worked perfect. But I want to get the bitmap of card when it's return the result, so how can I do it?
I tried put the Extra_Output in intent but it's not working :(
Intent intent = mElements[position].getScanIntent(); url = getURL(); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(url)));
Microblink seems to have some issues dealing with positive lookbehinds and lookaheads. Simple regex queries like the following work marvelously:
RegexParserSettings parser = new RegexParserSettings("([A-Z]+ ?)+");
Whilst something like:
RegexParserSettings parser = new RegexParserSettings("(?<=: )([A-Z]+ ?)+");
Will cause the application to crash with the following error:
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x20 in tid 17527
Sample text to process:
: ABC DEF
Essentially I am trying to get the 'ABC DEF' from the card, the text must include the colon but without grouping it, so when I return the results it won't have the colon in there, only the text will be parsed to the OCR results.
Update 1:
Same problem happens with non capturing groups and "." (any characters).
Such as the following example:
RegexParserSettings parser = new RegexParserSettings("(0?[1-9]|[12][0-9]|3[01]).(0?[1-9]|1[012]).\\d{4}");
i am added a edittext that string value how to scan and validate in Row text
How to scan the ID card in China
Hi,
may I know is it possible to scan the card and it will auto detect which card it is? For example, I call the scanning activity, and during the scanning process, it will auto detect the object that I scanned whether is an identity card or passport. Is that possible??
Thank you.
I need to use the ocr reader on a device with no autofocus camera, how can i disable it?
Tnx!
I am trying to scan an image taken from resources using a Recognizer with a RegerParserSettings inside a fragment. The problem is that BaseRecognitionResult
obtained through the callback onScanningDone
is always null. I have tried to set up the RecognitionSettings with MRTDRecognizer
and worked fine, so I think that the library is properly integrated. This is the source code that I am using:
@Override
public void onAttach(Context context) {
...
try {
mRecognizer = Recognizer.getSingletonInstance();
mRecognizer.setLicenseKey(context, LICENSE_KEY);
} catch (FeatureNotSupportedException | InvalidLicenceKeyException e) {
Log.d(TAG, e.getMessage());
}
buildRecognitionSettings();
mRecognizer.initialize(context, mRecognitionSettings, new DirectApiErrorListener() {
@Override
public void onRecognizerError(Throwable t) {
//Handle exception
}
});
}
private void buildRecognitionSettings() {
mRecognitionSettings = new RecognitionSettings();
mRecognitionSettings.setRecognizerSettingsArray(setupSettingsArray());
}
private RecognizerSettings[] setupSettingsArray() {
RegexParserSettings regexParserSettings = new RegexParserSettings("[A-Z0-9]{17}");
BlinkOCRRecognizerSettings sett = new BlinkOCRRecognizerSettings();
sett.addParser("myRegexParser", regexParserSettings);
return new RecognizerSettings[] { sett };
}
I scan the image like:
mRecognizer.recognizeBitmap(bitmap, Orientation.ORIENTATION_PORTRAIT, FragMicoblink.this);
And this is the callback handled in the fragment
@Override
public void onScanningDone(RecognitionResults results) {
BaseRecognitionResult[] dataArray = results.getRecognitionResults();
//dataArray is null
for(BaseRecognitionResult baseResult : dataArray) {
if (baseResult instanceof BlinkOCRRecognitionResult) {
BlinkOCRRecognitionResult result = (BlinkOCRRecognitionResult) baseResult;
if (result.isValid() && !result.isEmpty()) {
String parsedAmount = result.getParsedResult("myRegexParser");
if (parsedAmount != null && !parsedAmount.isEmpty()) {
Log.d(TAG, "Result: " + parsedAmount);
}
}
}
}
}`
Thanks in advance!
I need to scan the PDF417 barcode, when i open the scan activity, the blinkid logo is coming for few seconds then the scan activity is open, i want to remove the blinkid logo.
I have been tried to remove that icon, but it automatically generated in each build. Is there any option to remove or please give me a solution for that.
Hello
I have issue with installing LibBlinkID library in my project
I followed instructions which you provided but i've got this error
Error:Configuration with name 'default' not found.
what should i do to solve this .
thanks in advance
regards
Is there any way to add display RecognizerView in layout? (LinearLayout, RelativeLayout, etc.)?
hi , i am using this library to perform scans of various ID cards in my app and i have imported the demo and when i run the demo to scan this ID card image (which is given with demo)
it is working fine ,
but i want to detect ID CARDS of my country , Language is English.
and i want to detect fields like name, fathers name, sex, age, address , date, as you can see in the sample image below
i will post a picture of VOTER CARD of my country, you can see all the fields.
and to detect all these fields what are things that i have change in your demo or any algorithm for this ?
Intent intent = new Intent(this, RandomScanActivity.class);
intent.putExtra(RandomScanActivity.EXTRAS_LICENSE_KEY, Config.LICENSE_KEY);
RandomScanElement[] elemsArray = new RandomScanElement[] {
new RandomScanElement(R.string.name_title, NAME_PARSER, new RawParserSettings()),
new RandomScanElement(R.string.number_title, NUMBER_PARSER_NAME, new RawParserSettings()),
new RandomScanElement(R.string.address_title, ADDRESS_PARSER_NAME, new RawParserSettings())};
intent.putExtra(RandomScanActivity.EXTRAS_SCAN_CONFIGURATION, elemsArray);
intent.putExtra(RandomScanActivity.EXTRAS_BEEP_RESOURCE, R.raw.beep);
startActivityForResult(intent, SINGLE_REQ_CODE);
I am trying to perform ocr on Indian Adhar card using this block of code. While camera preview is running, I can see 3 text box to populate data. After completion of 1st box , ocr engine , instead of populationg data to the 2nd textbox, it is trying to override the first one. Am i missing any flag?
I am looking to pull the details from the front of the Nigerian DL using Templating API. So far I have made the menuActivity, and the Templating Class from which I will get the settings as well.
Here is a sample of the front of the Nigerian DL. I have made the appropriate dimensions as well but I am getting a log like this:
07-10 03:56:49.340 1871-4271/package name W/TemplatingRecognitionData.cpp:107: Required parser 'DocumentNumber' from parser group 'DocumentNumber' did not produce result!
Please help ASAP
I am currently getting the following error:
E/WVMExtractor: Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
After enabling setDebugImageMetadataSettings to debug why OCR not reading Card properly on Android,
The full code for MetadataSettings and MetadataSettings.ImageMetadataSettings.DebugImageMetadataSettings is as follows:
MetadataSettings.ImageMetadataSettings.DebugImageMetadataSettings dims = new MetadataSettings.ImageMetadataSettings.DebugImageMetadataSettings();
dims.setAll(true);
MetadataSettings.ImageMetadataSettings ims = new MetadataSettings.ImageMetadataSettings();
ims.setDewarpedImageEnabled(true);
ims.setSuccessfulScanFrameEnabled(false);
ims.setDebugImageMetadataSettings(dims);
I am currently testing under the following environment:
OS name: Android
OS version: 7.0
Model: Lenovo P2a42
similar to BlinkID/blinkid-ios#56
currently I need to have a custom activity for this, right?
You might want to consider adding documentation about removing unused assets for use cases that do not use them. We're using blink just to scan usdls, so removing assets for other languages reduced the final apk from 1 mb with this gradle command
android {
aaptOptions {
ignoreAssetsPattern "!model_arabic.zzip:!model_malaysian.zzip:!model_micr.zzip:!model_mrtd.zzip:!model_eudl.zzip:" +
"!de_address_dictionary.zzip:!de_name_dictionary.zzip:!de_surname_dictionary.zzip:!de_dictionary.zzip:!de_confusions.zzip" +
":!de_id_confusions.zzip:!cro_address_dictionary.zzip:!cro_name_dictionary.zzip"
}
}
Do you plan a version that doesn't depend on the v4 support library? v7 appcompat library is OK..
I had tried to scan Singapore Permanent Residence(SPR) ID and found that first character of Name, DOB and Nationality get chopped off. But this issue does not found in Singapore Citizen ID.
Hi, i wanto to scan ID Card & Driving License in Indonesia, it's supported on sample app in play store (https://play.google.com/store/apps/details?id=com.microblink.blinkidapp) but i see in this blinkid-android sdk on github indonesia not supported yet
Any solution?
are there any plans to reduce the lib size? my testing app wish uses proguard jumps from 5MB to 18MB when i added your library. P.S: im using the proguard configs you provided.
The sdk (demo app) crashes with the following logs
08-22 15:26:20.227 17684-17843/com.microblink.blinkid W/linker: library "/system/lib/libui.so" ("/system/lib/libui.so") needed or dlopened by "/data/app/com.microblink.blinkid-1/lib/arm/libBlinkID.so" is not accessible for the namespace "classloader-namespace" - the access is temporarily granted as a workaround for http://b/26394120, note that the access will be removed in future releases of Android.
08-22 15:26:20.244 17684-17843/com.microblink.blinkid E/linker: library "/system/lib/hw/gralloc.msm8084.so" ("/system/lib/hw/gralloc.msm8084.so") needed or dlopened by "/system/lib/libhardware.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.microblink.blinkid-1/lib/arm:/system/fake-libs:/data/app/com.microblink.blinkid-1/base.apk!/lib/armeabi-v7a", permitted_paths="/data:/mnt/expand:/data/data/com.microblink.blinkid"]
08-22 15:26:20.244 17684-17843/com.microblink.blinkid E/HAL: load: module=/system/lib/hw/gralloc.msm8084.so
dlopen failed: library "/system/lib/hw/gralloc.msm8084.so" needed or dlopened by "/system/lib/libhardware.so" is not accessible for the namespace "classloader-namespace"
08-22 15:26:20.244 17684-17843/com.microblink.blinkid E/GraphicBufferMapper: FATAL: can't find the gralloc module
08-22 15:26:20.245 17684-17843/com.microblink.blinkid E/linker: library "/system/lib/hw/gralloc.msm8084.so" ("/system/lib/hw/gralloc.msm8084.so") needed or dlopened by "/system/lib/libhardware.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.microblink.blinkid-1/lib/arm:/system/fake-libs:/data/app/com.microblink.blinkid-1/base.apk!/lib/armeabi-v7a", permitted_paths="/data:/mnt/expand:/data/data/com.microblink.blinkid"]
08-22 15:26:20.245 17684-17843/com.microblink.blinkid E/HAL: load: module=/system/lib/hw/gralloc.msm8084.so
dlopen failed: library "/system/lib/hw/gralloc.msm8084.so" needed or dlopened by "/system/lib/libhardware.so" is not accessible for the namespace "classloader-namespace"
08-22 15:26:20.245 17684-17843/com.microblink.blinkid E/GraphicBufferAllocator: FATAL: can't find the gralloc module
08-22 15:26:20.245 17684-17843/com.microblink.blinkid A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x40 in tid 17843 (Recognition)
[ 08-22 15:26:20.245 270: 270 W/ ]
debuggerd: handling request: pid=17684 uid=10321 gid=10321 tid=17843
I think using gralloc is not allowed anymore.
Hi,I updated my blink sdk from **3.6.0 to 3.12.0.**I tested my app in different devices(Moto e4-7.1.1V,HTC-6.0V,Asus-5.0.2V)Below are my observations(scanning performance issues) and code settings for corresponding recognizer settings.
1.mrtd documents scan with image listener(like common passport docs) scanning time is too long in 3.12.0 compared with 3.6.0
Code settings :
MRTDRecognizerSettings mrtd = new MRTDRecognizerSettings();
mrtd.setShowFullDocument(true);
mrtd.setAllowUnverifiedResults(true);
scanIntent = buildIntent(new RecognizerSettings[]{mrtd}, ScanCard.class, null);
2.USDL barcode scan with image listener scanning time is too horrible in 3.12.0
Code settings:
USDLRecognizerSettings usdl = new USDLRecognizerSettings();
usdl.setUncertainScanning(false);
usdl.setNullQuietZoneAllowed(false);
scanIntent = buildIntent(new RecognizerSettings[]{usdl}, ScanCard.class, null);
3.For German driving license(EUDL) : Scanned immediately but getting only first name(getting correct name) and last name(getting incorrect name) details from the results.
Code settings:
EUDLRecognizerSettings germanDl = new EUDLRecognizerSettings(EUDLCountry.EUDL_COUNTRY_GERMANY);
germanDl.setShowFullDocument(true);
scanIntent = buildIntent(new RecognizerSettings[]{germanDl}, ScanCard.class, null);
MainIntent Settings
private Intent buildIntent(RecognizerSettings[] settArray, Class<?> target, Intent helpIntent) {
final Intent intent = new Intent(this, target);
intent.putExtra(ScanActivity.EXTRAS_BEEP_RESOURCE, R.raw.beep);
if (helpIntent != null) {
intent.putExtra(ScanActivity.EXTRAS_HELP_INTENT, helpIntent);
}
RecognitionSettings settings = new RecognitionSettings();
//IMAGE meta data settings
MetadataSettings.ImageMetadataSettings ims = new MetadataSettings.ImageMetadataSettings();
ims.setDewarpedImageEnabled(true);
ims.setSuccessfulScanFrameEnabled(true);
settings.setNumMsBeforeTimeout(2000);
settings.setAllowMultipleScanResultsOnSingleImage(true);
settings.setFrameQualityEstimationMode(RecognitionSettings.FrameQualityEstimationMode.ALWAYS_ON);
settings.setRecognizerSettingsArray(settArray);
intent.putExtra(ScanActivity.EXTRAS_RECOGNITION_SETTINGS, settings);
intent.putExtra(ScanActivity.EXTRAS_LICENSE_KEY, Config.LICENSE_KEY);
intent.putExtra(ScanActivity.EXTRAS_SHOW_FOCUS_RECTANGLE, true);
intent.putExtra(ScanActivity.EXTRAS_ALLOW_PINCH_TO_ZOOM, true);
intent.putExtra(ScanCard.EXTRAS_SPLASH_SCREEN_LAYOUT_RESOURCE, R.layout.loding_screen);
intent.putExtra(ScanCard.EXTRAS_IMAGE_LISTENER, new MyImageListener());
intent.putExtra(ScanCard.EXTRAS_IMAGE_METADATA_SETTINGS, ims);
intent.putExtra(SegmentScanActivity.EXTRAS_SHOW_OCR_RESULT_MODE, (Parcelable) ShowOcrResultMode.ANIMATED_DOTS);
return intent;
}
In all devices the performance is same.Please check this and let me know if any code settings need to be change at my end.
Thanks in Advance.
The font size of the words too small will effect the result of scanning? If yes, is there have any solution to solve it?
I'm using ScanCard activity with ScanCard.EXTRAS_SHOW_FOCUS_RECTANGLE extra set to "false", but when activity starts, focus rectangle is still displayed.
When scanning a PDF417 in the default activity it creates a rectangular outline in the ui to show the user where it is currently scanning, how am I able to get this with a custom activity?
Hi,
I am currently using this library to scan MRTDs along with some facial features.
However, I realized that once I added the FaceDetectorSettings to the RecognizerSettings array, the onScanningDone method only ever returns results for the FaceDetectorResult and never the MRTDRecognizerResult. I have it setup as below:
MRTDRecognizerSettings mrtd = new MRTDRecognizerSettings();
mrtd.setShowFullDocument(true);
DetectorRecognizerSettings faceDetectorSettings = new DetectorRecognizerSettings(new FaceDetectorSettings(300));
RecognitionSettings recognitionSettings = new RecognitionSettings();
recognitionSettings.setNumMsBeforeTimeout(5000);
RecognizerSettings[] settArray = new RecognizerSettings[]{mrtd,,faceDetectorSettings};
recognitionSettings.setRecognizerSettingsArray(settArray);
mRecognizerView.setRecognitionSettings(recognitionSettings);
My question is, are those two detectors/recognizers meant to be used like that? Without the facial recognition feature, the MRTD scanning works well and returns excellent results but not with FaceDetector in place, it seems that it will never return results for MRTD scanning.
Any feedback on this would be much appreciated.
Is there any way to make the camera manual focus by setting the focus value instead of auto focus?
May i know if there is anyway that can actually return the full scanned image without using the ImageListener? It's so problematic and its not even recommended that you pass interfaces along side the intent to be able to receive the image, as you are keeping a strong reference of the whole object within your activity & what is even worse, for ex: we will never get the data from listener if for ex: we started the ScanActivity & then rotated the device we trigger a configuration changes which now destroys the interface class that is being implemented by another class since we really don't want you to hold on a reference to the activity that is starting the intent.
Is there anyway to get around this besides creating our own ScanActivity & without keeping a strong reference to the interface(ImageListener class)? if there is no such way right now. are you planning to improve on this process by simplifying it to lets say returning the image if one actually request for it in one of the intent exteras ?
I tried adding an image listener to the ScanCard activity to capture MyKad and it didn't do so on Android version 5.1 to 4.4.2. There is also no crash log or any log info as far as I can see. Even use the sample MyImageListener given in the documentation doesn't work. This is only for BlinkId 3.1.0. Apparently it works in one Android 4.4.2 when I lowered the version to BlinkId 3.0.0.
We also filed a support ticket, but opening an issue here as well out of urgency. From the support ticket:
We are having trouble integrating the BlinkID Android SDK into our project.
Specifically, we are unable to integrate the ability to scan MRTD documents into our application. The demo project, BlinkIDImageListenerDemo [1], included in the GitHub repository continuously crashes before any scanning can be completed.
Attached is a log file from a session of attempting to run the aforementioned project. [1]
We sincerely appreciate any immediate help you can offer towards this integration issue, as we are short on time to complete this integration.
Specifically, when I run the BlinkIDImageListenerDemo, the launch screen has a single button on it that says "Scan MRTD". Upon clicking that button, the ScanCard Activity is started and, after a few seconds of seemingly trying to autofocus, just closes (taking me back to the first screen). The app does not crash completely, but there do appear to be error related messages in the log output file that I attached.
Also, Info on the device we are having issues with (from the suggested app [2]):
Manufacturer - Motorola
Model - XT1096
Hardware - qcom
Board - MSM8974
Device - victara
[1] https://play.google.com/store/apps/details?id=com.jphilli85.deviceinfo&hl=en
[2] https://microblink.zendesk.com/attachments/token/3xtobspIZ7TbcAXOncdTTRywB/?name=logs_201611080229.txt
Isn't possible to have barcode image returned for one dimensional scanning?
my device info as shown below:
device name: xiaomi 5s
Android Version: 6.0.1
The screen resolution: 1920*1080 5.15 inches
Grab log is as follows:
blinkid_logs.txt
Hi, may I know that is it possible to customize the template (CroationIDFrontSide) to scan the other types of card for example Student Identification Card? If can, what are the steps to customize it?
Thank you.
The autofocus is very slow. Suggest to add "touch to focus" instead.
Device tested: Nexus 6P
Step to reproduce:
While scanning is fast if i point the camera to near object first before i start camera view. which is not the case for many user.
I love the this tool and I'm building an app around it, but I tried to find a way to edit the layout of the Segment Scan Activity and I couldn't figure it out!
Looking forward to your help.
Hi, may I know how to customize a document size and the position of the information I need to scan?
thanks
I would like to know how much does BlinkId impact on the battery?
When we awhile ago started developing on the Template module which we regularly had to do some testing, we discovered that the BlinkId impact the battery life pretty much, is there anyway future enhancement that can actually reduce the library battery consumption?
Thanks.
first of all, great library guys!
the issue i was having is that I was using ScanCard expecting it to come to onActivityResult after the timeout, but it didn't. The docs clarified things: "...number of miliseconds that must pass after first partial scan result has arrived before scan activity triggers a timeout."
Is there a way to trigger a timeout for ScanCard whether or not there is a partial result? Or somehow programmatically cancel the scanning process?
thanks!
Hi all,
I am currently trying to read MRTD from Passport using Microblink v3.12.0 but the Application is crashing everytime with the following error message:
https://paste.ofcode.org/V3fBvzYHnXkGbzhQup5JQ
The code which used to work in previous versions of Microblink is the following
private ListElement buildMrtdElement() {
MRTDRecognizerSettings sett = new MRTDRecognizerSettings();
sett.setShowFullDocument(true);
return new ListElement("ID document or Passport", buildIntent(activity, new RecognizerSettings[]{sett}, ScanActivityFront.class, null));
}
I have tried playing around with the methods provided bellow but without much success. Tried enabling, disabling, and so on a so forth.
private ListElement buildMrtdElement() {
...
sett.setDetectGlare(true);
sett.setDetectGlare(false);
sett.shouldDetectGlare();
...
}
ScanActivityFront.class is a custom class using the Templating API provided by Microblink. Within this class, my metadata settings also sets setGlareMetadataAllowed to true:
MetadataSettings ms = new MetadataSettings();
ms.setGlareMetadataAllowed(true);
Any help with this would be greatly appreciated
I couldnt see the license of this library, maybe now I`m blind?
Hi, may I know that is there any feature which can let me scan the bar code and at the same time I want to get the other information on the card? Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.