|
@ -106,6 +106,11 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
private int consecutiveNoFaceCount = 0; // 连续未检测到人脸的次数 |
|
|
private int consecutiveNoFaceCount = 0; // 连续未检测到人脸的次数 |
|
|
private static final int CONSECUTIVE_NO_FACE_THRESHOLD = 20; // 连续未检测到人脸的阈值 |
|
|
private static final int CONSECUTIVE_NO_FACE_THRESHOLD = 20; // 连续未检测到人脸的阈值 |
|
|
|
|
|
|
|
|
|
|
|
// FPS统计相关变量 |
|
|
|
|
|
private long lastFpsCheckTime = 0; // 上次检查FPS的时间 |
|
|
|
|
|
private int frameCountInSecond = 0; // 每秒内的帧数计数 |
|
|
|
|
|
private float currentFps = 0; // 当前FPS值 |
|
|
|
|
|
|
|
|
private Context mContext; |
|
|
private Context mContext; |
|
|
private AutoTexturePreviewView mAutoCameraPreviewView; |
|
|
private AutoTexturePreviewView mAutoCameraPreviewView; |
|
|
private TextureView mDrawDetectFaceView; |
|
|
private TextureView mDrawDetectFaceView; |
|
@ -1225,6 +1230,18 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
try { |
|
|
try { |
|
|
// Log.d(TAG, "45466: 444:"+isNeedCamera); |
|
|
// Log.d(TAG, "45466: 444:"+isNeedCamera); |
|
|
frameCounter++; |
|
|
frameCounter++; |
|
|
|
|
|
|
|
|
|
|
|
// // FPS统计逻辑 |
|
|
|
|
|
// frameCountInSecond++; |
|
|
|
|
|
|
|
|
|
|
|
// // 每秒计算一次FPS |
|
|
|
|
|
// if (System.currentTimeMillis() - lastFpsCheckTime >= 1000) { |
|
|
|
|
|
// currentFps = frameCountInSecond; |
|
|
|
|
|
// LogManager.logInfo(TAG, "摄像头FPS: " + currentFps); |
|
|
|
|
|
// frameCountInSecond = 0; |
|
|
|
|
|
// lastFpsCheckTime = System.currentTimeMillis(); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
// 摄像头预览数据进行人脸检测 |
|
|
// 摄像头预览数据进行人脸检测 |
|
|
if (isNeedCamera) { |
|
|
if (isNeedCamera) { |
|
|
// 增加帧计数器和时间间隔控制 |
|
|
// 增加帧计数器和时间间隔控制 |
|
|