admin管理员组文章数量:1287145
I am having a Camera2 framework issue with face detection on one device, but it works normally on all other devices I've tested so far. Device in question is a Samsung XCover6 Pro.
When face detection is turned on, it only detects a face once, then the Faces array becomes empty on the next capture callback. If I move the phone away and then back to the face, the device detects the face again, only once.
The face detection mode is set to STATISTICS_FACE_DETECT_MODE_SIMPLE. The scene mode is set to CONTROL_SCENE_MODE_DISABLED. AE and AF is set to CONTROL_AF_MODE_AUTO and CONTROL_AE_MODE_ON.
Device is running Android 14. I am having issues with multiple devices of this model, with different software versions.
Is there anything I can try or is this an issue in the camera module itself?
Samsung Camera app in portrait mode detects the face normally, but it is possible that it uses software face detection in the app itself, as it also has the Bokeh effect, that is not available to me through Camera2.
Here is my CaptureCallback:
CameraCaptureSession.CaptureCallback captureCallback = new CameraCaptureSession.CaptureCallback() {
private void processCapture(CaptureResult result) {
Rectangle faceRect = new Rectangle();
if(result != null) {
if(mode == CameraRequestMode.FACE) {
if(faceDetection && detectFace) {
Face[] faces = result.get(CaptureResult.STATISTICS_FACES);
Point cameraCenter = new Point(mMaxCameraSize.width / 2, mMaxCameraSize.height / 2);
if(faces != null) {
int i = 0;
for(Face face : faces) {
log(String.format(Locale.US, "Face found %d %d", i++, System.currentTimeMillis()));
Rectangle faceRect1 = new Rectangle(face.getBounds());
if(faceRect1.center().distanceToPoint(cameraCenter) < faceRect.center().distanceToPoint(cameraCenter)) {
faceRect = faceRect1;
}
}
}
if(faceRect.surface() == 0) {
if(detectedFace == null || detectedFace.surface() == 0 || faceRetries++ >= 5) {
detectedFace = new Rectangle();
faceRetries = 0;
}
} else {
faceRetries = 0;
detectedFace = faceRect;
log(String.format(Locale.US, "%d %d", (int) detectedFace.position.x, (int) detectedFace.position.y));
}
Rectangle r = detectedFace.translateFromFaceToScreen(mMaxCameraSize, mScreenSize);
VOverlay.setRectangle(r.enlarge(faceZoom), true);
} else if(captureRectangle) {
setOverlayDefaultCapture();
} else {
detectedFace = new Rectangle();
VOverlay.setRectangle(null, false);
}
VOverlay.redraw();
}
}
}
@Override
public void onCaptureProgressed(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull CaptureResult partialResult) {
//processCapture(partialResult);
}
@Override
public void onCaptureCompleted(@NonNull CameraCaptureSession session, @NonNull CaptureRequest request, @NonNull TotalCaptureResult result) {
processCapture(result);
}
};
There are errors in the logcat:
2025-02-24 14:18:04.637 1147-1799 CamX [email protected]_64 E [ERROR][STATS_AEC] caecxbankmanager.h:237: GetDataSceneAnalyzer GetDataSceneAnalyzer Invalid data ID -1
2025-02-24 14:18:04.637 1147-1799 CamX [email protected]_64 E [ERROR][STATS_AEC] caecxbankmanager.cpp:1084: UtilGetFloatFromBank Invalid bankID 3 with dataID -1 returning 0.0
2025-02-24 14:18:04.639 1147-1799 CamX [email protected]_64 E [ERROR][META ] camxmetadatapool.cpp:1272 SetMetadataByTagInternal() Invalid size for tag 0 type 0 maxSize 1 unitsize 1 count 2 pool 3 tagName MainColorCorrectionMode client RealTimeFeatureZSLPreviewRaw_Stats0 pipeline RealTimeFeatureZSLPreviewRaw_0 cameraId -1
2025-02-24 14:18:04.644 1147-20994 CHIUSECASE [email protected]_64 E [ERROR ] chxadvancedcamerausecase.cpp:6617 SetPriorityMetadata() [3rd party DBG][ISO] ERROR, Check, please(20)
本文标签: Android phone only gives STATISTICSFACES once when a face enters a sceneStack Overflow
版权声明:本文标题:Android phone only gives STATISTICS_FACES once when a face enters a scene - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741265431a2368372.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论