Android如何判断手机Camera是否移动?或者手机是否移动?
黄舟
黄舟 2017-04-17 15:40:49
0
2
357

自己写了一个Camera的程序,只有主动调用autofous的时候才会进行自动对焦,我手机的Camera支持的对焦模式只有auto和macro, 但是我看我手机系统自带的相机在拍照移动时会进行自动对焦,想知道这是如何实现的?难道是判断手机的rotation吗?可是如果方向不变只是距离改变的时候系统相机也会进行自动对焦,这是如何做到的呢?因为从Camera支持的对焦模式里看应该没有支持连续对焦模式。

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
Peter_Zhu

The camera zoom is optical zoom, and the program only does post-processing. The system camera relies on the underlying driver, which can achieve more refined processing. The Camera API open at the application layer is not the entire camera control API, so there is a difference. In addition, the Camera API is not mobile related.

Peter_Zhu

I have seen the source code of zxing (although it is very old code, it can still be used). It uses AsyncTask to continuously cycle focus. Although there are parameters for continuous focus in the API, it requires mobile phone support. After trying it, the effect is not very good. For reference only, please refer to it.
https://github.com/zxing/zxing/blob/master/android/src/com/google/zxing/client/android/camera/AutoFocusManager.java

Attached is a demo of camera2
https://github.com/googlesamples/android-Camera2Basic

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!