简体   繁体   中英

iPhone light sensor vs camera to measure the light intensity

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=8 http://itunes.apple.com/us/app/megaman-luxmeter/id455660266?mt=8

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?

Thanks!

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:

Camera Tutorial: http://developer.apple.com/library/ios/#DOCUMENTATION/AudioVideo/Conceptual/CameraAndPhotoLib_TopicsForIOS/Articles/TakingPicturesAndMovies.html

Luminance Algorithm: http://b2cloud.com.au/tutorial/obtaining-luminosity-from-an-ios-camera

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM