Modifying older data sets for Pix4Dfields support

When it was released in 2018, Pix4Dfields differed with Pix4Dmapper in many ways. One of them was that it required "Rig Relatives" to be able to process data from multispectral sensors.

If you happen to have older data sets that are unable to be processed in Pix4Dfields, you can follow this guide to retroactively add this to your image metadata.

Obtaining the right metadata

First, obtain the rig relative values for your camera using the steps below:

  • Update your camera firmware to the latest versions
  • Connect to RedEdge Wi-Fi, and visit in a web browser.
  • If the camera has the required calibration, it will display it. Save the rig relative data for use in modifying older image metadata:
{"1": [0.2, 0.1, 0.2], "2": [0.1, 0.2, 0.1]...
  • If not, a message should appear stating "No rig relative calibration available" and the camera requires an update, found here.

Modifying the images

The images can be updated using a third-party metadata tool like exiv2 or exiftool. In these examples, we have built scripts around exiv2.

Jump to MacOS/Linux


The following is an example batch script. To use it, copy it and save it with a .bat extension. The file must be modified to include your camera's specific rig relative numbers. Once saved, you can run this batch script in the folder that contains the images you would like to modify.

The camera reports the rig relatives in the following format:


So that means that cal[1] in the batch script would need the values from band "1", which in this example are--0.001124786806262602,0.002246393091745302, and -0.003988365590638233. 

Batch Script (*.bat)

@echo off
setlocal enabledelayedexpansion

set cal[1] = -0.001124786806262602,0.002246393091745302,-0.003988365590638233
set cal[2] = 0, 0, 0
set cal[3] = -0.3034849520908068, -21.326642231053118, -0.8374944622340491
set cal[4] = -28.88942070783364, -21.912151930283546, -0.0692748535739252
set cal[5] = -14.676537573848027, -10.658947918332823, -0.28212116158984546

rem Set this to 6 to populate all data. Set to 1-5 to not populate for the specified band
set referenceBand=6

for /L %%i in (1,1,5) do (
   for /D %%f in (*) do (
      set str=exiv2.exe -M"reg Camera" -M"del Xmp.Camera.RigRelatives"
rem      for %%a in (!cal[%%i]!) do (
rem         set str=!str! -M"set Xmp.Camera.RigRelatives XmpSeq %%a"
rem      )
      if NOT %%i==%referenceBand% (
         set str=!str! -M"set Xmp.Camera.RigRelatives XmpText !cal[%%i]!"
      call !str! "%%~ff\*_%%i.tif"



The following is a python script and it will need to be modified to replace the full path to the images you would like to modify as well as the rig relatives from the camera.

The camera reports the rig relatives in the following format:


Paste the camera's rig relative output as the input to the "data" variable. 

data = {"1":[-0.001124786806262602,0.002246393091745302,0.003988365590638233],"2":[0,0,0],...

Run the script in a terminal window, giving it the path to the folder where the images are stored, including the trailing slash (/).

python /Users/username/uploads/flight_1/images/

Python Script (*.py)

import os
import sys
import math

# Put your calibration data in the line below. Connect to camera wifi and visit for the string
# For example: data = {"1":[-0.001124786806262602,0.002246393091745302,0.003988365590638233],"2":[0,0,0],...

data = None # Paste rig relatives from your camera here. if data == None: print "Paste rig relatives string from your camera into the 'data' variable. Connect to camera wifi and visit to obtain the string" exit(1) if len(sys.argv) < 2: print("Please provide a directory to update.\nUsage:\n\tpython %s /path/to/your/images" %sys.argv[0]) exit(1) img_dir = sys.argv[1] def rad2deg(x): return x * 180/math.pi for f in os.listdir(img_dir): if ".tif" not in f[-4:]: continue i = int(f[-5:-4]) modrels = map(rad2deg, data[str(i)]) print i, modrels cal = ",".join(str(s) for s in modrels) command = 'exiv2 -M"reg Camera" -M"del Xmp.Camera.RigRelatives" -M"set Xmp.Camera.RigRelatives XmpText ' + cal + '" "' + img_dir + f + '"' #print(command) os.system(command)


Have more questions? Submit a request