## Writing Pix4D compatible tags into pictures

If you’re looking for a method to write camera pose information into JPG files so that it can be read by Pix4D, as shown in the below screenshot:

Here is how to do it with exiftool:

• First, you need a configuration file for exiftool. In the configuration file, you need the following content:
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::Main' => {
Camera=> {
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::Camera',
},
},
},
);
%Image::ExifTool::UserDefined::Camera = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Other' },
NAMESPACE => { 'Camera' => 'http://ns.flyingfishtechs.com/Camera/1.0/' },
WRITABLE => 'string',
GPSXYAccuracy=> {},
GPSZAccuracy => {},
Pitch => {},
Roll=>{},
Yaw => {},
);
• Then you can using exiftool to add the information to any JPG file.
exiftool.exe -config config.min.cfg -Pitch="1.02" -Roll="2.03" -Pitch="3.04" original.jpg

If the command outputs: 1 image files updated. Then you’re done. Now the JPG file has the camera pose information encoded in. If you have more than 3 such pictures (only because Pix4D needs at least 3 pictures to work), you can see that Pix4D can get the data from the pictures.

The final twist, Pix4D displays Omega, Phi and Kappa instead of Pitch, Roll and Yaw. Basically, Pitch, Roll and Yaw are angles relative to the horizontal plane – orthogonal to the gravity while Omega, Phi and Kappa are related to earth. That means, with a fixed set of Pitch, Roll and Yaw, if you change your GPS location, you’ll get a different set Omega, Phi and Kappa. Personally I don’t see why should Pix4D use earth as the frame of reference instead of horizontal plane. Maybe just to hide the raw information in the pictures. Anyway, know you know how.