Skip to content

Commit

Permalink
Merge pull request #26 from BlinkID/release/v3.4.0
Browse files Browse the repository at this point in the history
Release/v3.4.0
  • Loading branch information
DoDoENT authored Jan 20, 2017
2 parents fed58b7 + 6b3e543 commit e58826b
Show file tree
Hide file tree
Showing 103 changed files with 8,128 additions and 658 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android:
components:
- platform-tools
- tools
- build-tools-25.0.0
- android-24
- build-tools-25.0.2
- android-25
- extra-android-m2repository
script:
- cd BlinkIDDemo
Expand Down
2 changes: 1 addition & 1 deletion BlinkIDDemo/BlinkIDDemo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'android'
apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
import com.microblink.recognizers.blinkid.eudl.EUDLRecognizerSettings;
import com.microblink.recognizers.blinkid.serbia.back.SerbianIDBackSideRecognizerSettings;
import com.microblink.recognizers.blinkid.serbia.front.SerbianIDFrontSideRecognizerSettings;
import com.microblink.recognizers.blinkid.singapore.SingaporeIDRecognizerSettings;
import com.microblink.recognizers.blinkid.singapore.back.SingaporeIDBackRecognizerSettings;
import com.microblink.recognizers.blinkid.singapore.front.SingaporeIDFrontRecognizerSettings;
import com.microblink.recognizers.blinkid.slovakia.back.SlovakIDBackSideRecognizerSettings;
import com.microblink.recognizers.blinkid.slovakia.front.SlovakIDFrontSideRecognizerSettings;
import com.microblink.recognizers.blinkid.slovenia.back.SlovenianIDBackSideRecognizerSettings;
Expand Down Expand Up @@ -445,14 +446,14 @@ private ListElement buildIKadElement() {
}

private ListElement buildSingaporeIDElement() {
// prepare settings for Singapore ID document recognizer
SingaporeIDRecognizerSettings singID = new SingaporeIDRecognizerSettings();
singID.setExtractBloodGroup(true);
singID.setExtractDateOfIssue(true);
// prepare settings for Singapore ID document recognizer (front side)
SingaporeIDFrontRecognizerSettings singFront = new SingaporeIDFrontRecognizerSettings();
// prepare settings for Singapore ID document recognizer (back side)
SingaporeIDBackRecognizerSettings singBack = new SingaporeIDBackRecognizerSettings();

// build a scan intent by adding intent extras common to all other recognizers
// when scanning UD documents, we will use ScanCard activity which has more suitable UI for scanning ID document
return new ListElement("Singapore ID document", buildIntent(new RecognizerSettings[]{singID}, ScanCard.class, null));
return new ListElement("Singapore ID document", buildIntent(new RecognizerSettings[]{ singFront, singBack }, ScanCard.class, null));
}

private ListElement buildUsdlElement() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
Expand Down Expand Up @@ -277,7 +278,7 @@ public void onCameraPreviewStarted() {
// and auto exposure measurements
// we set the same rectangle as for scanning region
// we also define that this metering area will follow device orientation changes
mRecognizerView.setMeteringAreas(new Rectangle[] {new Rectangle(0.1f, 0.34f, 0.8f, 0.13f)}, true);
mRecognizerView.setMeteringAreas(new RectF[] {new RectF(0.1f, 0.34f, 0.1f + 0.8f, 0.34f + 0.13f)}, true);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion BlinkIDDemo/BlinkIDDemoCustomUI/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apply plugin: 'android'
apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.microblink.blinkid.demo.customcamera.camera2.AutoFitTextureView
android:id="@+id/texture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">

<com.microblink.blinkid.demo.customcamera.camera2.AutoFitTextureView
android:id="@+id/texture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</RelativeLayout>

</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
import com.microblink.libresult.extract.eudl.EUDLRecognitionResultExtractor;
import com.microblink.libresult.extract.serbia.SerbianIDBackRecognitionResultExtractor;
import com.microblink.libresult.extract.serbia.SerbianIDFrontRecognitionResultExtractor;
import com.microblink.libresult.extract.singapore.SingaporeIDRecognitionResultExtractor;
import com.microblink.libresult.extract.singapore.SingaporeIDFrontRecognitionResultExtractor;
import com.microblink.libresult.extract.singapore.SingaporeIDBackRecognitionResultExtractor;
import com.microblink.libresult.extract.slovakia.SlovakIDBackSideRecognitionResultExtractor;
import com.microblink.libresult.extract.slovakia.SlovakIDFrontSideRecognitionResultExtractor;
import com.microblink.libresult.extract.barcode.ZXingRecognitionResultExtractor;
Expand All @@ -58,11 +59,12 @@
import com.microblink.recognizers.blinkid.eudl.EUDLRecognitionResult;
import com.microblink.recognizers.blinkid.serbia.back.SerbianIDBackSideRecognitionResult;
import com.microblink.recognizers.blinkid.serbia.front.SerbianIDFrontSideRecognitionResult;
import com.microblink.recognizers.blinkid.singapore.SingaporeIDRecognitionResult;
import com.microblink.recognizers.blinkid.slovakia.back.SlovakIDBackSideRecognitionResult;
import com.microblink.recognizers.blinkid.slovakia.front.SlovakIDFrontSideRecognitionResult;
import com.microblink.recognizers.blinkid.slovenia.back.SlovenianIDBackSideRecognitionResult;
import com.microblink.recognizers.blinkid.slovenia.front.SlovenianIDFrontSideRecognitionResult;
import com.microblink.recognizers.blinkid.singapore.back.SingaporeIDBackRecognitionResult;
import com.microblink.recognizers.blinkid.singapore.front.SingaporeIDFrontRecognitionResult;
import com.microblink.recognizers.blinkocr.BlinkOCRRecognitionResult;

import java.util.List;
Expand Down Expand Up @@ -110,8 +112,10 @@ public void onCreate(Bundle savedInstanceState) {
// CroatianIDBackSideRecognitionResult extends MRTDRecognitionResult so we first need
// to check for CroatianIDBackSideRecognitionResult and then for MRTDRecognitionResult

if (mData instanceof SingaporeIDRecognitionResult) {
mResultExtractor = new SingaporeIDRecognitionResultExtractor(getActivity());
if (mData instanceof SingaporeIDFrontRecognitionResult) {
mResultExtractor = new SingaporeIDFrontRecognitionResultExtractor(getActivity());
} else if ( mData instanceof SingaporeIDBackRecognitionResult) {
mResultExtractor = new SingaporeIDBackRecognitionResultExtractor( getActivity() );
} else if (mData instanceof AustrianIDBackSideRecognitionResult) {
mResultExtractor = new AustrianIDBackSideRecognitionResultExtractor(getActivity());
} else if (mData instanceof AustrianIDFrontSideRecognitionResult) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import android.content.Context;

import com.microblink.libresult.R;
import com.microblink.libresult.extract.mrtd.MRTDRecognitionResultExtractor;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.recognizers.BaseRecognitionResult;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.libresult.extract.mrtd.MRTDRecognitionResultExtractor;
import com.microblink.recognizers.blinkid.croatia.back.CroatianIDBackSideRecognitionResult;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import android.content.Context;

import com.microblink.libresult.R;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.libresult.extract.blinkInput.BlinkOcrRecognitionResultExtractor;
import com.microblink.recognizers.BaseRecognitionResult;
import com.microblink.recognizers.blinkid.croatia.front.CroatianIDFrontSideRecognitionResult;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.libresult.extract.blinkInput.BlinkOcrRecognitionResultExtractor;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import android.content.Context;

import com.microblink.libresult.R;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.libresult.extract.blinkInput.BlinkOcrRecognitionResultExtractor;
import com.microblink.recognizers.BaseRecognitionResult;
import com.microblink.recognizers.blinkid.germany.front.GermanIDFrontSideRecognitionResult;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.libresult.extract.blinkInput.BlinkOcrRecognitionResultExtractor;

import java.util.List;

/**
* Created by igrce on 26/08/16.
*/
public class GermanIDFrontSideRecognitionResultExtractor extends BlinkOcrRecognitionResultExtractor {

public GermanIDFrontSideRecognitionResultExtractor(Context context) {
super(context);
}
Expand All @@ -36,23 +40,23 @@ public List<RecognitionResultEntry> extractData(BaseRecognitionResult result) {
));

mExtractedData.add(mBuilder.build(
R.string.PPDocumentNumber,
deIdFrontResult.getIdentityCardNumber()
R.string.PPNationality,
deIdFrontResult.getNationality()
));

mExtractedData.add(mBuilder.build(
R.string.PPDateOfBirth,
deIdFrontResult.getDateOfBirth()
R.string.PPPlaceOfBirth,
deIdFrontResult.getPlaceOfBirth()
));

mExtractedData.add(mBuilder.build(
R.string.PPNationality,
deIdFrontResult.getNationality()
R.string.PPDateOfBirth,
deIdFrontResult.getDateOfBirth()
));

mExtractedData.add(mBuilder.build(
R.string.PPPlaceOfBirth,
deIdFrontResult.getPlaceOfBirth()
R.string.PPDocumentNumber,
deIdFrontResult.getIdentityCardNumber()
));

mExtractedData.add(mBuilder.build(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
import android.content.Context;

import com.microblink.libresult.R;
import com.microblink.libresult.extract.mrtd.MRTDRecognitionResultExtractor;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.recognizers.BaseRecognitionResult;
import com.microblink.recognizers.blinkid.germany.mrz.GermanIDMRZSideRecognitionResult;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.libresult.extract.mrtd.MRTDRecognitionResultExtractor;

import java.util.Date;
import java.util.List;

/**
* Created by igrce on 26/08/16.
*/
public class GermanIDMRZSideRecognitionResultExtractor extends MRTDRecognitionResultExtractor {

public GermanIDMRZSideRecognitionResultExtractor(Context context) {
Expand Down Expand Up @@ -66,6 +69,14 @@ public List<RecognitionResultEntry> extractData(BaseRecognitionResult result) {
));
}

String placeOfBirth = deIDMrzResult.getPlaceOfBirth();
if (placeOfBirth != null) {
mExtractedData.add(mBuilder.build(
R.string.PPPlaceOfBirth,
placeOfBirth
));
}

super.extractMRZData(deIDMrzResult);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.microblink.libresult.extract.singapore;

import android.content.Context;

import com.microblink.libresult.R;
import com.microblink.recognizers.BaseRecognitionResult;
import com.microblink.recognizers.blinkid.singapore.back.SingaporeIDBackRecognitionResult;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.libresult.extract.blinkInput.BlinkOcrRecognitionResultExtractor;

import java.util.List;

/**
* Created by Boris on 03/05/16.
*/
public class SingaporeIDBackRecognitionResultExtractor extends BlinkOcrRecognitionResultExtractor {

public SingaporeIDBackRecognitionResultExtractor(Context context) {
super(context);
}

@Override
public List<RecognitionResultEntry> extractData(BaseRecognitionResult result) {

if (result == null){
return mExtractedData;
}

if (result instanceof SingaporeIDBackRecognitionResult){
// result is obtained by scanning of Singapore ID
SingaporeIDBackRecognitionResult singaporeIDResult = (SingaporeIDBackRecognitionResult) result;

mExtractedData.add(mBuilder.build(
R.string.PPDocumentNumber,
singaporeIDResult.getCardNumber()
));

mExtractedData.add(mBuilder.build(
R.string.PPBloodGroup,
singaporeIDResult.getBloodGroup()
));
mExtractedData.add(mBuilder.build(
R.string.PPIssueDate,
singaporeIDResult.getDocumentDateOfIssue()
));
mExtractedData.add(mBuilder.build(
R.string.PPAddress,
singaporeIDResult.getAddress()
));
}

return mExtractedData;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.microblink.libresult.extract.singapore;

import android.content.Context;

import com.microblink.libresult.R;
import com.microblink.recognizers.BaseRecognitionResult;
import com.microblink.recognizers.blinkid.singapore.front.SingaporeIDFrontRecognitionResult;
import com.microblink.libresult.extract.RecognitionResultEntry;
import com.microblink.libresult.extract.blinkInput.BlinkOcrRecognitionResultExtractor;

import java.util.List;

/**
* Created by Boris on 03/05/16.
*/
public class SingaporeIDFrontRecognitionResultExtractor extends BlinkOcrRecognitionResultExtractor {

public SingaporeIDFrontRecognitionResultExtractor(Context context) {
super(context);
}

@Override
public List<RecognitionResultEntry> extractData(BaseRecognitionResult result) {

if (result == null){
return mExtractedData;
}

if (result instanceof SingaporeIDFrontRecognitionResult){
// result is obtained by scanning of Singapore ID
SingaporeIDFrontRecognitionResult singaporeIDResult = (SingaporeIDFrontRecognitionResult) result;

mExtractedData.add(mBuilder.build(
R.string.PPDocumentNumber,
singaporeIDResult.getCardNumber()
));

mExtractedData.add(mBuilder.build(
R.string.PPFullName,
singaporeIDResult.getName()
));
mExtractedData.add(mBuilder.build(
R.string.PPRace,
singaporeIDResult.getRace()
));
mExtractedData.add(mBuilder.build(
R.string.PPDateOfBirth,
singaporeIDResult.getDateOfBirth()
));
mExtractedData.add(mBuilder.build(
R.string.PPSex,
singaporeIDResult.getSex()
));
mExtractedData.add(mBuilder.build(
R.string.PPCountryOfBirth,
singaporeIDResult.getCountryOfBirth()
));
}

return mExtractedData;
}
}
Loading

0 comments on commit e58826b

Please sign in to comment.