what-the-bank/sources/com/kofax/kmc/ken/engines/IsgPassportDetector.java

147 lines
7.6 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.kofax.kmc.ken.engines;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.graphics.Rect;
import com.kofax.android.abc.machine_vision.CaptureGuidance;
import com.kofax.android.abc.machine_vision.DocumentTracker;
import com.kofax.kmc.ken.engines.data.HorizontalGuidance;
import com.kofax.kmc.ken.engines.data.OrientationGuidance;
import com.kofax.kmc.ken.engines.data.PassportDetectionResult;
import com.kofax.kmc.ken.engines.data.PassportDetectionSettings;
import com.kofax.kmc.ken.engines.data.TurnGuidance;
import com.kofax.kmc.ken.engines.data.VerticalGuidance;
import com.kofax.kmc.ken.engines.data.ZoomGuidance;
import com.kofax.mobile.sdk._internal.impl.detection.Frame;
import java.util.List;
import java.util.Locale;
/* loaded from: classes3.dex */
public class IsgPassportDetector implements IPassportDetector {
private static final String TAG;
private static final int bD = 1;
private static int bE = 0;
private static final int bM = 921600;
private final IBoundingRectCalculator T;
private final IOrientationGuidanceCalculator ae;
private final DocumentTracker bA = new DocumentTracker();
private Rect bB;
public IsgPassportDetector() {
com.kofax.kmc.ken.engines.a aVar = new com.kofax.kmc.ken.engines.a();
this.T = aVar;
this.ae = new l(aVar);
this.bB = new Rect();
}
static {
System.loadLibrary("a1ac4");
System.loadLibrary("ee77d4");
System.loadLibrary("d8b3e6");
System.loadLibrary("b2681f");
TAG = "IsgPassportDetector";
bE = 0;
}
@Override // com.kofax.kmc.ken.engines.IDocumentDetector
public void destroy() {
this.bA.dispose();
}
@Override // com.kofax.kmc.ken.engines.IDocumentDetector
public PassportDetectionResult detect(PassportDetectionSettings passportDetectionSettings, Bitmap bitmap) {
return a(passportDetectionSettings, new com.kofax.mobile.sdk.o.d(bitmap));
}
@Override // com.kofax.kmc.ken.engines.IDocumentDetector
public PassportDetectionResult detect(PassportDetectionSettings passportDetectionSettings, byte[] bArr, int i, int i2) {
return a(passportDetectionSettings, new com.kofax.mobile.sdk.o.e(bArr, 17, i, i2));
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Removed duplicated region for block: B:14:0x0054 A[Catch: all -> 0x0120, TRY_LEAVE, TryCatch #0 {, blocks: (B:5:0x0021, B:11:0x0030, B:12:0x0044, B:14:0x0054, B:19:0x005e, B:21:0x00c4, B:23:0x00cc, B:25:0x00d4, B:27:0x00dc, B:28:0x00e6, B:30:0x00e9, B:35:0x00f6, B:37:0x00f9, B:39:0x00fd, B:42:0x0106, B:44:0x010d, B:48:0x0116, B:55:0x0042, B:58:0x011a, B:59:0x011f, B:7:0x0024, B:10:0x0028, B:54:0x003b), top: B:4:0x0021, inners: #1 }] */
/* JADX WARN: Removed duplicated region for block: B:18:0x005d */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
private com.kofax.kmc.ken.engines.IsgPassportDetector.a a(com.kofax.kmc.ken.engines.data.PassportDetectionSettings r19, com.kofax.mobile.sdk.o.f r20) {
/*
Method dump skipped, instructions count: 291
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.kofax.kmc.ken.engines.IsgPassportDetector.a(com.kofax.kmc.ken.engines.data.PassportDetectionSettings, com.kofax.mobile.sdk.o.f):com.kofax.kmc.ken.engines.IsgPassportDetector$a");
}
private void a(int i, int i2, PassportDetectionSettings passportDetectionSettings) {
if (i == this.bB.width() && i2 == this.bB.height()) {
return;
}
Rect rect = new Rect(0, 0, i, i2);
this.bA.initializeString(b(i, i2), "DocumentTracker");
r();
this.bB = rect;
}
private void r() {
this.bA.reset();
this.bA.startup();
this.bA.RunDetection = true;
this.bA.RunLocalSearch = false;
this.bA.RunBoundaryDetection = true;
this.bA.RunDirectionDetection = true;
this.bA.RunRecognition = false;
}
private static String b(int i, int i2) {
float f;
float f2;
if (i * i2 < bM) {
f = 50.0f;
f2 = 1.0f;
} else {
f = 100.0f;
f2 = 0.5f;
}
return String.format(Locale.US, "<?xml version='1.0' encoding='iso-8859-1'?><Configuration name='Cadence'> <Section name='DocumentTracker'> <Parm name='DetectorConfig' type='string' value='MRZConfig' /> <Parm name='FrameHistorySize' type='int' value='20' /> <Parm name='MaxTrackedDocuments' type='int' value='5' /> <Parm name='IsUseReferenceFeature' type='bool' value='yes' /> </Section> <Section name='MRZConfig'> <Parm name='DetectorType' type='string' value='MRZDocumentDetector' /> <Parm name='SideConfig' type='string' value='MRZSideConfig' /> <Parm name='NumberOfOrientations' type='int' value='2' /> <Parm name='ScalingFactor' type='float' value='%f' /> <Parm name='LowDPI' type='float' value='%f' /> <Parm name='HighDPI' type='float' value='500.0' /> <Parm name='MinAspectRatio' type='float' value='0.3' /> <Parm name='CharacterHeight' type='float' value='0.11' /> <Parm name='ErrorThreshold' type='float' value='0.3' /> <Parm name='NumCharacterThreshold2' type='int' value='22' /> <Parm name='ROIExtensionMargin' type='float' value='1.00' /> <Parm name='FrameMargin' type='float' value='0.02' /> </Section> <Section name='MRZSideConfig'> <Parm name='ContrastThreshold' type='int' value='15' /> <Parm name='ToleranceRatio' type='float' value='0.02' /> <Parm name='TotalSegmentSupportRatio' type='float' value='2.6'/> <Parm name='MaxTopBottomSegmentSupportRatio' type='float' value='0.65'/> <Parm name='MaxLeftRightSegmentSupportRatio' type='float' value='0.65'/> </Section></Configuration>", Float.valueOf(f2), Float.valueOf(f));
}
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public static class a extends PassportDetectionResult {
private final OrientationGuidance U;
private final b bG;
public a(Rect rect, List<Point> list, boolean z, Frame frame, CaptureGuidance captureGuidance, PassportDetectionSettings passportDetectionSettings, IOrientationGuidanceCalculator iOrientationGuidanceCalculator) {
super(rect, list, frame);
this.bG = new b(new k(captureGuidance), passportDetectionSettings, rect, frame.getWidth(), frame.getHeight(), this.bounds, z);
this.U = iOrientationGuidanceCalculator.calculate(rect, this.bounds);
}
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
public ZoomGuidance getZoomGuidance() {
return this.bG.e();
}
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
public TurnGuidance getTurnGuidance() {
return this.bG.getTurnGuidance();
}
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
public HorizontalGuidance getHorizontalMovementGuidance() {
return this.bG.getHorizontalMovementGuidance();
}
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
public VerticalGuidance getVerticalMovementGuidance() {
return this.bG.getVerticalMovementGuidance();
}
@Override // com.kofax.kmc.ken.engines.data.DetectionResult
public OrientationGuidance getOrientationGuidance() {
return this.U;
}
}
}