问题
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