1633 lines
62 KiB
Java
1633 lines
62 KiB
Java
package com.pingan.ai;
|
||
|
||
import android.app.Activity;
|
||
import android.content.Context;
|
||
import android.os.Handler;
|
||
import android.os.Looper;
|
||
import android.os.Message;
|
||
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
|
||
import com.pingan.ai.face.common.FixedLinkedList;
|
||
import com.pingan.ai.face.common.PaFaceConstants;
|
||
import com.pingan.ai.face.control.LiveFaceConfig;
|
||
import com.pingan.ai.face.entity.PaFaceDetectFrame;
|
||
import com.pingan.ai.face.entity.PreviewFrame;
|
||
import com.pingan.ai.face.manager.impl.OnPaFaceDetectorListener;
|
||
import com.pingan.ai.face.utils.PaFaceLogger;
|
||
import com.pingan.ai.face.view.AuroraView;
|
||
import java.util.ArrayList;
|
||
import java.util.List;
|
||
import java.util.concurrent.BlockingDeque;
|
||
import java.util.concurrent.LinkedBlockingDeque;
|
||
import java.util.concurrent.TimeUnit;
|
||
import java.util.concurrent.atomic.AtomicBoolean;
|
||
import pingan.ai.paverify.vertify.PFaceDetector;
|
||
|
||
/* loaded from: classes3.dex */
|
||
public class d {
|
||
public static float[] f0 = {0.03f, 0.07f, 0.93f, 0.97f};
|
||
public com.pingan.ai.a B;
|
||
public StringBuilder C;
|
||
public boolean D;
|
||
public int E;
|
||
public int F;
|
||
public int G;
|
||
public int H;
|
||
public int I;
|
||
public int J;
|
||
public int K;
|
||
public boolean M;
|
||
public boolean N;
|
||
public AuroraView O;
|
||
public long V;
|
||
public Context a;
|
||
public OnPaFaceDetectorListener b;
|
||
public h b0;
|
||
public LiveFaceConfig c;
|
||
public j c0;
|
||
public Activity e;
|
||
public i k;
|
||
public o l;
|
||
public f m;
|
||
public k n;
|
||
|
||
/* renamed from: o, reason: collision with root package name */
|
||
public m f6509o;
|
||
public n p;
|
||
public l q;
|
||
public boolean r;
|
||
public boolean s;
|
||
public PaFaceDetectFrame t;
|
||
public PaFaceDetectFrame u;
|
||
public PaFaceDetectFrame v;
|
||
public PaFaceDetectFrame w;
|
||
public PaFaceDetectFrame x;
|
||
public PaFaceDetectFrame y;
|
||
public boolean d = true;
|
||
public BlockingDeque<PreviewFrame> f = null;
|
||
public c g = null;
|
||
public HandlerC0068d h = null;
|
||
public long i = 0;
|
||
public AtomicBoolean j = new AtomicBoolean(false);
|
||
public List<PaFaceDetectFrame> z = new FixedLinkedList(20);
|
||
public boolean A = false;
|
||
public boolean L = true;
|
||
public boolean P = false;
|
||
public int Q = -1;
|
||
public int R = 0;
|
||
public float S = 0.3f;
|
||
public float T = 0.55f;
|
||
public List<Integer> U = new ArrayList(5);
|
||
public int W = 0;
|
||
public boolean X = false;
|
||
public float Y = -1.0f;
|
||
public float Z = -1.0f;
|
||
public int a0 = 0;
|
||
public com.pingan.ai.e d0 = new com.pingan.ai.e();
|
||
public e e0 = new e(this, null);
|
||
|
||
/* loaded from: classes3.dex */
|
||
public class a implements Runnable {
|
||
public final Activity a;
|
||
public final float b;
|
||
|
||
public a(d dVar, Activity activity, float f) {
|
||
this.a = activity;
|
||
this.b = f;
|
||
}
|
||
|
||
@Override // java.lang.Runnable
|
||
public void run() {
|
||
z.a(this.a, this.b);
|
||
}
|
||
}
|
||
|
||
/* loaded from: classes3.dex */
|
||
public class b implements Runnable {
|
||
public final d a;
|
||
|
||
public b(d dVar) {
|
||
this.a = dVar;
|
||
}
|
||
|
||
@Override // java.lang.Runnable
|
||
public void run() {
|
||
if (this.a.O != null) {
|
||
this.a.O.setAuroraViewColor(0);
|
||
}
|
||
}
|
||
}
|
||
|
||
/* renamed from: com.pingan.ai.d$d, reason: collision with other inner class name */
|
||
/* loaded from: classes3.dex */
|
||
public final class HandlerC0068d extends Handler {
|
||
public final d a;
|
||
|
||
@Override // android.os.Handler
|
||
public final void handleMessage(Message message) {
|
||
if (this.a.b == null) {
|
||
return;
|
||
}
|
||
int i = message.what;
|
||
if (i > 1000 && i < 2000) {
|
||
this.a.b.onDetectMotionTips(i);
|
||
this.a.b.onDetectProgress(i, this.a.q != null ? this.a.q.a() : BitmapDescriptorFactory.HUE_RED);
|
||
return;
|
||
}
|
||
if (i > 2000 && i < 3000) {
|
||
this.a.b.onDetectTips(i);
|
||
this.a.b.onDetectTips(i, this.a.t);
|
||
return;
|
||
}
|
||
if (i > 3000 && i < 4000) {
|
||
if (this.a.g != null) {
|
||
this.a.g.b(false);
|
||
}
|
||
if (this.a.h != null) {
|
||
this.a.h.removeCallbacksAndMessages(null);
|
||
this.a.h = null;
|
||
}
|
||
this.a.b.onInterruptError(i);
|
||
this.a.b.onInterruptError(i, this.a.z);
|
||
return;
|
||
}
|
||
if (i <= 4000 || i >= 5000) {
|
||
if (i == 6) {
|
||
this.a.b.onDetectFaceInfo(this.a.K, this.a.t, message.arg1, message.arg2);
|
||
return;
|
||
} else {
|
||
if (i == 5) {
|
||
this.a.b.onDetectMotionDone(this.a.G);
|
||
return;
|
||
}
|
||
return;
|
||
}
|
||
}
|
||
if (i == 4001) {
|
||
if (this.a.g != null) {
|
||
this.a.g.b(false);
|
||
}
|
||
PaFaceDetectFrame[] paFaceDetectFrameArr = {this.a.u, this.a.x, this.a.w, this.a.v, this.a.y};
|
||
if (this.a.h != null) {
|
||
this.a.h.removeCallbacksAndMessages(null);
|
||
this.a.h = null;
|
||
}
|
||
this.a.b.onDetectProgress(i, this.a.q != null ? this.a.q.a() : 1.0f);
|
||
this.a.b.onDetectComplete(i, paFaceDetectFrameArr);
|
||
if (this.a.p != null) {
|
||
this.a.p.e();
|
||
}
|
||
}
|
||
}
|
||
|
||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||
public HandlerC0068d(d dVar, Looper looper) {
|
||
super(looper);
|
||
this.a = dVar;
|
||
}
|
||
}
|
||
|
||
public final native void a(LiveFaceConfig liveFaceConfig);
|
||
|
||
public native void a(OnPaFaceDetectorListener onPaFaceDetectorListener);
|
||
|
||
public native void a(AuroraView auroraView);
|
||
|
||
public native boolean a(Context context, LiveFaceConfig liveFaceConfig);
|
||
|
||
public native void b(LiveFaceConfig liveFaceConfig);
|
||
|
||
/* JADX WARN: Code restructure failed: missing block: B:22:0x0061, code lost:
|
||
|
||
if (r5.g != null) goto L30;
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:23:0x0085, code lost:
|
||
|
||
r5.P = false;
|
||
r5.g = null;
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:24:0x0089, code lost:
|
||
|
||
return;
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:26:0x0082, code lost:
|
||
|
||
c();
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:37:0x0080, code lost:
|
||
|
||
if (r5.g == null) goto L31;
|
||
*/
|
||
/*
|
||
Code decompiled incorrectly, please refer to instructions dump.
|
||
To view partially-correct add '--show-bad-code' argument
|
||
*/
|
||
public void g() {
|
||
/*
|
||
r5 = this;
|
||
java.lang.String r0 = "stopDetect"
|
||
com.pingan.ai.face.utils.PaFaceLogger.i(r0)
|
||
java.lang.StringBuilder r0 = new java.lang.StringBuilder
|
||
r0.<init>()
|
||
java.lang.String r1 = com.pingan.ai.c.a()
|
||
r0.append(r1)
|
||
java.lang.String r1 = " stopDetect"
|
||
r0.append(r1)
|
||
java.lang.String r0 = r0.toString()
|
||
r5.c(r0)
|
||
r0 = 1
|
||
r1 = 0
|
||
r2 = 0
|
||
r5.a(r0) // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
com.pingan.ai.d$c r0 = r5.g // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
if (r0 == 0) goto L37
|
||
com.pingan.ai.d.c.a(r0, r2) // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
com.pingan.ai.d$c r0 = r5.g // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
boolean r0 = r0.isAlive() // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
if (r0 == 0) goto L37
|
||
com.pingan.ai.d$c r0 = r5.g // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
r0.interrupt() // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
L37:
|
||
com.pingan.ai.i r0 = r5.k // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
if (r0 == 0) goto L3e
|
||
r0.a(r2) // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
L3e:
|
||
com.pingan.ai.f r0 = r5.m // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
if (r0 == 0) goto L45
|
||
r0.a(r2) // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
L45:
|
||
com.pingan.ai.d$d r0 = r5.h // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
if (r0 == 0) goto L4e
|
||
r0.removeCallbacksAndMessages(r1) // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
r5.h = r1 // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
L4e:
|
||
java.util.concurrent.BlockingDeque<com.pingan.ai.face.entity.PreviewFrame> r0 = r5.f // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
if (r0 == 0) goto L57
|
||
r0.clear() // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
r5.f = r1 // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
L57:
|
||
r0 = -1082130432(0xffffffffbf800000, float:-1.0)
|
||
r5.a(r0) // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
r5.d() // Catch: java.lang.Throwable -> L64 java.lang.Exception -> L66
|
||
com.pingan.ai.d$c r0 = r5.g
|
||
if (r0 == 0) goto L85
|
||
goto L82
|
||
L64:
|
||
r0 = move-exception
|
||
goto L8a
|
||
L66:
|
||
r0 = move-exception
|
||
java.lang.StringBuilder r3 = new java.lang.StringBuilder // Catch: java.lang.Throwable -> L64
|
||
java.lang.String r4 = "stopDetect throws exception,"
|
||
r3.<init>(r4) // Catch: java.lang.Throwable -> L64
|
||
java.lang.String r4 = "PaFace Detector"
|
||
java.lang.String r0 = r0.getMessage() // Catch: java.lang.Throwable -> L64
|
||
r3.append(r0) // Catch: java.lang.Throwable -> L64
|
||
java.lang.String r0 = r3.toString() // Catch: java.lang.Throwable -> L64
|
||
com.pingan.ai.face.utils.PaFaceLogger.error(r4, r0) // Catch: java.lang.Throwable -> L64
|
||
com.pingan.ai.d$c r0 = r5.g
|
||
if (r0 == 0) goto L85
|
||
L82:
|
||
r5.c()
|
||
L85:
|
||
r5.P = r2
|
||
r5.g = r1
|
||
return
|
||
L8a:
|
||
com.pingan.ai.d$c r3 = r5.g
|
||
if (r3 == 0) goto L91
|
||
r5.c()
|
||
L91:
|
||
r5.P = r2
|
||
r5.g = r1
|
||
throw r0
|
||
*/
|
||
throw new UnsupportedOperationException("Method not decompiled: com.pingan.ai.d.g():void");
|
||
}
|
||
|
||
public void f() {
|
||
LiveFaceConfig liveFaceConfig;
|
||
float f;
|
||
a(0.8f);
|
||
boolean z = this.N && this.O != null;
|
||
this.M = z;
|
||
if (z) {
|
||
this.c.setFaceFarThr(this.S + 0.15f);
|
||
liveFaceConfig = this.c;
|
||
f = this.T + 0.3f;
|
||
} else {
|
||
this.c.setFaceFarThr(this.S);
|
||
liveFaceConfig = this.c;
|
||
f = this.T;
|
||
}
|
||
liveFaceConfig.setFaceCloseThr(f);
|
||
n nVar = this.p;
|
||
if (nVar != null) {
|
||
nVar.a(this.M);
|
||
}
|
||
this.a0 = 0;
|
||
this.P = false;
|
||
this.z.clear();
|
||
a(false);
|
||
if (this.g == null) {
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" new DetectionThread");
|
||
c(sb.toString());
|
||
this.g = new c(this, null);
|
||
}
|
||
if (this.f == null) {
|
||
this.f = new LinkedBlockingDeque(1);
|
||
}
|
||
if (this.h == null) {
|
||
this.h = new HandlerC0068d(this, Looper.getMainLooper());
|
||
}
|
||
this.g.b(true);
|
||
this.g.start();
|
||
StringBuilder sb2 = new StringBuilder();
|
||
sb2.append(com.pingan.ai.c.a());
|
||
sb2.append(" startFaceDetect");
|
||
c(sb2.toString());
|
||
}
|
||
|
||
public final void e() {
|
||
PFaceDetector.FaceConfig faceConfig = new PFaceDetector.FaceConfig();
|
||
faceConfig.liveThreshold100 = 0.17527d;
|
||
faceConfig.liveThreshold1000 = 0.77133d;
|
||
faceConfig.liveThreshold10000 = 0.93352d;
|
||
faceConfig.trackingMode = true;
|
||
faceConfig.detectFaceMinScale = 0.10000000149011612d;
|
||
faceConfig.detectFaceMaxScale = 0.30000001192092896d;
|
||
faceConfig.usePyramid = true;
|
||
PFaceDetector.setConfig(faceConfig);
|
||
}
|
||
|
||
public void d(String str) {
|
||
StringBuilder sb = new StringBuilder("PAFaceSDK-Time-");
|
||
sb.append(str);
|
||
sb.append("\r\n");
|
||
b(sb.toString());
|
||
}
|
||
|
||
public final void d() {
|
||
AuroraView auroraView = this.O;
|
||
if (auroraView != null) {
|
||
auroraView.post(new b(this));
|
||
}
|
||
}
|
||
|
||
public void c(boolean z) {
|
||
this.c.setGravitySwitch(z);
|
||
}
|
||
|
||
public void c(String str) {
|
||
StringBuilder sb = new StringBuilder("PAFaceSDK-Log-");
|
||
sb.append(str);
|
||
sb.append("\r\n");
|
||
b(sb.toString());
|
||
}
|
||
|
||
public void c(int i) {
|
||
if (i != -1) {
|
||
long currentTimeMillis = System.currentTimeMillis();
|
||
if (currentTimeMillis - this.i > 750) {
|
||
n nVar = this.p;
|
||
if (nVar != null) {
|
||
nVar.a(i);
|
||
}
|
||
this.e0.b(i);
|
||
this.i = currentTimeMillis;
|
||
}
|
||
}
|
||
}
|
||
|
||
public final void c() {
|
||
StringBuilder sb;
|
||
if (!this.A || (sb = this.C) == null || sb.toString().equals("")) {
|
||
return;
|
||
}
|
||
com.pingan.ai.a aVar = this.B;
|
||
aVar.a(aVar.a(), this.C.toString(), this.c);
|
||
StringBuilder sb2 = this.C;
|
||
sb2.delete(0, sb2.length());
|
||
}
|
||
|
||
public boolean b() {
|
||
return this.P;
|
||
}
|
||
|
||
public final void b(boolean z) {
|
||
this.j.set(z);
|
||
this.d0.c();
|
||
}
|
||
|
||
public final void b(String str) {
|
||
StringBuilder sb;
|
||
if (!this.A || this.B == null || (sb = this.C) == null) {
|
||
return;
|
||
}
|
||
sb.append(str);
|
||
}
|
||
|
||
public void b(int i) {
|
||
n nVar = this.p;
|
||
if (nVar != null) {
|
||
nVar.a(i);
|
||
}
|
||
if (this.h != null) {
|
||
this.e0.a = i;
|
||
this.h.sendEmptyMessage(i);
|
||
}
|
||
}
|
||
|
||
public void a(boolean z) {
|
||
h hVar = this.b0;
|
||
if (hVar != null) {
|
||
hVar.h();
|
||
this.e0.a();
|
||
}
|
||
b(z);
|
||
l lVar = this.q;
|
||
if (lVar != null) {
|
||
lVar.a(this.p);
|
||
}
|
||
this.s = false;
|
||
o oVar = this.l;
|
||
if (oVar != null) {
|
||
oVar.m();
|
||
}
|
||
this.u = null;
|
||
this.x = null;
|
||
this.w = null;
|
||
this.v = null;
|
||
this.y = null;
|
||
m mVar = this.f6509o;
|
||
if (mVar != null) {
|
||
mVar.g();
|
||
}
|
||
this.E = 0;
|
||
this.W = 0;
|
||
this.Q = -1;
|
||
this.R = 0;
|
||
}
|
||
|
||
public void a(List<Integer> list) {
|
||
this.U.clear();
|
||
this.L = true;
|
||
int i = 0;
|
||
this.M = false;
|
||
this.N = false;
|
||
if (list != null && !list.isEmpty()) {
|
||
for (Integer num : list) {
|
||
if (1002 == num.intValue() || 1003 == num.intValue() || 1004 == num.intValue() || 1005 == num.intValue()) {
|
||
this.U.add(num);
|
||
} else if (1006 == num.intValue() && !this.U.contains(Integer.valueOf(PaFaceConstants.MotionType.AURORA))) {
|
||
this.U.add(num);
|
||
this.N = true;
|
||
}
|
||
i++;
|
||
}
|
||
}
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" setMotions,size:");
|
||
sb.append(this.U.size());
|
||
sb.append(",elements:");
|
||
sb.append(this.U.toString());
|
||
c(sb.toString());
|
||
StringBuilder sb2 = new StringBuilder("setMotions,size:");
|
||
sb2.append(this.U.size());
|
||
sb2.append(",elements:");
|
||
sb2.append(this.U.toString());
|
||
PaFaceLogger.i(PaFaceLogger.TAG, sb2.toString());
|
||
n nVar = this.p;
|
||
if (nVar != null) {
|
||
nVar.a(this.U);
|
||
}
|
||
m mVar = this.f6509o;
|
||
if (mVar != null) {
|
||
mVar.a(i);
|
||
}
|
||
}
|
||
|
||
public void a(String str) {
|
||
StringBuilder sb = new StringBuilder("PAFaceSDK-Error-");
|
||
sb.append(str);
|
||
sb.append("\r\n");
|
||
b(sb.toString());
|
||
}
|
||
|
||
public final void a(Context context, boolean z) {
|
||
this.A = z;
|
||
if (z) {
|
||
com.pingan.ai.a c2 = com.pingan.ai.a.c();
|
||
this.B = c2;
|
||
c2.a(context);
|
||
if (this.C == null) {
|
||
this.C = this.B.b();
|
||
}
|
||
}
|
||
}
|
||
|
||
public void a(Activity activity, boolean z) {
|
||
this.e = activity;
|
||
this.d = z;
|
||
}
|
||
|
||
public void a(int i, byte[] bArr, int i2, int i3, int i4, int i5) {
|
||
this.H = i5;
|
||
this.I = i4;
|
||
this.J = i3;
|
||
PreviewFrame obtain = PreviewFrame.obtain(i, bArr, i2, i3, i4, i5);
|
||
if (this.f == null || this.j.get()) {
|
||
return;
|
||
}
|
||
this.f.offer(obtain);
|
||
}
|
||
|
||
public final void a(float f) {
|
||
if (this.d) {
|
||
Activity activity = this.e;
|
||
if (activity != null || (this.a instanceof Activity)) {
|
||
if (activity == null) {
|
||
activity = (Activity) this.a;
|
||
}
|
||
activity.runOnUiThread(new a(this, activity, f));
|
||
}
|
||
}
|
||
}
|
||
|
||
public void a() {
|
||
if (this.b != null) {
|
||
this.b = null;
|
||
}
|
||
j jVar = this.c0;
|
||
if (jVar != null) {
|
||
jVar.b();
|
||
this.c0 = null;
|
||
}
|
||
n nVar = this.p;
|
||
if (nVar != null) {
|
||
nVar.e();
|
||
this.p = null;
|
||
}
|
||
this.q = null;
|
||
this.b0 = null;
|
||
if (this.r) {
|
||
PFaceDetector.nativeDestroy();
|
||
}
|
||
this.r = false;
|
||
this.O = null;
|
||
this.a = null;
|
||
this.e = null;
|
||
this.U.clear();
|
||
this.z.clear();
|
||
i iVar = this.k;
|
||
if (iVar != null) {
|
||
iVar.a(true);
|
||
this.k = null;
|
||
}
|
||
f fVar = this.m;
|
||
if (fVar != null) {
|
||
fVar.a(true);
|
||
this.m = null;
|
||
}
|
||
this.n = null;
|
||
this.f6509o = null;
|
||
this.L = true;
|
||
this.M = false;
|
||
this.N = false;
|
||
PaFaceLogger.i("deInit");
|
||
}
|
||
|
||
public int a(int i) {
|
||
int a2 = this.e0.a(i);
|
||
if (a2 != -1) {
|
||
this.e0.a = a2;
|
||
}
|
||
return a2;
|
||
}
|
||
|
||
public static /* synthetic */ int r(d dVar) {
|
||
int i = dVar.W;
|
||
dVar.W = i + 1;
|
||
return i;
|
||
}
|
||
|
||
/* loaded from: classes3.dex */
|
||
public final class c extends Thread {
|
||
public volatile boolean a;
|
||
public PFaceDetector.AceFaceInfo[] b;
|
||
public final d c;
|
||
|
||
public final native PaFaceDetectFrame a(PreviewFrame previewFrame, String str);
|
||
|
||
public final native void a(PreviewFrame previewFrame);
|
||
|
||
public final native PFaceDetector.AceFaceInfo[] b(PreviewFrame previewFrame);
|
||
|
||
public final native boolean c(PreviewFrame previewFrame);
|
||
|
||
public final native boolean d(PreviewFrame previewFrame);
|
||
|
||
public final native boolean e(PreviewFrame previewFrame);
|
||
|
||
public final native boolean f(PreviewFrame previewFrame);
|
||
|
||
public final native boolean g(PreviewFrame previewFrame);
|
||
|
||
public final native boolean h(PreviewFrame previewFrame);
|
||
|
||
@Override // java.lang.Thread, java.lang.Runnable
|
||
public final void run() {
|
||
synchronized (this) {
|
||
int i = 0;
|
||
try {
|
||
try {
|
||
d dVar = this.c;
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" DETECT CONSUMER");
|
||
dVar.c(sb.toString());
|
||
PaFaceLogger.i(PaFaceLogger.TAG, "detect thread is running.");
|
||
while (this.a) {
|
||
PreviewFrame previewFrame = (PreviewFrame) this.c.f.poll(200L, TimeUnit.MILLISECONDS);
|
||
if (previewFrame != null) {
|
||
a(previewFrame);
|
||
this.c.e0.a(previewFrame);
|
||
previewFrame.recycle();
|
||
}
|
||
}
|
||
while (true) {
|
||
PFaceDetector.AceFaceInfo[] aceFaceInfoArr = this.b;
|
||
if (aceFaceInfoArr == null || i >= aceFaceInfoArr.length) {
|
||
break;
|
||
}
|
||
aceFaceInfoArr[i] = null;
|
||
i++;
|
||
}
|
||
} catch (Exception e) {
|
||
d dVar2 = this.c;
|
||
StringBuilder sb2 = new StringBuilder();
|
||
sb2.append("DetectException:");
|
||
sb2.append(e.getMessage());
|
||
dVar2.a(sb2.toString());
|
||
StringBuilder sb3 = new StringBuilder();
|
||
sb3.append("detect thread throw exception,");
|
||
sb3.append(e.getMessage());
|
||
PaFaceLogger.error(PaFaceLogger.TAG, sb3.toString());
|
||
while (true) {
|
||
PFaceDetector.AceFaceInfo[] aceFaceInfoArr2 = this.b;
|
||
if (aceFaceInfoArr2 == null || i >= aceFaceInfoArr2.length) {
|
||
break;
|
||
}
|
||
aceFaceInfoArr2[i] = null;
|
||
i++;
|
||
}
|
||
}
|
||
this.b = null;
|
||
} catch (Throwable th) {
|
||
while (true) {
|
||
PFaceDetector.AceFaceInfo[] aceFaceInfoArr3 = this.b;
|
||
if (aceFaceInfoArr3 == null || i >= aceFaceInfoArr3.length) {
|
||
break;
|
||
}
|
||
aceFaceInfoArr3[i] = null;
|
||
i++;
|
||
}
|
||
this.b = null;
|
||
throw th;
|
||
}
|
||
}
|
||
}
|
||
|
||
public final void j() {
|
||
PaFaceDetectFrame paFaceDetectFrame;
|
||
try {
|
||
paFaceDetectFrame = (PaFaceDetectFrame) this.c.t.clone();
|
||
} catch (Exception e) {
|
||
StringBuilder sb = new StringBuilder("clone another frame failed:");
|
||
sb.append(e.getMessage());
|
||
PaFaceLogger.error(sb.toString());
|
||
paFaceDetectFrame = null;
|
||
}
|
||
if (this.c.k != null) {
|
||
this.c.k.a(paFaceDetectFrame);
|
||
}
|
||
if (this.c.m == null || !this.c.b0.f()) {
|
||
return;
|
||
}
|
||
this.c.m.a(paFaceDetectFrame);
|
||
}
|
||
|
||
public final boolean i() {
|
||
long currentTimeMillis = System.currentTimeMillis();
|
||
float[] a = a();
|
||
long currentTimeMillis2 = System.currentTimeMillis() - currentTimeMillis;
|
||
this.c.d("Occ: ".concat(String.valueOf(currentTimeMillis2)));
|
||
PaFaceLogger.i("atomic checkOcc use time: ".concat(String.valueOf(currentTimeMillis2)));
|
||
StringBuilder sb = new StringBuilder("check Occ,");
|
||
sb.append(a[1]);
|
||
sb.append(";");
|
||
sb.append(a[2]);
|
||
sb.append(";");
|
||
sb.append(a[3]);
|
||
sb.append(";");
|
||
sb.append(a[7]);
|
||
sb.append(";");
|
||
sb.append(a[8]);
|
||
PaFaceLogger.i(sb.toString());
|
||
if (a[1] > x.j(this.c.c)) {
|
||
this.c.c(this.c.a(PaFaceConstants.EnvironmentalTips.COVER_MOUTH));
|
||
PaFaceLogger.error(PaFaceLogger.TAG, "COVER_MOUTH");
|
||
return true;
|
||
}
|
||
if (a[2] > x.e(this.c.c) || a[3] > x.e(this.c.c)) {
|
||
this.c.c(this.c.a(PaFaceConstants.EnvironmentalTips.COVER_EYE));
|
||
PaFaceLogger.error(PaFaceLogger.TAG, "COVER_EYE");
|
||
return true;
|
||
}
|
||
if (a[7] > x.f(this.c.c)) {
|
||
this.c.c(this.c.a(2020));
|
||
PaFaceLogger.error(PaFaceLogger.TAG, "COVER_FACE");
|
||
return true;
|
||
}
|
||
if (a[8] <= x.f(this.c.c)) {
|
||
return false;
|
||
}
|
||
this.c.c(this.c.a(2020));
|
||
PaFaceLogger.error(PaFaceLogger.TAG, "COVER_FACE");
|
||
return true;
|
||
}
|
||
|
||
public final boolean h() {
|
||
if (this.c.Y != -1.0f && this.c.Z != -1.0f) {
|
||
float f = this.c.t.landmarkPosition[222];
|
||
float f2 = this.c.t.landmarkPosition[223];
|
||
float a = u.a(this.c.Y, this.c.Z, f, f2);
|
||
float f3 = this.c.t.frameWidth * 0.04f;
|
||
if (a > f3) {
|
||
d dVar = this.c;
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" d=");
|
||
sb.append(a);
|
||
sb.append(" ; maxRange=");
|
||
sb.append(f3);
|
||
dVar.c(sb.toString());
|
||
StringBuilder sb2 = new StringBuilder("NOSE_SHAKE d=");
|
||
sb2.append(a);
|
||
sb2.append(" ; maxRange=");
|
||
sb2.append(f3);
|
||
PaFaceLogger.error(sb2.toString());
|
||
this.c.Y = f;
|
||
this.c.Z = f2;
|
||
return true;
|
||
}
|
||
}
|
||
d dVar2 = this.c;
|
||
dVar2.Y = dVar2.t.landmarkPosition[222];
|
||
d dVar3 = this.c;
|
||
dVar3.Z = dVar3.t.landmarkPosition[223];
|
||
return false;
|
||
}
|
||
|
||
public final boolean g() {
|
||
if (this.c.b0.c()[4] > x.p(this.c.c) || this.c.b0.c()[5] > x.p(this.c.c)) {
|
||
this.c.b0.l = true;
|
||
d dVar = this.c;
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" eyes:activeEyeAction");
|
||
dVar.c(sb.toString());
|
||
}
|
||
if (!this.c.b0.l) {
|
||
this.c.b0.s = false;
|
||
this.c.b0.i.clear();
|
||
this.c.b0.j.clear();
|
||
} else {
|
||
float a = u.a(this.c.b0.i);
|
||
float b = u.b(this.c.b0.i);
|
||
float a2 = u.a(this.c.b0.j);
|
||
float b2 = u.b(this.c.b0.j);
|
||
d dVar2 = this.c;
|
||
StringBuilder sb2 = new StringBuilder();
|
||
sb2.append(com.pingan.ai.c.a());
|
||
sb2.append(" eyesInfoTrends:left eyeScore:");
|
||
sb2.append(this.c.b0.c()[4]);
|
||
sb2.append(" ; right eyeScore:");
|
||
sb2.append(this.c.b0.c()[5]);
|
||
dVar2.c(sb2.toString());
|
||
StringBuilder sb3 = new StringBuilder("eyesInfoTrends:left eyeScore:");
|
||
sb3.append(this.c.b0.c()[4]);
|
||
sb3.append(" ; right eyeScore:");
|
||
sb3.append(this.c.b0.c()[5]);
|
||
sb3.append(", leftD=");
|
||
sb3.append(a - b);
|
||
sb3.append(",rightD=");
|
||
sb3.append(a2 - b2);
|
||
PaFaceLogger.i(PaFaceLogger.TAG, sb3.toString());
|
||
if (this.c.b0.c()[4] < x.c(this.c.c) && this.c.b0.c()[5] < x.c(this.c.c) && !this.c.b0.s) {
|
||
this.c.b0.s = true;
|
||
StringBuilder sb4 = new StringBuilder("eyesInfoTrends:mIsCloseEye:");
|
||
sb4.append(this.c.b0.s);
|
||
PaFaceLogger.i(PaFaceLogger.TAG, sb4.toString());
|
||
}
|
||
}
|
||
if (this.c.b0.s) {
|
||
float a3 = u.a(this.c.b0.i);
|
||
float b3 = u.b(this.c.b0.i);
|
||
float a4 = u.a(this.c.b0.j);
|
||
float b4 = u.b(this.c.b0.j);
|
||
if (a3 - b3 > x.o(this.c.c) && a4 - b4 > x.o(this.c.c) && !this.c.b0.s) {
|
||
this.c.b0.t = true;
|
||
d dVar3 = this.c;
|
||
StringBuilder sb5 = new StringBuilder();
|
||
sb5.append(com.pingan.ai.c.a());
|
||
sb5.append(" eyesInfoTrends:mIsCloseEye:");
|
||
sb5.append(this.c.b0.t);
|
||
dVar3.c(sb5.toString());
|
||
StringBuilder sb6 = new StringBuilder("eyesInfoTrends:mIsOpenEye:");
|
||
sb6.append(this.c.b0.t);
|
||
PaFaceLogger.i(PaFaceLogger.TAG, sb6.toString());
|
||
this.c.b0.e();
|
||
}
|
||
}
|
||
if (this.c.b0.t && this.c.b0.s) {
|
||
return true;
|
||
}
|
||
PaFaceLogger.error(PaFaceLogger.TAG, "lmk blink eye not pass.");
|
||
return false;
|
||
}
|
||
|
||
public final boolean f() {
|
||
StringBuilder sb;
|
||
float f;
|
||
long currentTimeMillis = System.currentTimeMillis();
|
||
float[] nativeGetPose = PFaceDetector.nativeGetPose();
|
||
this.c.t.yaw = nativeGetPose[0];
|
||
this.c.t.roll = nativeGetPose[1];
|
||
this.c.t.pitch = nativeGetPose[2];
|
||
long currentTimeMillis2 = System.currentTimeMillis() - currentTimeMillis;
|
||
this.c.d("Pose: ".concat(String.valueOf(currentTimeMillis2)));
|
||
PaFaceLogger.i("atomic get pose use time: ".concat(String.valueOf(currentTimeMillis2)));
|
||
if (this.c.t.yaw < (-this.c.c.getYawThr())) {
|
||
this.c.c(this.c.a(PaFaceConstants.EnvironmentalTips.FACE_YAW_RIGHT));
|
||
d dVar = this.c;
|
||
StringBuilder sb2 = new StringBuilder("FaceYawRight:");
|
||
sb2.append(com.pingan.ai.c.a());
|
||
sb2.append(" errorFace:yawRight,yaw=");
|
||
sb2.append(this.c.t.yaw);
|
||
dVar.a(sb2.toString());
|
||
sb = new StringBuilder("FACE_YAW_RIGHT detect normal face yaw=");
|
||
} else if (this.c.t.yaw > this.c.c.getYawThr()) {
|
||
this.c.c(this.c.a(2005));
|
||
d dVar2 = this.c;
|
||
StringBuilder sb3 = new StringBuilder("FaceYawLeft:");
|
||
sb3.append(com.pingan.ai.c.a());
|
||
sb3.append(" errorFace:yawLeft,yaw=");
|
||
sb3.append(this.c.t.yaw);
|
||
dVar2.a(sb3.toString());
|
||
sb = new StringBuilder("FACE_YAW_LEFT detect normal face yaw=");
|
||
} else {
|
||
if (this.c.t.roll < (-this.c.c.getRollThr())) {
|
||
this.c.c(this.c.a(2008));
|
||
d dVar3 = this.c;
|
||
StringBuilder sb4 = new StringBuilder("FaceRollRight:");
|
||
sb4.append(com.pingan.ai.c.a());
|
||
sb4.append(" errorFace:rollLeft,roll=");
|
||
sb4.append(this.c.t.roll);
|
||
dVar3.a(sb4.toString());
|
||
sb = new StringBuilder("FACE_ROLL_RIGHT detect normal face roll=");
|
||
} else if (this.c.t.roll > this.c.c.getRollThr()) {
|
||
this.c.c(this.c.a(2007));
|
||
d dVar4 = this.c;
|
||
StringBuilder sb5 = new StringBuilder("FaceRollLeft:");
|
||
sb5.append(com.pingan.ai.c.a());
|
||
sb5.append(" errorFace:rollRight,roll=");
|
||
sb5.append(this.c.t.roll);
|
||
dVar4.a(sb5.toString());
|
||
sb = new StringBuilder("FACE_ROLL_LEFT detect normal face roll=");
|
||
} else {
|
||
if (this.c.t.pitch < (-this.c.c.getPitchThr())) {
|
||
this.c.c(this.c.a(2009));
|
||
d dVar5 = this.c;
|
||
StringBuilder sb6 = new StringBuilder("FacePitchUp:");
|
||
sb6.append(com.pingan.ai.c.a());
|
||
sb6.append(" errorFace:pitchUp,pitch=");
|
||
sb6.append(this.c.t.pitch);
|
||
dVar5.a(sb6.toString());
|
||
sb = new StringBuilder("FACE_PITCH_UP detect normal face pitch=");
|
||
} else {
|
||
if (this.c.t.pitch <= this.c.c.getPitchThr()) {
|
||
return true;
|
||
}
|
||
this.c.c(this.c.a(2010));
|
||
d dVar6 = this.c;
|
||
StringBuilder sb7 = new StringBuilder("FacePitchDown:");
|
||
sb7.append(com.pingan.ai.c.a());
|
||
sb7.append(" errorFace:pitchDown,pitch=");
|
||
sb7.append(this.c.t.pitch);
|
||
dVar6.a(sb7.toString());
|
||
sb = new StringBuilder("FACE_PITCH_DOWN detect normal face pitch=");
|
||
}
|
||
f = this.c.t.pitch;
|
||
sb.append(f);
|
||
PaFaceLogger.error(sb.toString());
|
||
return false;
|
||
}
|
||
f = this.c.t.roll;
|
||
sb.append(f);
|
||
PaFaceLogger.error(sb.toString());
|
||
return false;
|
||
}
|
||
f = this.c.t.yaw;
|
||
sb.append(f);
|
||
PaFaceLogger.error(sb.toString());
|
||
return false;
|
||
}
|
||
|
||
public final boolean e() {
|
||
long currentTimeMillis = System.currentTimeMillis();
|
||
float[] nativeActionEyes = PFaceDetector.nativeActionEyes();
|
||
long currentTimeMillis2 = System.currentTimeMillis() - currentTimeMillis;
|
||
this.c.d("NativeDetectEye:".concat(String.valueOf(currentTimeMillis2)));
|
||
PaFaceLogger.i("atomic nativeActionEyes use time:".concat(String.valueOf(currentTimeMillis2)));
|
||
if (nativeActionEyes[0] <= x.b(this.c.c) && nativeActionEyes[1] <= x.b(this.c.c)) {
|
||
return false;
|
||
}
|
||
this.c.c(this.c.a(PaFaceConstants.EnvironmentalTips.EYE_CLOSE_ERROR));
|
||
PaFaceLogger.error(PaFaceLogger.TAG, "detect normal face,EYE_CLOSE_ERROR");
|
||
d dVar = this.c;
|
||
StringBuilder sb = new StringBuilder("EyeCloseError:");
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" detect normal face wrong.");
|
||
dVar.a(sb.toString());
|
||
return true;
|
||
}
|
||
|
||
public final boolean d() {
|
||
float[] nativeActionEyes = PFaceDetector.nativeActionEyes();
|
||
return a(nativeActionEyes[0], nativeActionEyes[1]) || g();
|
||
}
|
||
|
||
public final void c() {
|
||
a(true);
|
||
}
|
||
|
||
public final boolean b(String str) {
|
||
boolean z;
|
||
if (this.c.a0 > 0) {
|
||
d.C(this.c);
|
||
d dVar = this.c;
|
||
StringBuilder sb = new StringBuilder("MultiFace:");
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" errorFace:multiFace,faceLastNum:");
|
||
sb.append(this.c.a0);
|
||
dVar.a(sb.toString());
|
||
StringBuilder sb2 = new StringBuilder("MULTI_FACE ");
|
||
sb2.append(str);
|
||
sb2.append(" faceLastNum = ");
|
||
sb2.append(this.c.a0);
|
||
PaFaceLogger.error(sb2.toString());
|
||
if (this.c.a0 < 6) {
|
||
return false;
|
||
}
|
||
this.c.a0 = 0;
|
||
}
|
||
if (this.c.t.faceNum <= 0) {
|
||
StringBuilder sb3 = new StringBuilder("NO_FACE featureAttack ");
|
||
sb3.append(str);
|
||
sb3.append(" faceNum=");
|
||
sb3.append(this.c.t.faceNum);
|
||
sb3.append("; pre hasNormalFace = ");
|
||
sb3.append(this.c.s);
|
||
PaFaceLogger.error(sb3.toString());
|
||
boolean z2 = this.c.s || (this.c.f6509o != null && this.c.f6509o.c());
|
||
if (x.y(this.c.c) || !z2) {
|
||
this.c.c(this.c.a(2002));
|
||
d dVar2 = this.c;
|
||
StringBuilder sb4 = new StringBuilder("NoFace:");
|
||
sb4.append(com.pingan.ai.c.a());
|
||
sb4.append(" noFace faceInfo.faceNum : ");
|
||
sb4.append(this.c.t.faceNum);
|
||
dVar2.a(sb4.toString());
|
||
StringBuilder sb5 = new StringBuilder("NO_FACE ");
|
||
sb5.append(str);
|
||
sb5.append(" faceNum=");
|
||
sb5.append(this.c.t.faceNum);
|
||
PaFaceLogger.error(sb5.toString());
|
||
} else {
|
||
this.c.b(3003);
|
||
d dVar3 = this.c;
|
||
StringBuilder sb6 = new StringBuilder("TrackingError:");
|
||
sb6.append(com.pingan.ai.c.a());
|
||
sb6.append("errorLoseFace:noFace faceInfo.faceNum : ");
|
||
sb6.append(this.c.t.faceNum);
|
||
dVar3.a(sb6.toString());
|
||
StringBuilder sb7 = new StringBuilder("NO_FACE featureAttack ");
|
||
sb7.append(str);
|
||
sb7.append(",faceNum=");
|
||
sb7.append(this.c.t.faceNum);
|
||
PaFaceLogger.error(sb7.toString());
|
||
this.c.a(true);
|
||
}
|
||
this.c.D = false;
|
||
return false;
|
||
}
|
||
if (this.c.t.faceNum > 1) {
|
||
String str2 = "";
|
||
for (int i = 1; i < this.c.t.faceNum; i++) {
|
||
try {
|
||
int i2 = this.b[i].right - this.b[i].left;
|
||
int i3 = this.b[i].bottom - this.b[i].top;
|
||
StringBuilder sb8 = new StringBuilder();
|
||
sb8.append(" faceInfo[");
|
||
sb8.append(i);
|
||
sb8.append("] width : ");
|
||
sb8.append(i2);
|
||
sb8.append(" ; faceInfo[");
|
||
sb8.append(i);
|
||
sb8.append("] height : ");
|
||
sb8.append(i3);
|
||
str2 = sb8.toString();
|
||
d dVar4 = this.c;
|
||
StringBuilder sb9 = new StringBuilder();
|
||
sb9.append(com.pingan.ai.c.a());
|
||
sb9.append(str2);
|
||
dVar4.c(sb9.toString());
|
||
if (i2 * i3 > this.c.c.getMinFaceThr()) {
|
||
z = true;
|
||
break;
|
||
}
|
||
} catch (Exception e) {
|
||
StringBuilder sb10 = new StringBuilder("MULTI_FACE throws exception,");
|
||
sb10.append(e.getMessage());
|
||
PaFaceLogger.error(PaFaceLogger.TAG, sb10.toString());
|
||
d dVar5 = this.c;
|
||
StringBuilder sb11 = new StringBuilder("Exception:");
|
||
sb11.append(com.pingan.ai.c.a());
|
||
sb11.append("MULTI_FACE throws exception,");
|
||
sb11.append(e.getMessage());
|
||
dVar5.a(sb11.toString());
|
||
}
|
||
}
|
||
z = false;
|
||
StringBuilder sb12 = new StringBuilder("MULTI_FACE ");
|
||
sb12.append(str);
|
||
sb12.append(" multiInfo = ");
|
||
sb12.append(str2);
|
||
PaFaceLogger.i(sb12.toString());
|
||
if (z) {
|
||
this.c.a0 = 1;
|
||
this.c.c(this.c.a(2003));
|
||
d dVar6 = this.c;
|
||
StringBuilder sb13 = new StringBuilder("MultiFace:");
|
||
sb13.append(com.pingan.ai.c.a());
|
||
sb13.append(" errorFace:multiFace,faceNum:");
|
||
sb13.append(this.c.t.faceNum);
|
||
dVar6.a(sb13.toString());
|
||
StringBuilder sb14 = new StringBuilder("MULTI_FACE ");
|
||
sb14.append(str);
|
||
sb14.append(" faceNum = ");
|
||
sb14.append(this.c.t.faceNum);
|
||
PaFaceLogger.error(sb14.toString());
|
||
return false;
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
|
||
public final boolean b() {
|
||
if (this.c.f6509o == null || this.c.f6509o.d()) {
|
||
return false;
|
||
}
|
||
if (e()) {
|
||
return true;
|
||
}
|
||
return this.c.f6509o.e();
|
||
}
|
||
|
||
public final void b(boolean z) {
|
||
this.a = z;
|
||
}
|
||
|
||
public final float[] a() {
|
||
float[] nativeOcc = PFaceDetector.nativeOcc();
|
||
float f = nativeOcc[0];
|
||
if (f != BitmapDescriptorFactory.HUE_RED || nativeOcc[1] != BitmapDescriptorFactory.HUE_RED || nativeOcc[2] != BitmapDescriptorFactory.HUE_RED || nativeOcc[3] != BitmapDescriptorFactory.HUE_RED || nativeOcc[4] != BitmapDescriptorFactory.HUE_RED || nativeOcc[5] != BitmapDescriptorFactory.HUE_RED) {
|
||
nativeOcc[0] = 1.0f - f;
|
||
nativeOcc[5] = 1.0f - nativeOcc[5];
|
||
}
|
||
return nativeOcc;
|
||
}
|
||
|
||
public final boolean a(PFaceDetector.AceFaceInfo[] aceFaceInfoArr, String str) {
|
||
int i;
|
||
int i2;
|
||
int i3;
|
||
String str2;
|
||
StringBuilder sb;
|
||
float f;
|
||
if (this.c.J % 90 != 0) {
|
||
i = this.c.H;
|
||
} else {
|
||
i = this.c.I;
|
||
}
|
||
if (this.c.J % 90 == 0) {
|
||
i2 = this.c.H;
|
||
} else {
|
||
i2 = this.c.I;
|
||
}
|
||
float f2 = this.c.t.rectW;
|
||
if (this.c.H < this.c.I) {
|
||
i3 = this.c.H;
|
||
} else {
|
||
i3 = this.c.I;
|
||
}
|
||
float f3 = f2 / i3;
|
||
if (f3 < this.c.c.getFaceFarThr()) {
|
||
this.c.c(this.c.a(2015));
|
||
d dVar = this.c;
|
||
StringBuilder sb2 = new StringBuilder("TooFar:");
|
||
sb2.append(com.pingan.ai.c.a());
|
||
sb2.append(" errorFace:tooFar,scale=");
|
||
sb2.append(f3);
|
||
sb2.append(",frameWidth=");
|
||
sb2.append(this.c.t.frameWidth);
|
||
sb2.append(",frameHeight=");
|
||
sb2.append(this.c.t.frameHeight);
|
||
dVar.a(sb2.toString());
|
||
sb = new StringBuilder("TOO_FAR ");
|
||
} else {
|
||
if (f3 <= this.c.c.getFaceCloseThr()) {
|
||
if (!"detect head".equalsIgnoreCase(str) && !"detect nod head".equalsIgnoreCase(str)) {
|
||
float abs = (Math.abs(aceFaceInfoArr[0].left + aceFaceInfoArr[0].right) / 2.0f) - (i / 2);
|
||
float abs2 = (Math.abs(aceFaceInfoArr[0].top + aceFaceInfoArr[0].bottom) / 2.0f) - (i2 / 2);
|
||
int sqrt = (int) Math.sqrt((abs * abs) + (abs2 * abs2));
|
||
if (sqrt > this.c.c.getFaceCenterThr()) {
|
||
this.c.c(this.c.a(2004));
|
||
d dVar2 = this.c;
|
||
StringBuilder sb3 = new StringBuilder("FaceNoCenter:");
|
||
sb3.append(com.pingan.ai.c.a());
|
||
sb3.append(" errorFace:noFace distance shake : ");
|
||
sb3.append(sqrt);
|
||
dVar2.a(sb3.toString());
|
||
d dVar3 = this.c;
|
||
StringBuilder sb4 = new StringBuilder();
|
||
sb4.append(com.pingan.ai.c.a());
|
||
sb4.append(" errorFace:noFace : ");
|
||
sb4.append(aceFaceInfoArr[0].left);
|
||
sb4.append(" ; ");
|
||
sb4.append(aceFaceInfoArr[0].top);
|
||
sb4.append(" ; ");
|
||
sb4.append(aceFaceInfoArr[0].right);
|
||
sb4.append(";");
|
||
sb4.append(aceFaceInfoArr[0].bottom);
|
||
dVar3.c(sb4.toString());
|
||
sb = new StringBuilder("CENTER NO_FACE lower threshold,faceNum=");
|
||
sb.append(this.c.t.faceNum);
|
||
sb.append(", distance=");
|
||
sb.append(sqrt);
|
||
str2 = sb.toString();
|
||
PaFaceLogger.error(str2);
|
||
return false;
|
||
}
|
||
}
|
||
float f4 = i;
|
||
if (aceFaceInfoArr[0].left >= d.f0[0] * f4) {
|
||
float f5 = i2;
|
||
if (aceFaceInfoArr[0].top >= d.f0[1] * f5 && aceFaceInfoArr[0].right <= f4 * d.f0[2] && aceFaceInfoArr[0].bottom <= f5 * d.f0[3]) {
|
||
if (!"detect aurora face".equalsIgnoreCase(str)) {
|
||
long currentTimeMillis = System.currentTimeMillis();
|
||
this.c.t.brightness = PFaceDetector.nativeGetIllumination();
|
||
long currentTimeMillis2 = System.currentTimeMillis() - currentTimeMillis;
|
||
this.c.d("Illumination: ".concat(String.valueOf(currentTimeMillis2)));
|
||
PaFaceLogger.i("atomic get illumination use time: ".concat(String.valueOf(currentTimeMillis2)));
|
||
if (this.c.t.brightness < this.c.c.getDarkThr()) {
|
||
this.c.c(this.c.a(PaFaceConstants.EnvironmentalTips.TOO_DARK));
|
||
d dVar4 = this.c;
|
||
StringBuilder sb5 = new StringBuilder("TooDark:");
|
||
sb5.append(com.pingan.ai.c.a());
|
||
sb5.append(" errorFace:tooDark,brightness=");
|
||
sb5.append(this.c.t.brightness);
|
||
dVar4.a(sb5.toString());
|
||
sb = new StringBuilder("TOO_DARK ");
|
||
} else if (this.c.t.brightness > this.c.c.getBrightnessThr()) {
|
||
this.c.c(this.c.a(2012));
|
||
d dVar5 = this.c;
|
||
StringBuilder sb6 = new StringBuilder("TooBright:");
|
||
sb6.append(com.pingan.ai.c.a());
|
||
sb6.append(" errorFace:tooBright,brightness=");
|
||
sb6.append(this.c.t.brightness);
|
||
dVar5.a(sb6.toString());
|
||
sb = new StringBuilder("TOO_BRIGHT ");
|
||
}
|
||
sb.append(str);
|
||
sb.append(" brightness=");
|
||
f = this.c.t.brightness;
|
||
sb.append(f);
|
||
str2 = sb.toString();
|
||
PaFaceLogger.error(str2);
|
||
return false;
|
||
}
|
||
long currentTimeMillis3 = System.currentTimeMillis();
|
||
this.c.t.blurness = PFaceDetector.nativeGetBlur();
|
||
long currentTimeMillis4 = System.currentTimeMillis() - currentTimeMillis3;
|
||
this.c.d("Blur: ".concat(String.valueOf(currentTimeMillis4)));
|
||
PaFaceLogger.i("atomic get blur use time: ".concat(String.valueOf(currentTimeMillis4)));
|
||
if (this.c.t.blurness <= this.c.c.getBlurThr()) {
|
||
return true;
|
||
}
|
||
this.c.c(this.c.a(2013));
|
||
d dVar6 = this.c;
|
||
StringBuilder sb7 = new StringBuilder("TooFuzzy:");
|
||
sb7.append(com.pingan.ai.c.a());
|
||
sb7.append(" errorFace:tooFuzzy,blurness=");
|
||
sb7.append(this.c.t.blurness);
|
||
dVar6.a(sb7.toString());
|
||
sb = new StringBuilder("TOO_FUZZY ");
|
||
sb.append(str);
|
||
sb.append(" blurness=");
|
||
f = this.c.t.blurness;
|
||
sb.append(f);
|
||
str2 = sb.toString();
|
||
PaFaceLogger.error(str2);
|
||
return false;
|
||
}
|
||
}
|
||
this.c.c(this.c.a(2004));
|
||
d dVar7 = this.c;
|
||
StringBuilder sb8 = new StringBuilder("FaceNoCenter:");
|
||
sb8.append(com.pingan.ai.c.a());
|
||
sb8.append(" errorFace:noFace : ");
|
||
sb8.append(aceFaceInfoArr[0].left);
|
||
sb8.append(" ; ");
|
||
sb8.append(aceFaceInfoArr[0].top);
|
||
sb8.append(" ; ");
|
||
sb8.append(aceFaceInfoArr[0].right);
|
||
sb8.append(";");
|
||
sb8.append(aceFaceInfoArr[0].bottom);
|
||
dVar7.a(sb8.toString());
|
||
str2 = "CENTER NO_FACE face is too close border.";
|
||
PaFaceLogger.error(str2);
|
||
return false;
|
||
}
|
||
this.c.c(this.c.a(2014));
|
||
d dVar8 = this.c;
|
||
StringBuilder sb9 = new StringBuilder("TooClose:");
|
||
sb9.append(com.pingan.ai.c.a());
|
||
sb9.append(" errorFace:tooClose,scale=");
|
||
sb9.append(f3);
|
||
sb9.append(",frameWidth=");
|
||
sb9.append(this.c.t.frameWidth);
|
||
sb9.append(",frameHeight=");
|
||
sb9.append(this.c.t.frameHeight);
|
||
dVar8.a(sb9.toString());
|
||
sb = new StringBuilder("TOO_CLOSE ");
|
||
}
|
||
sb.append(str);
|
||
sb.append(" scale= ");
|
||
sb.append(f3);
|
||
sb.append(",frameWidth=");
|
||
sb.append(this.c.t.frameWidth);
|
||
sb.append(",frameHeight=");
|
||
sb.append(this.c.t.frameHeight);
|
||
str2 = sb.toString();
|
||
PaFaceLogger.error(str2);
|
||
return false;
|
||
}
|
||
|
||
public final boolean a(float[] fArr, String str) {
|
||
long currentTimeMillis;
|
||
if (this.c.W == 0) {
|
||
this.c.V = System.currentTimeMillis();
|
||
this.c.X = false;
|
||
currentTimeMillis = 0;
|
||
} else {
|
||
currentTimeMillis = System.currentTimeMillis() - this.c.V;
|
||
}
|
||
if (this.c.W < x.w(this.c.c) && (this.c.W <= 1 || currentTimeMillis <= x.g(this.c.c))) {
|
||
d dVar = this.c;
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" Stable:motionStableFrameCount=");
|
||
sb.append(this.c.W);
|
||
sb.append(" ; stableContinueTime=");
|
||
sb.append(currentTimeMillis);
|
||
dVar.c(sb.toString());
|
||
StringBuilder sb2 = new StringBuilder("STABLE_LEGAL Stable:motionStableFrameCount=");
|
||
sb2.append(this.c.W);
|
||
sb2.append(" ; stableContinueTime=");
|
||
sb2.append(currentTimeMillis);
|
||
PaFaceLogger.error(sb2.toString());
|
||
if (!this.c.b0.b(str)) {
|
||
this.c.W = 0;
|
||
return false;
|
||
}
|
||
d.r(this.c);
|
||
b();
|
||
return false;
|
||
}
|
||
if (!this.c.X) {
|
||
this.c.X = true;
|
||
d dVar2 = this.c;
|
||
StringBuilder sb3 = new StringBuilder();
|
||
sb3.append(com.pingan.ai.c.a());
|
||
sb3.append(" isPreMotionStable end.");
|
||
dVar2.c(sb3.toString());
|
||
PaFaceLogger.i("isPreMotionStable end.");
|
||
this.c.b0.h();
|
||
}
|
||
return true;
|
||
}
|
||
|
||
public final boolean a(String str) {
|
||
if (x.y(this.c.c)) {
|
||
return true;
|
||
}
|
||
boolean z = this.c.s || (this.c.f6509o != null && this.c.f6509o.c());
|
||
int i = this.c.t.trackingId;
|
||
if (this.c.Q == -1 || this.c.Q == i || !z) {
|
||
this.c.Q = i;
|
||
this.c.R = 0;
|
||
} else if (d.I(this.c) < 3) {
|
||
this.c.Q = -1;
|
||
this.c.R = 0;
|
||
d dVar = this.c;
|
||
StringBuilder sb = new StringBuilder("TrackingError:");
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" TRACKING_ERROR:TrackId change.trackId : ");
|
||
sb.append(this.c.Q);
|
||
sb.append("faceInfo.trackingId");
|
||
sb.append(this.c.t.trackingId);
|
||
dVar.a(sb.toString());
|
||
StringBuilder sb2 = new StringBuilder("TRACK_CHANGE featureAttack ");
|
||
sb2.append(str);
|
||
sb2.append(" TRACKING_ERROR:TrackId change.trackId : ");
|
||
sb2.append(this.c.Q);
|
||
sb2.append("faceInfo.trackingId");
|
||
sb2.append(this.c.t.trackingId);
|
||
PaFaceLogger.error(sb2.toString());
|
||
this.c.b(3003);
|
||
this.c.a(true);
|
||
return false;
|
||
}
|
||
return true;
|
||
}
|
||
|
||
public final boolean a(float f, float f2) {
|
||
if (this.c.b0.c()[4] > x.p(this.c.c) || this.c.b0.c()[5] > x.p(this.c.c)) {
|
||
this.c.b0.m = true;
|
||
d dVar = this.c;
|
||
StringBuilder sb = new StringBuilder();
|
||
sb.append(com.pingan.ai.c.a());
|
||
sb.append(" eyes:activeEyeAction");
|
||
dVar.c(sb.toString());
|
||
}
|
||
if (!this.c.b0.m) {
|
||
this.c.b0.u = false;
|
||
} else if (f > x.d(this.c.c) && f2 > x.d(this.c.c)) {
|
||
this.c.b0.u = true;
|
||
d dVar2 = this.c;
|
||
StringBuilder sb2 = new StringBuilder();
|
||
sb2.append(com.pingan.ai.c.a());
|
||
sb2.append(" model blink eyesInfo:left eyeScore:");
|
||
sb2.append(f);
|
||
sb2.append(" ; right eyeScore:");
|
||
sb2.append(f2);
|
||
dVar2.c(sb2.toString());
|
||
PaFaceLogger.error(" model blink eyesInfo: EyeClose");
|
||
this.c.b0.e();
|
||
}
|
||
if (this.c.b0.u && f < x.q(this.c.c) && f2 < x.q(this.c.c)) {
|
||
this.c.b0.v = true;
|
||
}
|
||
if (this.c.b0.v && this.c.b0.u) {
|
||
return true;
|
||
}
|
||
PaFaceLogger.error(PaFaceLogger.TAG, "model blink eye not pass.");
|
||
return false;
|
||
}
|
||
|
||
public final void a(boolean z) {
|
||
this.c.b0.b();
|
||
if (z) {
|
||
this.c.t.yaw = this.c.b0.c()[0];
|
||
this.c.t.roll = this.c.b0.c()[1];
|
||
this.c.t.pitch = this.c.b0.c()[2];
|
||
}
|
||
}
|
||
|
||
public final void a(int i, float f) {
|
||
if (this.c.q != null) {
|
||
this.c.q.a(i, f, this.c.f6509o);
|
||
}
|
||
}
|
||
|
||
public final void a(int i) {
|
||
if (i != 5 && i == 2022) {
|
||
this.c.e0.c(2022);
|
||
}
|
||
this.c.e0.b(i);
|
||
}
|
||
|
||
public /* synthetic */ c(d dVar, a aVar) {
|
||
this(dVar);
|
||
}
|
||
|
||
public c(d dVar) {
|
||
this.c = dVar;
|
||
this.a = true;
|
||
}
|
||
}
|
||
|
||
public static /* synthetic */ int I(d dVar) {
|
||
int i = dVar.R + 1;
|
||
dVar.R = i;
|
||
return i;
|
||
}
|
||
|
||
/* loaded from: classes3.dex */
|
||
public class e {
|
||
public int a;
|
||
public int b;
|
||
public int c;
|
||
public int d;
|
||
public List<Integer> e;
|
||
public final d f;
|
||
|
||
public native void a(PreviewFrame previewFrame);
|
||
|
||
public void c(int i) {
|
||
List<Integer> list = this.e;
|
||
if (list != null) {
|
||
int size = list.size();
|
||
this.e.clear();
|
||
for (int i2 = 0; i2 < size; i2++) {
|
||
this.e.add(Integer.valueOf(i));
|
||
}
|
||
}
|
||
}
|
||
|
||
/* JADX WARN: Removed duplicated region for block: B:18:0x004a */
|
||
/*
|
||
Code decompiled incorrectly, please refer to instructions dump.
|
||
To view partially-correct add '--show-bad-code' argument
|
||
*/
|
||
public void b(int r3) {
|
||
/*
|
||
r2 = this;
|
||
com.pingan.ai.d r0 = r2.f
|
||
com.pingan.ai.d$d r0 = com.pingan.ai.d.P(r0)
|
||
if (r0 == 0) goto L5a
|
||
r0 = 1000(0x3e8, float:1.401E-42)
|
||
if (r3 < r0) goto L51
|
||
if (r3 <= r0) goto L12
|
||
r0 = 2000(0x7d0, float:2.803E-42)
|
||
if (r3 < r0) goto L51
|
||
L12:
|
||
r0 = 3000(0xbb8, float:4.204E-42)
|
||
if (r3 > r0) goto L51
|
||
r0 = 2001(0x7d1, float:2.804E-42)
|
||
if (r3 != r0) goto L27
|
||
int r1 = r2.b
|
||
if (r1 == r0) goto L27
|
||
com.pingan.ai.d r0 = r2.f
|
||
com.pingan.ai.d$d r0 = com.pingan.ai.d.P(r0)
|
||
int r1 = r2.b
|
||
goto L35
|
||
L27:
|
||
if (r3 != r0) goto L39
|
||
int r1 = r2.c
|
||
if (r1 == r0) goto L39
|
||
com.pingan.ai.d r0 = r2.f
|
||
com.pingan.ai.d$d r0 = com.pingan.ai.d.P(r0)
|
||
int r1 = r2.c
|
||
L35:
|
||
r0.sendEmptyMessage(r1)
|
||
goto L42
|
||
L39:
|
||
com.pingan.ai.d r0 = r2.f
|
||
com.pingan.ai.d$d r0 = com.pingan.ai.d.P(r0)
|
||
r0.sendEmptyMessage(r3)
|
||
L42:
|
||
int r0 = r2.d
|
||
r1 = 1
|
||
int r0 = r0 + r1
|
||
r2.d = r0
|
||
if (r0 <= r1) goto L4e
|
||
int r0 = r2.b
|
||
r2.c = r0
|
||
L4e:
|
||
r2.b = r3
|
||
return
|
||
L51:
|
||
com.pingan.ai.d r0 = r2.f
|
||
com.pingan.ai.d$d r0 = com.pingan.ai.d.P(r0)
|
||
r0.sendEmptyMessage(r3)
|
||
L5a:
|
||
return
|
||
*/
|
||
throw new UnsupportedOperationException("Method not decompiled: com.pingan.ai.d.e.b(int):void");
|
||
}
|
||
|
||
public void a() {
|
||
List<Integer> list = this.e;
|
||
if (list != null) {
|
||
list.clear();
|
||
c(2001);
|
||
}
|
||
this.b = 0;
|
||
this.c = 0;
|
||
}
|
||
|
||
/* JADX WARN: Code restructure failed: missing block: B:14:?, code lost:
|
||
|
||
return r3.e.get(4).intValue();
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:16:0x0047, code lost:
|
||
|
||
return -1;
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:5:0x001e, code lost:
|
||
|
||
if (r3.e.size() == 5) goto L7;
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:7:0x0021, code lost:
|
||
|
||
if (r1 >= 4) goto L15;
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:8:0x0023, code lost:
|
||
|
||
r4 = r3.e.get(r1);
|
||
r1 = r1 + 1;
|
||
*/
|
||
/* JADX WARN: Code restructure failed: missing block: B:9:0x0037, code lost:
|
||
|
||
if (r4.equals(r3.e.get(r1)) != false) goto L17;
|
||
*/
|
||
/*
|
||
Code decompiled incorrectly, please refer to instructions dump.
|
||
To view partially-correct add '--show-bad-code' argument
|
||
*/
|
||
public int a(int r4) {
|
||
/*
|
||
r3 = this;
|
||
java.util.List<java.lang.Integer> r0 = r3.e
|
||
int r0 = r0.size()
|
||
r1 = 0
|
||
r2 = 5
|
||
if (r0 != r2) goto Lf
|
||
java.util.List<java.lang.Integer> r0 = r3.e
|
||
r0.remove(r1)
|
||
Lf:
|
||
java.util.List<java.lang.Integer> r0 = r3.e
|
||
java.lang.Integer r4 = java.lang.Integer.valueOf(r4)
|
||
r0.add(r4)
|
||
java.util.List<java.lang.Integer> r4 = r3.e
|
||
int r4 = r4.size()
|
||
if (r4 != r2) goto L47
|
||
L20:
|
||
r4 = 4
|
||
if (r1 >= r4) goto L3a
|
||
java.util.List<java.lang.Integer> r4 = r3.e
|
||
java.lang.Object r4 = r4.get(r1)
|
||
java.lang.Integer r4 = (java.lang.Integer) r4
|
||
java.util.List<java.lang.Integer> r0 = r3.e
|
||
int r1 = r1 + 1
|
||
java.lang.Object r0 = r0.get(r1)
|
||
boolean r4 = r4.equals(r0)
|
||
if (r4 != 0) goto L20
|
||
goto L47
|
||
L3a:
|
||
java.util.List<java.lang.Integer> r0 = r3.e
|
||
java.lang.Object r4 = r0.get(r4)
|
||
java.lang.Integer r4 = (java.lang.Integer) r4
|
||
int r4 = r4.intValue()
|
||
goto L48
|
||
L47:
|
||
r4 = -1
|
||
L48:
|
||
return r4
|
||
*/
|
||
throw new UnsupportedOperationException("Method not decompiled: com.pingan.ai.d.e.a(int):int");
|
||
}
|
||
|
||
public /* synthetic */ e(d dVar, a aVar) {
|
||
this(dVar);
|
||
}
|
||
|
||
public e(d dVar) {
|
||
this.f = dVar;
|
||
this.d = 0;
|
||
this.e = new ArrayList();
|
||
}
|
||
}
|
||
|
||
public static /* synthetic */ int C(d dVar) {
|
||
int i = dVar.a0;
|
||
dVar.a0 = i + 1;
|
||
return i;
|
||
}
|
||
}
|