gpt4 book ai didi

android - 在 Android 上将相机焦点设置在受控的固定距离

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:03:48 26 4
gpt4 key购买 nike

我的设备只有两种对焦模式,自动和固定(根据 getSupportedFocusModes())。我想将我的相机设置在“x”的固定焦距(x 是我喜欢的任何东西,或者我可以从相机获得的任何东西......)。 (我知道 setFocusMode(Camera.Parameters.FOCUS_MODE_FIXED),但这似乎只在最远的可能设置上固定..)

这能做到吗? (安卓版本4.2.2)

最佳答案

这里不打算完全回答问题,只是想给它一些方向。
因此,您在这里需要的是支持这种操作的驱动程序。然后在某个时候,您会要求应用程序中的驱动程序设置请求的焦距。

另一个问题是:“是否有人真的需要那种功能?”。

Android documentation says:

public static final String FOCUS_MODE_FIXED
Focus is fixed. The camera is always in this mode if the focus is not adjustable. If the camera has auto-focus, this mode can fix the focus, which is usually at hyperfocal distance. Applications should not call autoFocus(AutoFocusCallback) in this mode.

让我们看看什么是超焦距。

Hyperfocal distance
From Wikipedia, the free encyclopedia

In optics and photography, hyperfocal distance is a distance beyond which all objects can be brought into an "acceptable" focus. There are two commonly used definitions of hyperfocal distance, leading to values that differ only slightly:

Definition 1: The hyperfocal distance is the closest distance at which a lens can be focused while keeping objects at infinity acceptably sharp. When the lens is focused at this distance, all objects at distances from half of the hyperfocal distance out to infinity will be acceptably sharp.

Definition 2: The hyperfocal distance is the distance beyond which all objects are acceptably sharp, for a lens focused at infinity.

The distinction between the two meanings is rarely made, since they have almost identical values. The value computed according to the first definition exceeds that from the second by just one focal length.

As the hyperfocal distance is the focus distance giving the maximum depth of field, it is the most desirable distance to set the focus of a fixed-focus camera.

因此焦点不会设置在尽可能远的位置,而是设置为让所有可见物体都清晰到可以接受的程度。

回到问题。
如果您碰巧是这个特定相机固件的开发人员,您可以将任何需要的 IOCTL 添加到您的驱动程序中。但是你仍然需要以某种方式给他们打电话。如果不向 Android 操作系统添加额外的功能,并进一步重新编译 Android 本身及其底层的 Linux 内核,这是无法实现的。
所以看起来你无法实现这个目标,至少在用户空间是这样。

关于android - 在 Android 上将相机焦点设置在受控的固定距离,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23272806/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com