Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 744
Tugba Avatar asked Apr 05 '12 09:04

Tugba


1 Answers

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

like image 62
John Avatar answered Sep 29 '22 02:09

John