I would like to explain how to make 360VR picture for Facebook from DJI Spark spherical pano pictures. I found a following page, but I still think that it is good idea to explain in detail.
[ Facebookが360度VR写真として認識するための条件 / Conditions to recognize JPEG file as 360VR by Faceboook ]
縦横比2:1のJPEG画像 / JPEG picture with 2:1 aspect ratio
円筒図法で描かれた世界地図のイメージです。最初、なんとなく2:1かと思いましたが、横方向は360度、縦方向は天頂から足の下までの180度を平面に展開したものになりますので縦横比2:1は自明です。/ It looks like cylindrical projection world map. You may understand why aspect ratio needs to be 2:1, because 360 degrees for horizontal line and 180 degrees for vertical line.
JPGのExifで属性の”Make”が”Ricoh”,”Camera Model Name”が”Ricoh Theta S”であること / JPEG file has exif attribute “Make” = “Ricoh” and “Camera Model Name” = “Ricoh Theta S”
Thetaに偽装することによりFacebookあるいは他のアプリケーションに360VRとして扱ってもらいます。/ This is just pretending Ricoh Theta picture.
この条件に適合するJPEG画像を作り出すことが本稿の目的です。
Objective of this article is making JPEG file to meet above conditions.
[ 手順 / Procedure ]
DJI SparkのSDカードからPCに写真をコピーします。360度パノラマの場合DICM/Panorama/ フォルダー下のサブフォルダーに46枚の写真があります。Copy 46 pictures from subfolder under DICM/Panorama of DJI Spark SD card to your PC.
Microsoft Image Composite Editorで結合します。/ Stitching 46 pictures by using Microsoft Image Composite Editor. – New panorama from images – 46枚の写真を選択 / Select 46 pictures
– IMPORT – Simple panorama, Auto-detectを選択してNEXT / Select “Simple panorama” and “Auto-detect” then hit NEXT – STITCH – Spherical、Auto orientationを選択してNEXT / Select “Spherical” and “Auto orientation” and hit NEXT – CROP – (Auto completeを実行)、No cropを選択してNEXT / (Execute “Auto complete”), select “No crop” and hit NEXT – EXPORT – Image/Widthを10000に変更してExport to disk / Change “Image/Width” to 10000 and perform “Export to disk”
Original width is 19546 pixels and height is 7191 pixels. It is too large for web applications. Let reduce the width to 10000 here.
縦横比の調整 / Adjust aspect ratio
前のステップで出来上がった写真は横幅10000 pixels、縦が3696 pixelsほどになっています。この縦方向を5000pixelにする必要があります。元々の写真で縦のpixelが足りないのには理由があります。それはSparkのカメラは上の方向に向けることは出来ないため天頂周りの画像が抜けているからです。
好みのツールで調整を行ってください。わたしは古いAdobe PhotoShop Elementsを使用してキャンバス・サイズの変更で調整しました。この時、オリジナルの画像が下に配置し追加したキャンバスが上に来るようにします。/ Now we have JPEG picture which has 10000 x 3696 pixels. We need to adjust this to 10000 x 5000 pixels. What is lack of 1304 pixels for vertical size? The reason of this answer is Spark can not move a camera to above. So, we need to add 1304 pixels in top of the picture. I use canvas size modification function of Adobe Photoshop Elements.出来上がった画像で地平線が中央にあることを確認します。
フリーソフトのGIMPでも簡単に同じことができます。
Horizon should be at center of the picture.
exifの変更 / Modify exif
わたしはexiftoolというコマンドライン・ツールを使用して必要な属性を追加しました。コマンドは以下のようになります。WindowsであればExplorerからJPEGファイルのブロパティ/詳細で”カメラの製造元”と”カメラのモデル”で変更することも出来ます。I use exitftool command to modify exif. Command example is following. You also can use Windows/Explorer property window to modify exif attribute.exiftool -Make="Ricoh" -Model="Ricoh Theta S" DJI_0245.jpg
[ 活用方法 / Usage ]
Facebookにアップロードすると360度写真として認識されます。PCならばマウスで、携帯電話だとVRとして携帯電話の向きを変えることで好きに方向の景色を見ることが出来ます。
Just upload the picture to the facebook. Then you can manipulate the picture as 360VR mode.
-> 投稿のサンプル / Sample facebook entry
PCのRICHO THETAアプリケーションに読み込むと大画面で詳細な画像を操作したり回転させたり出来ます。
You can use RICHO THETA application on the PC to enjoy the 360VR picture by using big screen.
携帯電話のTHETA Sを使用すれば画面の操作をするだけではなくGoogle Cardboardや同様のVRメガネを使用してVR体験出来ます。これは試してみるとかなり凄いです。
You can use VR glass like Google Cardboard by using THETA S mobile application.
携帯電話のTHETA+で様々な編集をしたりアニメーションを作成したり出来ます。
You also use THETA+ mobile application to edit or make animation from the picture.
-> 投稿のサンプル/ Sample
Google Photosもアップロードしておくとしばらくしてから回転できるパノラマ写真として認識されます。 / Google Photos also recognizes the picture as 360VR some time later.
Altitude is based on sea level, how do I make it ground-based?
How to make ground based altitude–it will be a single step at the start of every project for you:
-Figure out what the ground altitude is (for example, 750 meters)
-Make a clone of the data profile you are using, so that you can edit it. This can be done in the Data Profile Editor (File Menu > Edit Data Profiles…)
-In this clone add a Math Calculator (bottom left area) that takes the Altitude in meters and subtracts 750. Call this new channel “Ground Based Altitude”, or whatever you want.
-Map your new channel to our appropriate “Positional \ Ground-Based Altitude” type, based on your desired units.
-Save the new data profile.
Every time you make a change to a data profile, or want to use a different data profile in a project, you need to remove then re-add your data file to the project. So re-add your data file to your project and select your new cloned data profile.
Add a gauge to your project that shows ground based altitude, or edit an existing gauge and change the gauge’s input data type to ground based.
– Data Profileをコピーし編集を行う。File/Edit Data Profileを開きます。前回の記事で紹介したCSVファイルでは自動的にFlytrexというData Profileが使われますので、それをクローン(上の方の左から二つ目のアイコン)します。Flytrex — Clone (1)というファイルが出来るので、それを編集します。
– 次に右側のウインドウで得られた値をData Typeにマップします。Input Data ColumnをMy Altitude、Map to Data CategoryをPosition、Map to Data TypeをAltitude / Z Position (Meters)で作成します。実はAltitude / Z Position (Meters)はすでに存在しているので、新しく作った項目を一番上に持ってきて正しく選択されるようにします。
Data Profileを保管したら、いちどProjectからData Fileを削除して、新しいData Profileを使ってCSVファイルを読み直せば目的の高度値が得られているはずです。
For Android, flight information log file is at DJI/dji.go.v4/FlightRecord/DJIFlightRecord*.txt of Android internal storage. File name includes timestamp. File extension is ‘txt’, but this is binary file actually.
[ ログファイルの変換 / Convert log file to csv ]
ログファイルを読める形に変換しなければなりません。いくつかの方法があるようですが、わたしは以下のwebサイトを使用しました。出力はcsvファイルです。
Flight information log file has to be converted to csv file. I use following web site.
[ ログデータと動画の合成 / Overlay log data to footage ] DashWareというWindowsプログラムで行いました。
わたしはうまく組み込めていませんが、DJI Phantom用の追加ゲージなども公開されています。
I use Windows program called DashWare. There is additional gauge data for DJI Phantom also (I can not use this well yet).
– Project画面で動画ファイルとcsv変換したログファイルを追加します。Gaugeについては後から変更しますのでProject Templateは気にしなくても良いです。 Add footage file and csv converted log file on the project wizard. You do not need to care about ‘Project Template’ here, we can change the gauge later.
– Gauge Toolboxで好みのゲージを探して貼り付けます。 Add your favorite gauges from Gauge Toolbox.
– Synchronization画面で動画とログの同期を行います。 Adjust synchronization point by using Synchronization tab.
以上です。ここまでは試行錯誤あるもののさほど難しくはありません。 That’s all about setup.
[ Create Videoでエラー / Error when Create Video ]
最後にCreate Videoで合成後のビデオを出力します。この時に”Error rendering in MediaFoundationMedia Foundation Error + -2147467259″というエラーが出てビデオを作る事が出来ませんでした。海外の掲示板に元のビデオになんでも良いから音声トラックを付けるとエラーしないと書かれていました。確かにSparkから取り出した動画には音声トラックがありません、適当なMP3ファイルをiMovieで動画ファイルに付けたらエラーしなくなりました。
I got an error message ‘Error rendering in MediaFoundationMedia Foundation Error + -2147467259’ when I initiated Create Video function. It could be fixed by adding any audio tracks to the Spark footage (original Spark footage on the micro SD card does not have audio) before add the DashWare project.
[ 高度が0から始まらない / Altitude does not start from 0 ]
飛行高度の表示が目的でしたが離陸時の高度が0ではありませんでした。説明では海抜になっていますが、ちょっと変な数字です。いずれにしても欲しいのは離陸場所からの相対的な高度です。これにはちょっとしたトリックが必要です。
I want display altitude meter on my Spark video. However it does not start from 0. Some of explanation texts said that it is sea level altitude, but it seems to me something different from the sea level also.
公式FAQの”Altitude is based on sea level, how do I make it ground-based”にさらっと方法が書かれています。説明が簡単すぎてなかなか理解出来ませんでした。具体的な手順は以下のリンクを御覧ください。
Official DashWare FAQ mentions about how to change the altitude value from the sea level to ground level. But it is difficult to understand because of too simple explanation. I wrote how to change altitude from sea level to ground level below. This article written in Japanese, but you may find some screenshots for your reference.
バッテリー
Fly More Comboには2つのバッテリーが付いていますが、聞くところによると現実的な飛行時間はひとつのバッテリーで10分強とのことです。2つではとても足りないのは目に見えています。また、充電器はバッテリー3個を同時に充電できるようになっています。追加バッテリーを最初から買っておくべきでしょう。
[ 飛行の前に ]
まずは携帯電話上のアプリケーションDJI GO 4からアクティベーションを行います。Fly More Comboの場合は、機体とRCは自動的に接続されます。携帯電話とRCをWiFiで接続してアクティベーションを行います。この時はSIMが入っていてデータ通信が行える携帯電話を使用することをお勧めします。