相机闪光灯 LED 快速(100Hz 或以上)闪烁

发布于 2025-01-07 04:35:10 字数 242 浏览 1 评论 0原文

我正在尝试使用 PWM 编写一个可变亮度手电筒应用程序(稍后可能会用它进行通信)。为此,我需要快速切换相机 LED(例如 100-200Hz),这是通过相机 API 的 setParameters 功能不可能实现的(我猜相机本身会大大减慢速度)。

现在 – LED 能够快速切换,并且有一些应用程序可以做类似的事情(例如 HTC 手电筒,不幸的是找不到它的源代码),所以这一切都归结为在没有相机的情况下控制 LED。

有什么想法或想法吗?

I am trying to write a variable brightness flashlight app by using PWM (might use it for communication later). For that I need fast switching of the camera LED (say 100-200Hz), which is not possible through the Camera API's setParameters functionality (I guess the camera itself slows things down considerably).

Now – The LED is capable of switching rapidly and there are apps doing something similar (HTC flashlight for example, unfortunately couldn't find source code for it) so it all comes down to controlling the LED without the camera.

Any thoughts or ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情徒 2025-01-14 04:35:10

我知道这是 4 年后的事了,但你需要比 100-200hz 更高的频率才能使 PWM 正常工作,而不刺激眼睛。您可能会得到一些控制,但在脉冲不变得明显的情况下,您将无法获得 10% 的亮度,即使如此,这些脉冲的持续时间也太长而无法欺骗眼睛。通常 PWM 在微秒级(大约 100khz)进行处理。我也希望这成为可能。除此之外,如果我们可以说闪光灯中的载波频率为 100khz,那么如果所有像素都可以足够快地扫描,则可以通过传感器中的专用像素计算到物体的距离,并通过解调拒绝所有环境光。但遗憾的是不可能。

I know this is 4 years later, but you'd need a lot more than 100-200hz for PWM to work properly, without irritating the eye. You might get some control, but you won't be able to get 10% brightness without the pulses becoming noticeable, and even then, the duration of those pulses is too long to fool the eye. Typically PWM is handled at the microsecond level, around 100khz. I would like this to be possible as well. Except, if we could have say a 100khz carrier frequency in the flash, it would be possible to calculate distance to a subject with dedicated pixels in the sensor, as well as reject all ambient light through demodulation, if all pixels could be scanned fast enough. Sadly not possible though.

灯下孤影 2025-01-14 04:35:10

通常,要做到这一点,处理器中会有一个 PWM 外设来为您处理快速切换,但这需要驱动程序支持;用户应用程序无法访问它。这是一个使用驱动程序来执行此操作的问题:在 Android 中设置闪光灯的亮度

Normally to do that there'll be a PWM peripheral in the processor that handles the rapid switching for you, but that would need driver support; it won't be accessible to user applications. Here's a question which uses the driver to do it: Set brightness of flash in Android

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文