iPhone 光传感器与相机测量光强度 [英] iPhone light sensor vs camera to measure the light intensity

查看:45
本文介绍了iPhone 光传感器与相机测量光强度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个测量光强度的应用程序,如下所示:

I need to create an application that measure the light intensity like the ones below:

http://itunes.apple.com/us/app/luxmeter-pro/id408369821?mt=8http://itunes.apple.com/us/app/megaman-luxmeter/id455660266?mt=8

我想知道解决问题的最佳方法是什么.据我所知,不可能使用 Apple 私有的光传感器 API.我可以使用哪些类来捕获帧并获得像素颜色等属性或稍后可以转换为 Lux 的某些输出?

and I wonder which is the best way to solve the problem. As I understood it is not possible to use light sensor APIs which are private to Apple. What classes can I use for capture frames and get properties like pixel color or some output that I can convert to Lux later?

谢谢!

推荐答案

您真正想要的是使用相机 api 拍摄图像并运行算法来确定亮度.您也可以即时执行此操作.见下文:

What you really want is to take an image with the camera api and run an algorithm to determine the luminance. You can do this on the fly as well. See below:

相机教程:http://developer.apple.com/library/ios/#DOCUMENTATION/AudioVideo/Conceptual/CameraAndPhotoLib_TopicsForIOS/Articles/TakingPicturesAndMovies.html

亮度算法:http://b2cloud.com.au/tutorial/obtaining-luminosity-from-an-ios-camera

这篇关于iPhone 光传感器与相机测量光强度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆