User-provided camera parameter file for Pix4Dfields

 Previous  |  Next 

User-provided camera parameter file

If a camera is not supported in Pix4Dfields, it is possible to process the dataset if a file with the internal camera parameters is provided.

This feature is available since Pix4Dfields 1.6.

How to use the camera parameter file

The camera parameter file is to be provided in the .xml format described below.

To use the file, perform the following steps:

  1. On the dashboard, open the Pix4Dfields settings and select Camera parameters file.
  2. Click Select file and select the .xml file in the file dialog.
  3. Exit the settings and open/create a project to process the dataset. The camera parameters file is used automatically.

The file can be un-linked by clicking Remove in the Camera parameters file page of the settings. The parameters will then not be used anymore.

If a camera parameter file is provided for a specific camera, its values override any corresponding values in the image Exif data or the internal database. 

How to obtain the camera parameter file

There are 2 ways to generate a camera parameter file:

  • From a template. Use the template given below and fill the entries with values provided by the manufacturer or by a calibration procedure.
  • Pix4Dmapper export. Calibrate the camera with Pix4Dmapper and export the camera parameters from there in the correct format. 

Camera parameter template

The camera parameter file is a text file in XML format. Its structure depends on whether the camera has a perspective or fisheye lens. Here are examples for both types, and a description of the fields that must be filled in:

Perspective lens:

<cameraModelDB>
    <version>19</version>
    < cameras>
         <camera name="S.O.D.A._10.6_5472x3648">
              <imageWidth>5472</imageWidth>
              <imageHeight>3648</imageHeight>
              <pixelSize>2.4</pixelSize>
              <principalPointXmm>6.54</principalPointXmm>
              <principalPointYmm>4.348008</principalPointYmm>
              <lensType>perspective</lensType>
              <focalLengthmm>10.633008</focalLengthmm>
              <radialK1>0.033</radialK1>
              <radialK2>-0.209</radialK2>
              <radialK3>0.315</radialK3>
              <tangentialT1>0</tangentialT1>
              <tangentialT2>0</tangentialT2>
              <bandConfig>
                  <band name="Red" centralWaveLength="660" width="0"/>
                  <band name="Green" centralWaveLength="550" width="0"/>
                  <band name="Blue" centralWaveLength="470" width="0"/>
              </bandConfig>
         </camera>
    < /cameras>
</cameraModelDB>

Fisheye lens:

<cameraModelDB>
    <version>19</version>
    <cameras>
       <camera name="PHANTOMVISIONFC200_5.0_4384x3288">
           <imageWidth>4384</imageWidth>
           <imageHeight>3288</imageHeight>
           <principalPointXmm>3.085</principalPointXmm>
           <principalPointYmm>2.31375</principalPointYmm>
           <lensType>fisheye</lensType>
           <poly1>1</poly1>
           <poly2>-0.00643155</poly2>
           <poly3>-0.127019</poly3>
           <poly4>-0.017398</poly4>
           <c>3853</c>
           <d>6.74</d>
           <e>6.74</e>
           <f>3853</f>
           <bandConfig>
              <band name="Red" centralWaveLength="660" width="0"/>
              <band name="Green" centralWaveLength="550" width="0"/>
              <band name="Blue" centralWaveLength="470" width="0"/>
          </bandConfig>
       </camera>
    </cameras>
</cameraModelDB>

The following tags and their attributes need to be filled adapted to your specific model. The values to provide are:

 

Tag Attribute Description
Camera  name A string in the following format:
<model>_<lens-model>_<focal-length>_<width>x<height>

The following information is read from the image Exif information:
<model> = Exif.Image.Model
<lens-model> = Exif.Photo.LensModel or Exif.Canon.LensModel
<focal-length> = Exif.Photo.FocalLength

If the lens model is not provided in the Exif, the format of the string is: <model>_<width>x<height>

Read from the images:
<width> = image width <height> = image height

imageWidth, imageHeigh   Image width/height (in px)
pixelSize   Pixel size (in micrometer)
principalPointXmm, principalPointYmm   Principal point X/Y (in mm)
lensType   perspective or fisheye
focalLengthmm   Focal length (in mm; perspective only)
radialK1, radialK2, radialK3, tangentialT1, tangentialT2   Radial and tangential distortion coefficients (perspective only)
poly1, …, poly4   Polynomial coefficients (fisheye only)
c, d, e, f   Affine deformation parameters (fisheye only)
bandConfig   Ordered list of bands
band name Band name (one of: “Red”, “Green”, “Blue”, “NIR”, “Alpha”, “Gray”, “Red edge”, “Thermal IR”, “LWIR”, “Garbage”, “Unknown”)
  centralWaveLength Central wavelength of the band (in nm)
  width Full width at half maximum of wavelength distribution (in nm; 0 if unspecified)


For more information see How are the Internal and External Camera Parameters defined? article. 

Camera parameter file export from Pix4Dmapper

Alternatively, one can use Pix4Dmapper to obtain calibrated camera parameters in the correct .xml format.

With this approach, first the camera needs to be calibrated. For more information on how to calibrate cameras in Pix4Dmapper see How to calibrate a Perspective Lens Camera and How to calibrate a Fisheye Lens Camera articles.

Second, export the user camera database:

  • In Pix4Dmapper, click ‘Help’, ‘Settings’.
  • On the ‘Camera Database’ tab, under ‘User Database’, click ‘Export…’ and save the file in a suitable location.
Was this article helpful?
0 out of 1 found this helpful

Article feedback (for troubleshooting, post here)

0 comments

Please sign in to leave a comment.