I am working with Android camera2 API.
I can get the focus distance using LENS_FOCUS_DISTANCE in manual focus mode. However, the property is always zero in autofocus mode. Is there a way to get the focus distance in autofocus mode?
The shortest distance from the very front of the lens that can be focused.If the lens has a fixed focus, it will be 0.
The shortest distance from the very front of the lens that can be focused.
If the lens has a fixed focus, it will be 0.
http://developer.android.com/intl/es/reference/android/hardware/camera2/CameraCharacteristics.html
In another way, if you want to control the focus, remember that LENS_INFO_MINIMUM_FOCUS_DISTANCE gives you minimal focus, but to get the focus "Max" you have to use LENS_INFO_HYPERFOCAL_DISTANCE . Hope this helps you!
LENS_INFO_MINIMUM_FOCUS_DISTANCE
LENS_INFO_HYPERFOCAL_DISTANCE
float yourMinFocus = mCameraCharacteristics.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE); float yourMaxFocus = mCameraCharacteristics.get(CameraCharacteristics.LENS_INFO_HYPERFOCAL_DISTANCE);
Have a nice day!
If the value of LENS_INFO_MINIMUM_FOCUS_DISTANCE is 0, this means that it has fixed focus and does not support manual focus. Limited feature - present on all camera devices that report that they are at least HARDWARE_LEVEL_LIMITED
HARDWARE_LEVEL_LIMITED
Source: https://habr.com/ru/post/988760/More articles:INSTALL_FAILED_CONFLICTING_PROVIDER using the Facebook SDK when I create several products. - androidUsing Oracle database parser from Java using JDBC - javaWhat types / sizes of images do you need when using full-screen UIImage? - iosWebpack-dev-server application and node isomorphic response - node.jsIs there a good reason why 1f is not a valid floating literal? - c ++How to say Express NOT to parse a query string of a query? - javascriptRegular expression to remove everything except characters and numbers between square brackets - javaRecyclerView - move to a position, then smoothly scroll up - androidEclipse conditional breakpoint - only after another breakpoint - javaStreaming Command Output Performance - goAll Articles