在 iPhone OS 4.0 上从相机获取曝光值
拍照时可以获取相机的曝光值(无需将其保存到 SavedPhotos)。 iPhone 上的照度计 应用程序可能会使用一些私有 API 来实现此目的。
该应用程序仅在 iPhone 3GS 上执行此操作,因此我猜测它可能与创建图像时填充此信息的 EXIF 数据有某种关系。
这都适用于3GS。
iPhone OS 4.0 有什么变化吗? 现在有常规方法可以获取这些值吗?
有人有获取这些相机/照片设置值的工作代码示例吗?
谢谢
Exposure values from camera can be acquired when you take picture (without saving it to SavedPhotos). A light meter application on iPhone does this, probably by using some private API.
That application does it on iPhone 3GS only, so I guess it may be somehow related to EXIF data which is populated with this information when the image is created.
This all applies to 3GS.
Has anything changed with iPhone OS 4.0?
Is there a regular way to get these values now?
Does anyone have a working code example for taking these camera/photo setting values?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您想要实时*曝光信息,您可以使用 AVCaptureVideoDataOutput 捕获视频。每帧 CMSampleBuffer 都充满了描述相机当前状态的有趣数据。
*高达 30 fps
If you want realtime* exposure information, you can capture a video using AVCaptureVideoDataOutput. Each frame CMSampleBuffer is full of interesting data describing the current state of the camera.
*up to 30 fps
使用 iOS 4.0 中的 AVFoundation,您可能会弄乱曝光,具体请参阅 AVCaptureDevice,这里有一个链接 AVCaptureDevice 参考。不确定它是否正是您想要的,但您可以查看 AVFoundation 并可能找到一些有用的东西
With AVFoundation in iOS 4.0 you can mess with exposure, refer specifically to AVCaptureDevice, here is a link AVCaptureDevice ref. Not sure if its exactly what you want but you can look around AVFoundation and probably find some useful stuff
我想我终于找到了真正的 EXIF 数据。我还需要一段时间才能发布实际的代码,但我认为这应该同时公开。
Google 从连接异步捕获StillImage。它是 AVCaptureStillImageOutput 的一个函数,以下是文档的摘录(长期以来一直在寻找):
imageDataSampleBuffer -
捕获的数据。
缓冲区附件可以包含适合图像数据格式的元数据。例如,包含 JPEG 数据的缓冲区可以携带 kCGImagePropertyExifDictionary 作为附件。有关键和值类型的列表,请参阅 ImageIO/CGImageProperties.h。
有关使用 AVCaptureStillImageOutput 的示例,请参阅 AVCam 下的 WWDC 2010 示例代码。
和平,
奥。
I think I finally found the lead to the real EXIF data. It'll be a while before I have actual code to post, but I figured this should be publicized in the meantime.
Google captureStillImageAsynchronouslyFromConnection. It's a function of AVCaptureStillImageOutput and following is an excerpt from the documentation (long sought for):
imageDataSampleBuffer -
The data that was captured.
The buffer attachments may contain metadata appropriate to the image data format. For example, a buffer containing JPEG data may carry a kCGImagePropertyExifDictionary as an attachment. See ImageIO/CGImageProperties.h for a list of keys and value types.
For an example of working with AVCaptureStillImageOutput see WWDC 2010 sample code, under AVCam.
Peace,
O.
这是完整的解决方案。不要忘记导入适当的框架和标头。
在 capturenow 方法的 exifAttachments var 中,您将找到您要查找的所有数据。
Here is the complete solution. Dont forget to import appropriate frameworks and headers.
In the exifAttachments var in capturenow method you'll find all data you are looking for.