到“兴趣点”的距离在 iPhone 自动对焦中

发布于 2024-11-18 00:29:53 字数 130 浏览 2 评论 0原文

在iphone中,我想计算相机到拍摄对象的距离。

我想知道也许 iPhone 相机的“主动自动对焦”为我提供了到拍摄对象(兴趣点)的距离?

非常感谢。

PS 如果你们认为这是不可能的,请告诉我;)

In iphone, I want to calculate the distance from the camera to the subject.

I was wondering maybe iphone camera's "Active Auto Focus" provide me the distance to the subject (point of interest)??

many thanks in advance.

p.s. guys if you think it is not possible plz let me know ;)

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

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

发布评论

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

评论(2

鯉魚旗 2024-11-25 00:29:53

据我所知,这是不可能的 - 请参阅 此处 了解有关您可以执行的操作和操作的更多信息做不到。您可以判断相机何时自动对焦,但仅此而已。

我确信您可以使用私有 API 调用获得有关焦点/距离的更多信息 - 但除非您不担心进入 App Store,否则这并不是一个真正的选择。

但这并不意味着没有其他方法。看起来关于这个主题的讨论很好:Distance using OpenCV(您可以为 iOS 编译 openCV!)

As far as I'm aware, it's not possible - see here for more info on what you can and can't do. You can tell when the camera is autofocusing, but nothing more.

I'm sure there is probably some more info you can get on focus/distance using a private API call - but unless you're not worried about getting on the App Store, it's not really an option.

That doesn't mean there's not another way though. Looks like a good discussion on the topic here: Distance using OpenCV (you can compile openCV for iOS!)

恬淡成诗 2024-11-25 00:29:53

我一直在研究相机测量短距离的能力,但没有发现任何东西,但我在黑暗中想出了这张照片。我还没有尝试过,但文档让我认为这可能会起作用:

  • 创建并配置代表相机的 AVCaptureDevice
  • 通过 AVCaptureSession,
  • 从 AVCaptureStillImageOutput 对象捕获 AVCaptureStillImageOutput 检查 kCGImagePropertyExifSubjectDistance 的 Exif 属性

喜欢听听是否有人已经尝试过能够使用这样的方法来进行精确(小于 1 英尺)的距离测量。

I've been investigating the ability of the camera to measure short distances and not finding anything yet I came up with this shot in the dark. I haven't tried it yet, but the docs make me think this might work:

  • Create and configure an AVCaptureDevice representing the camera
  • Through the AVCaptureSession, capture the AVCaptureStillImageOutput
  • From the AVCaptureStillImageOutput object check the Exif properties for kCGImagePropertyExifSubjectDistance

Love to hear if anyone has been able to use a methodology like this to be able to make accurate (less than 1 foot) distance measurements.

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