从Exif数据计算照度 [英] calculate illuminance from Exif Data

查看:210
本文介绍了从Exif数据计算照度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算iPhone Camera的lux或照度。我已经计算所有的exif数据,如:

  = FocalLength,value = 3.85 
key = MeteringMode,value = 5
key = ShutterSpeedValue,value = 4.591759434012097
key = ExposureProgram,value = 2
key = FocalLenIn35mmFilm,value = 32
key = SceneType,value = 1
key = FNumber,value = 2.4
key = PixelXDimension,value = 480
key = ExposureTime,value = 0.04166666666666666
key = BrightnessValue,value = -0.2005493394308445
key = ApertureValue,value = 2.526068811667588
key = Flash,value = 32
key = ExposureMode,value = 0
key = PixelYDimension,value = 360
key = SensingMethod,value = 2
key = ISOSpeedRatings,value =(
1250

key = WhiteBalance,value = 0

我阅读了 http ://en.wikipedia.org/wiki/Light_meter ,并且知道Lux是由 (N * N * C)/ tS

 其中N是相对光圈(f-数)
t是曝光时间快门速度)秒
S是ISO算术速度
C是入射光计校准常数

我不明白这个值是指什么。 N是来自键值数据的ApertureValue或FNumber,t是曝光时间或快门速度。什么是C的值(320-540或250)。
我应用每个类似的值在不同的组合到这个公式,但得到错误的结果,因为我与一些应用程序计算lux值。
我还需要计算照度的辐照度。

此外,我还计算了捕获图像的亮度: / p>

  UIImage * image = [UIImage imageNamed:@image.png]; 
unsigned char * pixels = [image rgbaPixels];
double totalLuminance = 0.0;
for(int p = 0; p totalLuminance + = pixels [p] * 0.299 + pixels [p + 1] * 0.587 +像素[p + 2] * 0.114;
}
totalLuminance / =(image.size.width * image.size.height);
totalLuminance / = 255.0;
NSLog(@Image.png =%f,totalLuminance);

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



感谢在前面。任何帮助将不胜感激。

解决方案

你真的需要绝对值照度?或者你可以逃避相对值,可以相互比较,例如。已知的常数比例因子的值?



如果前者你运气不好:你在exif数据中没有C,



如果是后者,只需将表达式重写为Lux = C *(N * N / St),其中N == FNumber,t == ExposureTime,S == ISOSpeedRatings,set C == 1(或任何任意值)


How I calculate the lux or illuminance by iPhone Camera.I have calculated all the exif data which is as:

key = FocalLength, value = 3.85
key = MeteringMode, value = 5
key = ShutterSpeedValue, value = 4.591759434012097
key = ExposureProgram, value = 2
key = FocalLenIn35mmFilm, value = 32
key = SceneType, value = 1
key = FNumber, value = 2.4
key = PixelXDimension, value = 480
key = ExposureTime, value = 0.04166666666666666
key = BrightnessValue, value = -0.2005493394308445
key = ApertureValue, value = 2.526068811667588
key = Flash, value = 32
key = ExposureMode, value = 0
key = PixelYDimension, value = 360
key = SensingMethod, value = 2
key = ISOSpeedRatings, value = (
        1250
    )
key = WhiteBalance, value = 0

I read http://en.wikipedia.org/wiki/Light_meter also and came to know that Lux is calculated by (N*N*C)/tS

Where N is the relative aperture (f-number)
t is the exposure time ("shutter speed") in seconds
S is the ISO arithmetic speed
C is the incident-light meter calibration constant

I do not understand what this value refer to eg. N is ApertureValue or FNumber from Key Value Data and t is exposure time or shutter speed. And What is value of C(320-540 or 250). I applied every similar values in different combination to this formula but got wrong result as I compare with some app that calculate lux values. Also I need to calulate the irradiance from illuminance.

In Addition I have calculated the Luminance of captured image also by:

UIImage* image = [UIImage imageNamed:@"image.png"];
unsigned char* pixels = [image rgbaPixels];
double totalLuminance = 0.0;
for(int p=0;p<image.size.width*image.size.height*4;p+=4) {
  totalLuminance += pixels[p]*0.299 + pixels[p+1]*0.587 + pixels[p+2]*0.114;
}
totalLuminance /= (image.size.width*image.size.height);
totalLuminance /= 255.0;
NSLog(@"Image.png = %f",totalLuminance);

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

Thanks In advance.Any help will be appreciated.

解决方案

Do you really need the absolute value of illuminance? Or can you get away with relative values that can be compared to each other, e.g. values known up to a constant scale factor?

If the former you are out of luck: you don't have C in the exif data, and retrieving it with a calibration procedure requires having a light source of known intensity, and likely taking pictures in an integration sphere.

If the latter, just rewrite the expression as Lux = C * (N*N /St), where N == FNumber, t == ExposureTime, S == ISOSpeedRatings, set C == 1 (or any arbitrary value)

这篇关于从Exif数据计算照度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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