package com.kofax.kmc.ken.engines; import android.graphics.Bitmap; import android.graphics.Point; import com.kofax.android.abc.machine_vision.DetectedDocumentBoundary; import com.kofax.android.abc.machine_vision.DocumentTracker; import com.kofax.android.abc.machine_vision.TrackedDocument; import com.kofax.kmc.ken.engines.data.BoundingTetragon; import java.util.Vector; /* loaded from: classes3.dex */ public class IsgMrzDocumentDetector implements IMrzDocumentDetector { private static final String TAG = "IsgMrzDocumentDetector"; private final DocumentTracker bK = new DocumentTracker(); static { System.loadLibrary("a1ac4"); System.loadLibrary("ee77d4"); System.loadLibrary("d8b3e6"); System.loadLibrary("b2681f"); } @Override // com.kofax.kmc.ken.engines.IMrzDocumentDetector public void destroy() { this.bK.dispose(); } @Override // com.kofax.kmc.ken.engines.IMrzDocumentDetector public BoundingTetragon detect(Bitmap bitmap) { DocumentTracker documentTracker; synchronized (this.bK) { s(); try { try { new com.kofax.mobile.sdk.o.d(bitmap).a(this.bK); this.bK.processFrame(); documentTracker = this.bK; } catch (Exception e) { com.kofax.mobile.sdk._internal.k.e(TAG, " Exception while native tracker processing", (Throwable) e); documentTracker = this.bK; } documentTracker.releaseFrame(); Vector Documents = this.bK.Documents(); if (Documents.size() <= 0) { com.kofax.mobile.sdk._internal.k.b(TAG, "docs.size() < 1, returning null detection"); return null; } TrackedDocument trackedDocument = Documents.get(0); if (trackedDocument.Boundary().BoundaryType() != DetectedDocumentBoundary.DetectedBoundaryType.WHOLE_OBJECT) { return null; } Vector Corners = trackedDocument.Boundary().Corners(); BoundingTetragon boundingTetragon = new BoundingTetragon(); boundingTetragon.setTopLeft(Corners.get(0)); boundingTetragon.setTopRight(Corners.get(1)); boundingTetragon.setBottomLeft(Corners.get(3)); boundingTetragon.setBottomRight(Corners.get(2)); return boundingTetragon; } catch (Throwable th) { this.bK.releaseFrame(); throw th; } } } private void s() { this.bK.initializeString("
", "DocumentTracker"); r(); } private void r() { this.bK.reset(); this.bK.startup(); this.bK.RunDetection = true; this.bK.RunLocalSearch = false; this.bK.RunBoundaryDetection = true; this.bK.RunDirectionDetection = true; this.bK.RunRecognition = false; } }