11import { Recognizer , RecognizerResult } from '../recognizer'
22import {
33 Date ,
4- Point ,
5- Quadrilateral ,
6-
7-
8- Issuer ,
9- BlinkCardProcessingStatus ,
10- BlinkCardAnonymizationMode ,
11- CardNumberAnonymizationSettings ,
124 BlinkCardAnonymizationSettings ,
135 BlinkCardMatchLevel ,
14- BlinkCardCheckResult ,
156 ImageExtensionFactors ,
16- DataMatchResult ,
7+ BlinkCardDetectionLevel ,
178} from '../types'
189
1910/**
@@ -22,93 +13,93 @@ import {
2213export class BlinkCardRecognizerResult extends RecognizerResult {
2314 constructor ( nativeResult ) {
2415 super ( nativeResult . resultState ) ;
25-
16+
2617 /**
2718 * The payment card number.
2819 */
2920 this . cardNumber = nativeResult . cardNumber ;
30-
21+
3122 /**
3223 * The payment card number prefix.
3324 */
3425 this . cardNumberPrefix = nativeResult . cardNumberPrefix ;
35-
26+
3627 /**
3728 * The payment card number is valid
3829 */
3930 this . cardNumberValid = nativeResult . cardNumberValid ;
40-
31+
4132 /**
4233 * Payment card's security code/value.
4334 */
4435 this . cvv = nativeResult . cvv ;
45-
36+
4637 /**
4738 * Document liveness check (screen, photocopy, hand presence) which can pass or fail.
4839 */
4940 this . documentLivenessCheck = nativeResult . documentLivenessCheck ;
50-
41+
5142 /**
5243 * The payment card's expiry date.
5344 */
5445 this . expiryDate = nativeResult . expiryDate != null ? new Date ( nativeResult . expiryDate ) : null ;
55-
46+
5647 /**
5748 * Whether the first scanned side is anonymized.
5849 */
5950 this . firstSideAnonymized = nativeResult . firstSideAnonymized ;
60-
51+
6152 /**
6253 * Whether the first scanned side is blurred.
6354 */
6455 this . firstSideBlurred = nativeResult . firstSideBlurred ;
65-
56+
6657 /**
6758 * Full image of the payment card from first side recognition.
6859 */
6960 this . firstSideFullDocumentImage = nativeResult . firstSideFullDocumentImage ;
70-
61+
7162 /**
7263 * Payment card's IBAN.
7364 */
7465 this . iban = nativeResult . iban ;
75-
66+
7667 /**
7768 * Payment card's issuing network.
7869 */
7970 this . issuer = nativeResult . issuer ;
80-
71+
8172 /**
8273 * Information about the payment card owner (name, company, etc.).
8374 */
8475 this . owner = nativeResult . owner ;
85-
76+
8677 /**
8778 * Status of the last recognition process.
8879 */
8980 this . processingStatus = nativeResult . processingStatus ;
90-
81+
9182 /**
9283 * Returns true if recognizer has finished scanning first side and is now scanning back side,
9384 * false if it's still scanning first side.
9485 */
9586 this . scanningFirstSideDone = nativeResult . scanningFirstSideDone ;
96-
87+
9788 /**
9889 * Whether the second scanned side is anonymized.
9990 */
10091 this . secondSideAnonymized = nativeResult . secondSideAnonymized ;
101-
92+
10293 /**
10394 * Whether the second scanned side is blurred.
10495 */
10596 this . secondSideBlurred = nativeResult . secondSideBlurred ;
106-
97+
10798 /**
10899 * Full image of the payment card from second side recognition.
109100 */
110101 this . secondSideFullDocumentImage = nativeResult . secondSideFullDocumentImage ;
111-
102+
112103 }
113104}
114105
@@ -118,86 +109,86 @@ export class BlinkCardRecognizerResult extends RecognizerResult {
118109export class BlinkCardRecognizer extends Recognizer {
119110 constructor ( ) {
120111 super ( 'BlinkCardRecognizer' ) ;
121-
112+
122113 /**
123114 * Defines whether blured frames filtering is allowed
124115 *
125116 *
126117 */
127118 this . allowBlurFilter = true ;
128-
119+
129120 /**
130121 * Whether invalid card number is accepted.
131122 *
132123 *
133124 */
134125 this . allowInvalidCardNumber = false ;
135-
126+
136127 /**
137128 * Defines whether sensitive data should be redacted from the result.
138129 *
139130 *
140131 */
141132 this . anonymizationSettings = new BlinkCardAnonymizationSettings ( ) ;
142-
133+
143134 /**
144135 * Should extract CVV
145136 *
146137 *
147138 */
148139 this . extractCvv = true ;
149-
140+
150141 /**
151142 * Should extract the payment card's month of expiry
152143 *
153144 *
154145 */
155146 this . extractExpiryDate = true ;
156-
147+
157148 /**
158149 * Should extract the payment card's IBAN
159150 *
160151 *
161152 */
162153 this . extractIban = true ;
163-
154+
164155 /**
165156 * Should extract the card owner information
166157 *
167158 *
168159 */
169160 this . extractOwner = true ;
170-
161+
171162 /**
172163 * Property for setting DPI for full document images
173164 * Valid ranges are [100,400]. Setting DPI out of valid ranges throws an exception
174165 *
175166 *
176167 */
177168 this . fullDocumentImageDpi = 250 ;
178-
169+
179170 /**
180171 * Image extension factors for full document image.
181172 *
182173 * @see CImageExtensionFactors
183174 *
184175 */
185176 this . fullDocumentImageExtensionFactors = new ImageExtensionFactors ( ) ;
186-
177+
187178 /**
188179 * This parameter is used to adjust heuristics that eliminate cases when the hand is present.
189180 *
190181 *
191182 */
192183 this . handDocumentOverlapThreshold = 0.05 ;
193-
184+
194185 /**
195186 * Hand scale is calculated as a ratio between area of hand mask and document mask.
196187 *
197188 *
198189 */
199190 this . handScaleThreshold = 0.15 ;
200-
191+
201192 /**
202193 * Pading is a minimum distance from the edge of the frame and is defined as a percentage of the frame width. Default value is 0.0f and in that case
203194 * padding edge and image edge are the same.
@@ -206,28 +197,35 @@ export class BlinkCardRecognizer extends Recognizer {
206197 *
207198 */
208199 this . paddingEdge = 0.0 ;
209-
200+
210201 /**
211202 * Photocopy analysis match level - higher if stricter.
212203 *
213204 *
214205 */
215206 this . photocopyAnalysisMatchLevel = BlinkCardMatchLevel . Level5 ;
216-
207+
217208 /**
218209 * Sets whether full document image of ID card should be extracted.
219210 *
220211 *
221212 */
222213 this . returnFullDocumentImage = false ;
223-
214+
224215 /**
225216 * Screen analysis match level - higher if stricter.
226217 *
227218 *
228219 */
229220 this . screenAnalysisMatchLevel = BlinkCardMatchLevel . Level5 ;
230-
221+
222+ /**
223+ * The level of allowed detected tilt of the document in the image.
224+ *
225+ * Default: `BlinkCardDetectionLevel.Mid`
226+ */
227+ this . tiltDetectionLevel = BlinkCardDetectionLevel . Mid ;
228+
231229 this . createResultFromNative = function ( nativeResult ) { return new BlinkCardRecognizerResult ( nativeResult ) ; }
232230 }
233231}
0 commit comments