How to set infinity focus in camera2 api, android?

淺唱寂寞╮ 提交于 2020-05-11 07:28:25

问题


I wanna set my custom camera focus distance to infinity while using external fisheye lens, This is what I have done so far:

builder.set(CaptureRequest.CONTROL_AF_MODE, CaptureRequest.CONTROL_AF_MODE_OFF);
builder.set(CaptureRequest.LENS_FOCUS_DISTANCE, 0.0f);

But the result is so blurry.

I am using Samsung S6 and Nexus 5. External lens's wide angle is 170 degree.

Can anyone help?


回答1:


If you are just talking about using the built-in camera's lens to achieve fisheye, then the lowest value you should use is:

float minFocalDist = cameraCharacteristics.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);

If you are using an external lens, then I believe that the correct approach is actually to use autofocus on the camera, since that should focus to the focal length of the fish eye lens... I think. So the external lens is taking care of fisheye and the internal is taking care of autofocus. However, if this doesn't work, then see what you get when you set the focal length to the hyperfocal distance. That distance might not be optimal, but it should work in most cases...

float hyperFocalDist = cameraCharacteristics.get(CameraCharacteristics.LENS_INFO_HYPERFOCAL_DISTANCE);


来源:https://stackoverflow.com/questions/42084327/how-to-set-infinity-focus-in-camera2-api-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!