任何机会,以减少快门时间与Android NDK的相机接入? [英] Any chances to reduce shutter time with android NDK camera access?

查看:283
本文介绍了任何机会,以减少快门时间与Android NDK的相机接入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个Android应用程序,捕捉来自摄像机的实时preVIEW。有一个短的快门时间,这至少应该是恒定是重要的。

I wrote an android application that captures a live preview from the camera. It is important to have a short shutter time, which should at least be constant.

目前我使用下面的code,实现了低快门时间:

Currently I use the following code to achieve a low shutter time:

Parameters params = camera.getParameters();
params.setSceneMode(Parameters.SCENE_MODE_SPORTS);
params.setWhiteBalance(Parameters.WHITE_BALANCE_DAYLIGHT);
params.setFlashMode(Parameters.FLASH_MODE_OFF);
params.setFocusMode(Parameters.FOCUS_MODE_INFINITY);

params.setPreviewFpsRange(9000, 29453);
params.setPreviewFrameRate(29453);
params.setJpegQuality(100);
params.setPreviewFormat(ImageFormat.NV21);

params.setPreviewSize(1280,720);
params.setAntibanding(Parameters.ANTIBANDING_OFF);
params.setExposureCompensation(params.getMinExposureCompensation());
params.set("iso", 1250);
camera.setParameters(params);

在setSceneMode()似乎没有在我的手机固件(getSupportedSceneModes返回一个空列表)的支持。在ISO - 设置有可能没有任何影响(还没有看图片,只是计算的帧速率,还)。刚刚发现这个code的地方,并用它......也许这只是错误的字符串?

The setSceneMode() seems not to be supported at my phones firmware (getSupportedSceneModes returns an empty list). The "ISO"-Setting has possibly no effect (have not looked at the picture, just calculated the frame rate, yet). Just found this code somewhere and used it... maybe it's just the wrong string?

会发生什么事,到目前为止是:9〜29453 fps的,这是唯一支持的帧速率范围的帧速率的变化。因此, params.set previewFpsRange(29453,29453); 也不起作用。 帧速率高(20-30 fps)的速度在良好的光线条件下(正常的一天,在室内,定向窗),并变得非常低(8-10 fps)在中/低光照(日光,室内,直接离开窗口)条件。

What happens so far is: The frame rate changes between 9 and 29,453 fps, which is the only supported frame rate range. So params.setPreviewFpsRange(29453, 29453); doesn't work either. The Frame rate is high (20-30 fps) at good light conditions (normal day, indoors, directed to window) and becomes very low (8-10 fps) for medium/low light (daylight, indoors, direct away from window) conditions.

更详细地说:我不需要高帧速率,但是较低的快门时间。所收集的数据将用于室内导航(或:在第一步骤中室内定位)。该应用程序需要拍照,而一个人只是正常行走,而不关心如何,他/她是携带手机的人。这个人可以是即使在运行或摇摆手机(如走路时,你通常会移动手臂)。所以通常很多运动模糊的,一旦快门时间太长。这种情况是非常不同的,以我想拍的照片的情况,那里的照片试图保持相机稳定。事实上,我们不希望达到好照片,而是要以某种方式检测墙体一些边不时。我想到了很多在画面的噪音,但是这是有希望的工作呢?

More in detail: I do not need a high frame rate, but a low shutter time. The gathered data shall be used for indoor navigation (or: Indoor Localization in a first step). The application needs to take pictures while a person is just normally walking, without the person caring about how he/she is carrying the phone. The person could be even running or "swinging" the phone (as you would normally move your arms when walking). So there is usually a lot of "motion blur", as soon the shutter time is too long. The situation is much different to "I want to make a photo" situations, where the photograph tries to hold the camera steady. We actually don't want to achieve "good photos", but want to somehow detect some edges of walls from time to time. I expect a lot of "noise" in the picture, but this is hopefully working anyway...

我们的想法是,有可能的机会,以获得更多的控制权使用NDK的相机参数。有没有人能与这个NDK,并能回答我度过这是值得一试?

The Idea is, that there are possibly chances to get more control over camera parameters using the NDK. Has anyone experiences with the NDK and can answer me weather it's worth trying?

附加信息:我使用的是HTC Desire Z的(也称:T-Mobile G2的或宏达视野)。作为测试设备

Additional Info: I'm using an HTC Desire Z (also named: "T-Mobile G2" or "HTC Vision") as test device.

推荐答案

简短的回答是NO。较长的答案开始于一个问题:你的应用程序并不关心捕捉,但只使用了YUV preVIEW框架,是正确的。

The short answer is "NO". The longer answer starts with a question: your app does not care about the capture, but only uses the YUV preview frames, is that correct?

作为一个标准的下载,没有root访问权限的应用程序,你没有权限访问摄像头(或其他),直接设备。你只需要 setParameters() API来实现摄像头的行为,因此你完全在OEM的摆布,什么摄像功能,通过这个API暴露。

As a standard downloaded app with no root access, you have no permissions to access camera (or other) device directly. You only have setParameters() API to effect the camera behaviour, and thus you are completely at the mercy of the OEM as to what camera functionality is exposed through this API.

即使是根深蒂固的设备上,你的能力有,但现在的设备驱动程序和具体的相机的ISP。

Even on a rooted device, your capabilities are limited, but now by the specs of the device drivers and specific camera ISP.

在这两种情况下,你应该非常小心地选择目标设备启动。我相信,一些Android手机允许比HTC视野更加摄像机控制。例如,三星S2 http://pfittech.com/rom_pfittech_jb.html 的修改后的版本拥有稳定25的FPS在1080

In both cases, you should start by very carefully choosing the target device. I believe that some Android phones allow much more camera control than HTC Vision. For example, a modified version of Samsung S2 http://pfittech.com/rom_pfittech_jb.html boasts stable 25 FPS at 1080p.

这篇关于任何机会,以减少快门时间与Android NDK的相机接入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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