Android的L - 使用摄像机2 API使用闪光灯拍摄图像,自动对焦 [英] Android L - Take flash image with autofocus using Camera2 api

查看:2082
本文介绍了Android的L - 使用摄像机2 API使用闪光灯拍摄图像,自动对焦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着Android L移动preVIEW页camera2basic指导,我能够捕捉到正常图像,即不使用闪光灯或使用自动对焦机制(我靠被动焦点)

Following camera2basic guide on Android L preview page, I am able to capture normal images, i.e. without flash or using auto-focus mechanism (I rely on passive focus)

不过,我想借一个闪光的形象。文档状态闪光拍摄图像之前,我应该叫android.control.ae precaptureTrigger以确定正确的曝光。

However, I would like to take a flash image. The documentation states before taking flash image, I should call android.control.aePrecaptureTrigger to determine correct exposure.

我的问题:


  • 我怎么能叫AE precapture触发,等待它完成,然后使用捕获(CaptureRequest,CameraCaptureSession.CaptureListener,处理程序)?采取图片

方法我已经试过:


  • 用户点击捕获图像按钮后,我开始preVIEW

  • 设置CONTROL_AE_ preCAPTURE_TRIGGER到CONTROL_AE_ preCAPTURE_TRIGGER_START

  • 监控AE_STATE结果CaptureListener的onCaptureCompleted方法

  • 当AE_STATE收敛,我设置自动曝光锁和使用采取图像捕捉()方法

但是,闪光图像仍然曝光过度,有时,我得到完整的垃圾图片。

However, the flash image is still over-exposed and sometimes, I get complete garbage image.

有没有人能得到这个工作?

Has anyone able to get this working?

在此工作中,自动对焦机构可以以类似的方式使用。

Once this is working, auto-focus mechanism can be used in similar fashion.

感谢

推荐答案

感谢您试用新的摄像机2 API!

Thanks for trying out the new camera2 API!

您不应该需要锁定AE;一旦你看到AE_STATE的融合(或FLASH_REQUIRED),提交静像拍摄要求。

You shouldn't need to lock AE; once you see AE_STATE as CONVERGED (or FLASH_REQUIRED), submit the still capture request.

需要确认的东西:


  • 是您​​AE_MODE要么ON_AUTO_FLASH或ON_ALWAYS_FLASH同时为preVIEW和静止捕获请求?如果不是,计量程序不会控制闪光功率或正确地开火。静止捕获和preVIEW模板可能只是有自动曝光模式设置为ON,这意味着闪光自动曝光控制下不会被解雇。

  • 您使用CAPTURE_INTENT_STILL_PICTURE的静像拍摄?如果不是这样,闪光灯将不会由自动化烧制。这样做是为了TEMPLATE_STILL_CAPTURE。自动设定

如果你看到垃圾的图片,请随时提交有关我们的Andr​​oid AOSP跟踪了一个错误:
http://b.android.com

If you're seeing garbage images, please feel free to file a bug on our Android AOSP tracker: http://b.android.com

详图集你有你的会话产出将是特别有用的,因为我们知道有某些输出表面套目前的一些错误。

Detailing the set of outputs you have for your session would be especially helpful, since we know there are some current bugs for certain output Surface sets.

这篇关于Android的L - 使用摄像机2 API使用闪光灯拍摄图像,自动对焦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆