Help us understand the problem. What is going on with this article?

DJI Zenmuse XT2で撮影した画像のジンバル角度をExifToolで取得してみる

SENSYN ROBOTICS(センシンロボティクス) Advent Calendar 2019 の 12日目 担当の @s-okamura です。
株式会社センシンロボティクスにて、SENSYN FLIGHT CORESOLAR CHECKTOWER CHECK 等のサービス開発を担当しています。

DJI社のドローンに搭載可能なカメラはいくつか種類はありますが、今回はZenmuse XT2で撮影した画像のジンバル角度情報をExifToolで取得してみます。

XMPとは

JPEG画像にはExifと呼ばれるメタデータ領域があり、撮影時の位置情報やカメラ、レンズ等の情報を保存可能になっています。さらに、XMPと呼ばれる拡張可能なメタデータ領域にもデータを保存することが可能で、DJI社ではこのXMPに独自のメタデータを格納しています。Exif情報の確認はほとんどのアプリケーションで表示できますが、XMPは別途ツールが必要になることが多いです。

検証環境

OS: macOS Catalina

ExifToolのインストール

ExifToolの公式サイトはこちらですが、今回はHomebrewでインストールします。

brew install exiftool

Exif/XMPデータの表示

exiftool path/to/file でExifおよびXMPのメタデータを表示できます。なお、便宜上、下記メタデータ中の緯度経度データは弊社所在地に変更しています。

可視光画像

ExifTool Version Number         : 11.70
File Name                       : example-rgb.jpg
Directory                       : /Users/s-okamura/Downloads/example
File Size                       : 4.2 MB
File Modification Date/Time     : 2019:12:10 10:47:01+09:00
File Access Date/Time           : 2019:12:10 10:48:21+09:00
File Inode Change Date/Time     : 2019:12:10 10:47:45+09:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Little-endian (Intel, II)
Image Description               : DCIM/103MEDIA/DJI_0817.jpg
Make                            : DJI
Camera Model Name               : XT2
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : V06.02.17
Modify Date                     : 2019:05:23 14:57:51
Y Cb Cr Positioning             : Centered
About                           : DJI Meta Data
Absolute Altitude               : 105.189789
Relative Altitude               : 39.200001
Gimbal Roll Degree              : 0.000000
Gimbal Yaw Degree               : 1.200000
Gimbal Pitch Degree             : -89.900002
Flight Roll Degree              : -5.000000
Flight Yaw Degree               : -0.200000
Flight Pitch Degree             : 0.200000
Cam Reverse                     : 0
Gimbal Reverse                  : 0
Rtk Flag                        : 0
Exposure Time                   : 1/100
F Number                        : 1.8
Exposure Program                : Program AE
ISO                             : 128
Exif Version                    : 0210
Date/Time Original              : 2019:05:23 14:57:51
Create Date                     : 2019:05:23 14:57:51
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/100
Aperture Value                  : 1.8
Exposure Compensation           : 0
Max Aperture Value              : 1.8
Metering Mode                   : Spot
Light Source                    : Unknown
Flash                           : No Flash
Focal Length                    : 8.0 mm
Subject Area                    : 2000 1500 4000 3000
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 4000
Exif Image Height               : 3000
File Source                     : Digital Camera
Scene Type                      : Directly photographed
GPS Version ID                  : 2.2.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Altitude Ref                : Above Sea Level
Compression                     : JPEG (old-style)
Thumbnail Offset                : 1996
Thumbnail Length                : 21679
Image Width                     : 4000
Image Height                    : 3000
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 1.8
Image Size                      : 4000x3000
Megapixels                      : 12.0
Shutter Speed                   : 1/100
Thumbnail Image                 : (Binary data 21679 bytes, use -b option to extract)
GPS Altitude                    : 105.1 m Above Sea Level
GPS Latitude                    : 35 deg 38' 44.8" N
GPS Longitude                   : 139 deg 43' 21.4" E
Focal Length                    : 8.0 mm
GPS Position                    : 35 deg 38' 44.8" N, 139 deg 43' 21.4" E
Light Value                     : 8.0

サーマル画像

ExifTool Version Number         : 11.70
File Name                       : example-thermal.jpg
Directory                       : /Users/s-okamura/Downloads/example
File Size                       : 928 kB
File Modification Date/Time     : 2019:12:10 10:47:09+09:00
File Access Date/Time           : 2019:12:10 10:47:38+09:00
File Inode Change Date/Time     : 2019:12:10 10:47:34+09:00
File Permissions                : rw-r--r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Exif Byte Order                 : Little-endian (Intel, II)
Image Description               : DCIM/103MEDIA/DJI_0544_R.JPG
Make                            : DJI
Camera Model Name               : XT2
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : V06.02.17
Modify Date                     : 2019:05:23 14:55:34
Y Cb Cr Positioning             : Centered
About                           : DJI Meta Data
Absolute Altitude               : 108.689789
Relative Altitude               : 42.700001
Gimbal Roll Degree              : 0.000000
Gimbal Yaw Degree               : 1.200000
Gimbal Pitch Degree             : -90.000000
Flight Roll Degree              : -1.500000
Flight Yaw Degree               : 0.000000
Flight Pitch Degree             : 1.200000
Cam Reverse                     : 0
Gimbal Reverse                  : 0
Rtk Flag                        : 0
Exposure Time                   : 1/100
F Number                        : 1.4
Exposure Program                : Program AE
ISO                             : 128
Exif Version                    : 0210
Create Date                     : 2019:05:23 14:55:34
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/100
Aperture Value                  : 1.0
Exposure Compensation           : 0
Max Aperture Value              : 1.0
Metering Mode                   : Center-weighted average
Light Source                    : Unknown
Flash                           : No Flash
Focal Length                    : 25.0 mm
Subject Area                    : 320 256 640 512
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 640
Exif Image Height               : 512
Focal Plane X Resolution        : 10.88
Focal Plane Y Resolution        : 8.704
Focal Plane Resolution Unit     : mm
File Source                     : Digital Camera
Scene Type                      : Directly photographed
GPS Altitude Ref                : Above Sea Level
Compression                     : JPEG (old-style)
Thumbnail Offset                : 2046
Thumbnail Length                : 15022
Creator Software                : DJI
Raw Thermal Image Width         : 640
Raw Thermal Image Height        : 512
Raw Thermal Image Type          : TIFF
Raw Thermal Image               : (Binary data 655564 bytes, use -b option to extract)
Emissivity                      : 1.00
Object Distance                 : 0.00 m
Reflected Apparent Temperature  : 20.0 C
Atmospheric Temperature         : 20.0 C
IR Window Temperature           : 20.0 C
IR Window Transmission          : 1.00
Relative Humidity               : 30.0 %
Planck R1                       : 361098
Planck B                        : 1428
Planck F                        : 1
Atmospheric Trans Alpha 1       : 0.006569
Atmospheric Trans Alpha 2       : 0.012620
Atmospheric Trans Beta 1        : -0.002276
Atmospheric Trans Beta 2        : -0.006670
Atmospheric Trans X             : 1.900000
Camera Temperature Range Max    : 135.0 C
Camera Temperature Range Min    : -25.0 C
Camera Temperature Max Clip     : 150.0 C
Camera Temperature Min Clip     : -60.0 C
Camera Temperature Max Warn     : 135.0 C
Camera Temperature Min Warn     : -25.0 C
Camera Temperature Max Saturated: 150.0 C
Camera Temperature Min Saturated: -60.0 C
Camera Model                    : XT2
Camera Part Number              : XX640025XXFRXXX
Camera Serial Number            : 284364
Camera Software                 : V06.02.17
Lens Model                      : FOL30
Lens Part Number                : 
Lens Serial Number              : 
Field Of View                   : 25.0 deg
Filter Model                    : FOL30
Filter Part Number              : 
Filter Serial Number            : 
Planck O                        : -331
Planck R2                       : 1
Raw Value Range Min             : 0
Raw Value Range Max             : 65535
Raw Value Median                : 4124
Raw Value Range                 : 1711
Date/Time Original              : 2019:05:23 14:55:34.912+08:00
Focus Step Count                : 0
Focus Distance                  : 0.0 m
Frame Rate                      : 30
GPS Valid                       : Yes
GPS Version ID                  : 2.2.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Speed Ref                   : km/h
GPS Track Ref                   : True North
GPS Speed                       : 0.00
GPS Track                       : 0.00
GPS Map Datum                   : WGS84
Image Width                     : 640
Image Height                    : 512
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 1.4
Image Size                      : 640x512
Megapixels                      : 0.328
Scale Factor To 35 mm Equivalent: 0.5
Shutter Speed                   : 1/100
Thumbnail Image                 : (Binary data 15022 bytes, use -b option to extract)
Peak Spectral Sensitivity       : 10.1 um
GPS Altitude                    : 108.6 m Above Sea Level
GPS Latitude                    : 35 deg 38' 44.8" N
GPS Longitude                   : 139 deg 43' 21.4" E
Circle Of Confusion             : 0.058 mm
Depth Of Field                  : inf (7.73 m - inf)
Field Of View                   : 108.3 deg
Focal Length                    : 25.0 mm (35 mm equivalent: 13.0 mm)
GPS Position                    : 35 deg 38' 44.8" N, 139 deg 43' 21.4" E
Hyperfocal Distance             : 7.73 m
Light Value                     : 7.3

ジンバル情報

上記メタデータ中の

Gimbal Roll Degree              : 0.000000
Gimbal Yaw Degree               : 1.200000
Gimbal Pitch Degree             : -89.900002

が、ジンバル角度(ロール、ヨー、ピッチ)の情報になります。このジンバル角度を取得することで、その画像がどちらの方向を向いて撮影したのかを知ることができます。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした