How to set infinite focus in Camera2 API of Android?

I want to set the focal length of the custom camera to infinity when using the external fisheye lens, which 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 too vague

I'm using Samsung S6 and nexus 5. The wide angle of the external lens is 170 degrees

Can I help you?

resolvent:

If you are just talking about using a built-in camera lens to achieve a fisheye lens, the minimum value you should use is:

float minFocalDist = cameracharacteristics.get(Cameracharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);

If you are using an external lens, I think the correct way is actually to use autofocus on the camera, because it should focus on the focal length of the fisheye lens... I think. Therefore, the external lens can protect the fisheye lens, and the internal lens can achieve autofocus. However, if this does not work, when the focal length is set to super focal length, What will you see? This distance may not be the best distance, but it should be available in most cases

float hyperFocalDist = cameracharacteristics.get(Cameracharacteristics.LENS_INFO_HYPERFOCAL_DISTANCE);

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>