iPhoneカメラでルクスまたは照度を計算する方法.私はすべてのexifデータを次のように計算しました:
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
http://en.wikipedia.org/wiki/Light_meterも読んで、ルクスが次のように計算されることを知りました。(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
この値が何を指しているのかわかりません。N は Key Value Data の ApertureValue または FNumber であり、t は露光時間またはシャッター速度です。C(320-540 or 250)の値は?この式にさまざまな組み合わせで同様の値をすべて適用しましたが、ルクス値を計算する一部のアプリと比較すると、間違った結果が得られました。 また、照度から放射照度を計算する必要があります。
さらに、キャプチャした画像の輝度も次のように計算しました。
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);
http://b2cloud.com.au/tutorial/obtaining-luminosity-from-an-ios-cameraによる
よろしくお願いします。