-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from BlinkID/develop
v4.9.0.0
- Loading branch information
Showing
54 changed files
with
424 additions
and
908 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 1 addition & 8 deletions
9
...otlin/com/microblink/documentscanflow/recognition/implementations/NigeriaDlRecognition.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
package com.microblink.documentscanflow.recognition.implementations | ||
|
||
import com.microblink.entities.recognizers.blinkbarcode.usdl.UsdlKeys | ||
|
||
class NigeriaDlRecognition: UsdlRecognition() { | ||
|
||
override val keysToExcludeFromResults: Set<UsdlKeys> | ||
get() = setOf(UsdlKeys.Height, UsdlKeys.HeightCm, UsdlKeys.HeightIn) | ||
|
||
} | ||
class NigeriaDlRecognition: UsdlRecognition() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...tlin/com/microblink/documentscanflow/recognition/implementations/VictoriaDlRecognition.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.microblink.documentscanflow.recognition.implementations | ||
|
||
import com.microblink.documentscanflow.isNotEmpty | ||
import com.microblink.documentscanflow.recognition.BaseTwoSideRecognition | ||
import com.microblink.documentscanflow.recognition.ResultValidator | ||
import com.microblink.entities.recognizers.Recognizer | ||
import com.microblink.entities.recognizers.blinkid.australia.AustraliaDlBackRecognizer | ||
import com.microblink.entities.recognizers.blinkid.australia.AustraliaDlFrontRecognizer | ||
import com.microblink.documentscanflow.recognition.resultentry.ResultKey.* | ||
|
||
class VictoriaDlRecognition : BaseTwoSideRecognition() { | ||
|
||
private val frontRecognizer by lazy { AustraliaDlFrontRecognizer() } | ||
private val backRecognizer by lazy { AustraliaDlBackRecognizer() } | ||
|
||
private val frontResult by lazy { frontRecognizer.result } | ||
private val backResult by lazy { backRecognizer.result } | ||
|
||
override fun createValidator() = ResultValidator().match(frontResult.licenceExpiry, backResult.licenceExpiry) | ||
|
||
override fun extractFields() { | ||
if (frontResult.isNotEmpty()) { | ||
frontResult.apply { | ||
add(ADDRESS, address) | ||
add(DATE_OF_BIRTH, dateOfBirth) | ||
add(FULL_NAME, fullName) | ||
addDateOfExpiry(licenceExpiry) | ||
add(LICENCE_NUMBER, licenceNumber) | ||
add(LICENCE_TYPE, licenceType) | ||
} | ||
} | ||
|
||
if (backResult.isNotEmpty()) { | ||
backResult.apply { | ||
add(LAST_NAME, lastName) | ||
add(ADDRESS, address) | ||
add(LICENCE_NUMBER, licenceNumber) | ||
addDateOfExpiry(licenceExpiry) | ||
} | ||
} | ||
} | ||
|
||
override fun getResultTitle(): String? { | ||
if (frontResult.isNotEmpty()) { | ||
return frontResult.fullName | ||
} | ||
if (backResult.isNotEmpty()) { | ||
return backResult.lastName | ||
} | ||
return null | ||
} | ||
|
||
override fun getSingleSideRecognizers() = listOf<Recognizer<*, *>>(frontRecognizer, backRecognizer) | ||
|
||
} |
Oops, something went wrong.