iPhone 3GS (iPhone OS 3.1.2) を4方向に傾けてサンプル的に写真を撮ってみた。
今回の4つの写真は、ほぼ北を向いて撮影している。
そのためGPSImgDirectionタグが示す値は0°になって欲しいところだが、そううまくはいかないらしい。
iPhoneを通常の上下方向で縦に持った場合は正しい方角が記録されるようだが、iPhoneを傾けるとおかしくなってしまう。
Orientation(傾き) | GPSImgDirection(方角) | iPhoneの傾き | 写真 |
---|---|---|---|
1: Horizontal | 約270° | ||
6: Rotate 90 | 約0° | ||
3: Rotate 180 | 約90° | ||
8: Rotate 270 | 測定失敗 |
以下、それぞれの写真のExif情報。
Orientation = 1
$ jhead -v ./20100124_orientation1.jpg
Exif header 9770 bytes long
Exif section in Motorola order
(dir has 11 entries)
Make = "Apple"
Model = "iPhone 3GS"
Orientation = 1
XResolution = 72/1
YResolution = 72/1
ResolutionUnit = 2
Software = "3.1.2"
DateTime = "2009:12:18 12:23:36"
YCbCrPositioning = 1
ExifOffset = 206
Exif Dir:(dir has 21 entries)
ExposureTime = 1/1093
FNumber = 14/5
ExposureProgram = 2
ISOSpeedRatings = 70
ExifVersion = "0221"
DateTimeOriginal = "2009:12:18 12:23:36"
DateTimeDigitized = "2009:12:18 12:23:36"
ComponentsConfiguration = "?"
ShutterSpeedValue = 95773/9488
ApertureValue = 4281/1441
MeteringMode = 1
Flash = 32
FocalLength = 77/20
FlashPixVersion = "0100"
ColorSpace = 1
ExifImageWidth = 2048
ExifImageLength = 1536
SensingMethod = 2
ExposureMode = 0
WhiteBalance = 0
Sharpness = 1
GPS Dir offset = 544
GPS info dir:(dir has 10 entries)
GPSLatitudeRef ="N"
GPSLatitude =35/1, 1056/100, 0/1, 1056/100, 0/1, 136/1, 0/1, 136/1, 5361/100
GPSLongitudeRef ="E"
GPSLongitude =136/1, 5361/100, 0/1, 5361/100, 0/1, 48/1, 0/1, 48/1, 12/1
GPSAltitudeRef =00
GPSAltitude =48/1
GPSTimeStamp =12/1, 23/1, 3649/100, 23/1, 3649/100, 3/1, 3649/100, 3/1, 64514/233
GPSDOP =3/1
GPSImgDirectionRef ="T"
GPSImgDirection =64514/233
Continued directory (dir has 7 entries)
Compression = 6
Orientation = 1
XResolution = 72/1
YResolution = 72/1
ResolutionUnit = 2
ThumbnailOffset = 872
ThumbnailLength = 8890
Thumbnail size: 8890 bytes
Jpeg section marker 0xdb size 132
JPEG image is 2048w * 1536h, 3 color components, 8 bits per sample
Jpeg section marker 0xc4 size 418
File name : ./20100124_orientation1.jpg
File size : 1195395 bytes
File date : 2010:01:24 22:11:55
Camera make : Apple
Camera model : iPhone 3GS
Date/Time : 2009:12:18 12:23:36
Resolution : 2048 x 1536
Flash used : No
Focal length : 3.8mm
Exposure time: 0.0009 s (1/1093)
Aperture : f/2.8
ISO equiv. : 70
Whitebalance : Auto
Exposure : program (auto)
GPS Latitude : N 35d 10.56m 0s
GPS Longitude: E 136d 53.61m 0s
GPS Altitude : 48.00m
Orientation = 6
$ jhead -v ./20100124_orientation6.jpg
Exif header 8225 bytes long
Exif section in Motorola order
(dir has 11 entries)
Make = "Apple"
Model = "iPhone 3GS"
Orientation = 6
XResolution = 72/1
YResolution = 72/1
ResolutionUnit = 2
Software = "3.1.2"
DateTime = "2009:12:18 12:23:28"
YCbCrPositioning = 1
ExifOffset = 206
Exif Dir:(dir has 21 entries)
ExposureTime = 1/1156
FNumber = 14/5
ExposureProgram = 2
ISOSpeedRatings = 70
ExifVersion = "0221"
DateTimeOriginal = "2009:12:18 12:23:28"
DateTimeDigitized = "2009:12:18 12:23:28"
ComponentsConfiguration = "?"
ShutterSpeedValue = 13695/1346
ApertureValue = 4281/1441
MeteringMode = 1
Flash = 32
FocalLength = 77/20
FlashPixVersion = "0100"
ColorSpace = 1
ExifImageWidth = 2048
ExifImageLength = 1536
SensingMethod = 2
ExposureMode = 0
WhiteBalance = 0
Sharpness = 1
GPS Dir offset = 544
GPS info dir:(dir has 10 entries)
GPSLatitudeRef ="N"
GPSLatitude =35/1, 1056/100, 0/1, 1056/100, 0/1, 136/1, 0/1, 136/1, 5361/100
GPSLongitudeRef ="E"
GPSLongitude =136/1, 5361/100, 0/1, 5361/100, 0/1, 50/1, 0/1, 50/1, 12/1
GPSAltitudeRef =00
GPSAltitude =50/1
GPSTimeStamp =12/1, 23/1, 2767/100, 23/1, 2767/100, 3/1, 2767/100, 3/1, 5999/3184
GPSDOP =3/1
GPSImgDirectionRef ="T"
GPSImgDirection =5999/3184
Continued directory (dir has 7 entries)
Compression = 6
Orientation = 6
XResolution = 72/1
YResolution = 72/1
ResolutionUnit = 2
ThumbnailOffset = 872
ThumbnailLength = 7345
Thumbnail size: 7345 bytes
Jpeg section marker 0xdb size 132
JPEG image is 2048w * 1536h, 3 color components, 8 bits per sample
Jpeg section marker 0xc4 size 418
File name : ./20100124_orientation6.jpg
File size : 1119383 bytes
File date : 2010:01:24 22:11:56
Camera make : Apple
Camera model : iPhone 3GS
Date/Time : 2009:12:18 12:23:28
Resolution : 2048 x 1536
Orientation : rotate 90
Flash used : No
Focal length : 3.8mm
Exposure time: 0.0009 s (1/1156)
Aperture : f/2.8
ISO equiv. : 70
Whitebalance : Auto
Exposure : program (auto)
GPS Latitude : N 35d 10.56m 0s
GPS Longitude: E 136d 53.61m 0s
GPS Altitude : 50.00m
Orientation = 3
$ jhead -v ./20100124_orientation3.jpg
Exif header 9554 bytes long
Exif section in Motorola order
(dir has 11 entries)
Make = "Apple"
Model = "iPhone 3GS"
Orientation = 3
XResolution = 72/1
YResolution = 72/1
ResolutionUnit = 2
Software = "3.1.2"
DateTime = "2009:12:18 12:24:00"
YCbCrPositioning = 1
ExifOffset = 206
Exif Dir:(dir has 21 entries)
ExposureTime = 1/1511
FNumber = 14/5
ExposureProgram = 2
ISOSpeedRatings = 70
ExifVersion = "0221"
DateTimeOriginal = "2009:12:18 12:24:00"
DateTimeDigitized = "2009:12:18 12:24:00"
ComponentsConfiguration = "?"
ShutterSpeedValue = 13550/1283
ApertureValue = 4281/1441
MeteringMode = 1
Flash = 32
FocalLength = 77/20
FlashPixVersion = "0100"
ColorSpace = 1
ExifImageWidth = 2048
ExifImageLength = 1536
SensingMethod = 2
ExposureMode = 0
WhiteBalance = 0
Sharpness = 1
GPS Dir offset = 544
GPS info dir:(dir has 10 entries)
GPSLatitudeRef ="N"
GPSLatitude =35/1, 1056/100, 0/1, 1056/100, 0/1, 136/1, 0/1, 136/1, 5361/100
GPSLongitudeRef ="E"
GPSLongitude =136/1, 5361/100, 0/1, 5361/100, 0/1, 49/1, 0/1, 49/1, 12/1
GPSAltitudeRef =00
GPSAltitude =49/1
GPSTimeStamp =12/1, 23/1, 5935/100, 23/1, 5935/100, 3/1, 5935/100, 3/1, 22108/233
GPSDOP =3/1
GPSImgDirectionRef ="T"
GPSImgDirection =22108/233
Continued directory (dir has 7 entries)
Compression = 6
Orientation = 3
XResolution = 72/1
YResolution = 72/1
ResolutionUnit = 2
ThumbnailOffset = 872
ThumbnailLength = 8674
Thumbnail size: 8674 bytes
Jpeg section marker 0xdb size 132
JPEG image is 2048w * 1536h, 3 color components, 8 bits per sample
Jpeg section marker 0xc4 size 418
File name : ./20100124_orientation3.jpg
File size : 1149409 bytes
File date : 2010:01:24 22:11:55
Camera make : Apple
Camera model : iPhone 3GS
Date/Time : 2009:12:18 12:24:00
Resolution : 2048 x 1536
Orientation : rotate 180
Flash used : No
Focal length : 3.8mm
Exposure time: 0.0007 s (1/1511)
Aperture : f/2.8
ISO equiv. : 70
Whitebalance : Auto
Exposure : program (auto)
GPS Latitude : N 35d 10.56m 0s
GPS Longitude: E 136d 53.61m 0s
GPS Altitude : 49.00m
Orientation = 8
$ jhead -v ./20100124_orientation8.jpg
Exif header 7827 bytes long
Exif section in Motorola order
(dir has 11 entries)
Make = "Apple"
Model = "iPhone 3GS"
Orientation = 8
XResolution = 72/1
YResolution = 72/1
ResolutionUnit = 2
Software = "3.1.2"
DateTime = "2009:12:18 12:23:47"
YCbCrPositioning = 1
ExifOffset = 206
Exif Dir:(dir has 21 entries)
ExposureTime = 1/1620
FNumber = 14/5
ExposureProgram = 2
ISOSpeedRatings = 70
ExifVersion = "0221"
DateTimeOriginal = "2009:12:18 12:23:47"
DateTimeDigitized = "2009:12:18 12:23:47"
ComponentsConfiguration = "?"
ShutterSpeedValue = 5395/506
ApertureValue = 4281/1441
MeteringMode = 1
Flash = 32
FocalLength = 77/20
FlashPixVersion = "0100"
ColorSpace = 1
ExifImageWidth = 2048
ExifImageLength = 1536
SensingMethod = 2
ExposureMode = 0
WhiteBalance = 0
Sharpness = 1
GPS Dir offset = 544
GPS info dir:(dir has 8 entries)
GPSLatitudeRef ="N"
GPSLatitude =35/1, 1056/100, 0/1, 1056/100, 0/1, 136/1, 0/1, 136/1, 5361/100
GPSLongitudeRef ="E"
GPSLongitude =136/1, 5361/100, 0/1, 5361/100, 0/1, 50/1, 0/1, 50/1, 12/1
GPSAltitudeRef =00
GPSAltitude =50/1
GPSTimeStamp =12/1, 23/1, 4643/100, 23/1, 4643/100, 1/1, 4643/100, 1/1, 459011/196608
GPSDOP =1/1
Continued directory (dir has 7 entries)
Compression = 6
Orientation = 8
XResolution = 72/1
YResolution = 72/1
ResolutionUnit = 2
ThumbnailOffset = 840
ThumbnailLength = 6979
Thumbnail size: 6979 bytes
Jpeg section marker 0xdb size 132
JPEG image is 2048w * 1536h, 3 color components, 8 bits per sample
Jpeg section marker 0xc4 size 418
File name : ./20100124_orientation8.jpg
File size : 1089089 bytes
File date : 2010:01:24 22:11:56
Camera make : Apple
Camera model : iPhone 3GS
Date/Time : 2009:12:18 12:23:47
Resolution : 2048 x 1536
Orientation : rotate 270
Flash used : No
Focal length : 3.8mm
Exposure time: 0.0006 s (1/1620)
Aperture : f/2.8
ISO equiv. : 70
Whitebalance : Auto
Exposure : program (auto)
GPS Latitude : N 35d 10.56m 0s
GPS Longitude: E 136d 53.61m 0s
GPS Altitude : 50.00m
参考
3GSになってEXIFに記載される情報量が増加した印象である。EXIFのGPS情報のところに、「撮影した画像の方向」という部分がある。そこに358.09°という値が入っている。これは「北から時計回りに8.09度の方向」という意味であり、ほぼ北に向かって撮影したことを意味している。確かに、3GSで撮影した写真には方位角が記録されている。しかし、方位磁針が撮影された写真を見てわかるように、撮影の向きは東であり、正確ではない。
このようになる原因を考えたが、写真を撮影する場合に横にiPhoneを傾けて撮影した場合と、縦に傾けて撮影した場合とで方位角が異なるのではないかと考えた。先ほどはホームボタンが右側、通話用スピーカーを左になるように真横に傾けて撮影したので、次にカメラを縦にして撮影してみた。
109度になり、ほぼ東向きの角度となった。ということは、縦撮影の場合のEXIF情報の方位角は正確だが、横の場合は注意が必要ということである。
マップアプリで方位角を表示してiPnoheを撮影する場合と同じように傾けて試行錯誤したが、どうやらiPhoneを縦に持った場合の向こう側を指す方角を方位角として認識するようで、その際の値が忠実にEXIFに記録されたようである。
iPhoneを横に傾けて撮影した場合、ホームボタンが右側にくるように真横に傾けた場合は方位角を+90度とする必要があり、逆にホームボタンが左側にくるように真横に傾けた場合は、-90度とする必要がある。といっても撮影時の方位角の情報を後で使うマニアックな人はいないかな・・・。
iPhone 3GSの写真には方位角が記録されている - Tagchan's Blog
いろいろ参考になるものを探したら、perlのExif.pmというライブラリのソースが見つかり、次のように定義されていた。、
%orientation = (
1 => 'Horizontal (normal)',
2 => 'Mirror horizontal',
3 => 'Rotate 180',
4 => 'Mirror vertical',
5 => 'Mirror horizontal and rotate 270 CW',
6 => 'Rotate 90 CW',
7 => 'Mirror horizontal and rotate 90 CW',
8 => 'Rotate 270 CW',
);
オレBlog >> Exif Orientationタグによる補正方法
Exif file format (Exif形式の画像ファイル解説) にはExifのくわしい情報が載っていてすばらしい。
fladdict >>> イラレで作ったそこそこフォトリアルなiPhoneデータ にあるiPhone画像を使わせていただいた。便利。
tags: zlashdot iPhone Exif Photo iPhone
Posted by NI-Lab. (@nilab)