Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dfki-ric/uxo-dataset2024/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The GoPro camera used in the UXO Dataset 2024 was calibrated for four different field of view (FOV) modes. Each mode has distinct intrinsic parameters including the camera matrix and distortion coefficients. All calibration files are stored in /calibration/camera_parameters/ and follow OpenCV’s camera calibration model.

GoPro Field of View Modes

The GoPro supports multiple FOV modes that affect the lens distortion and field of view:

Linear

Digitally corrected mode with minimal distortion. Best for photogrammetry and measurement applications.

Narrow

Telephoto mode with reduced field of view and less distortion than wide modes.

Wide

Standard wide-angle mode with moderate barrel distortion. Balances FOV and distortion.

SuperView

Maximum field of view with dynamic stretching. Highest distortion levels.

Camera Calibration Parameters

Each FOV mode has calibrated intrinsic parameters stored as NumPy arrays in text format.

Camera Matrix

The camera matrix (K) contains the focal lengths and principal point:
[[fx,  0, cx],
 [ 0, fy, cy],
 [ 0,  0,  1]]
Where:
  • fx, fy: Focal lengths in pixels (x and y directions)
  • cx, cy: Principal point coordinates (optical center)

Distortion Coefficients

The distortion vector contains four coefficients for the fisheye distortion model:
[k1, k2, k3, k4]
These coefficients model radial distortion characteristic of wide-angle lenses.

Linear Mode

camera_parameter_linear.txt
calibration
Digitally corrected linear mode with minimal distortion.
camera_parameter_linear.txt
camera_matrix =  [[1.47304513e+03 0.00000000e+00 9.69389055e+02]
 [0.00000000e+00 1.47833421e+03 5.40775107e+02]
 [0.00000000e+00 0.00000000e+00 1.00000000e+00]]
distortion =  [[ 0.90938145]
 [ 0.09319444]
 [ 7.88195247]
 [-3.68132837]]
  • fx: 1473.0 pixels
  • fy: 1478.3 pixels
  • cx: 969.4 pixels
  • cy: 540.8 pixels
  • k1: 0.909 (positive radial distortion)
  • k2: 0.093
  • k3: 7.882
  • k4: -3.681 (negative correction)

Narrow Mode

camera_parameter_narrow.txt
calibration
Telephoto mode with reduced field of view.
camera_parameter_narrow.txt
camera_matrix =  [[1.96032520e+03 0.00000000e+00 9.61545001e+02]
 [0.00000000e+00 1.96508356e+03 5.44228971e+02]
 [0.00000000e+00 0.00000000e+00 1.00000000e+00]]
distortion =  [[  0.86674484]
 [ -0.03704667]
 [  8.587814  ]
 [-18.75784521]]
  • fx: 1960.3 pixels (higher focal length = narrower FOV)
  • fy: 1965.1 pixels
  • cx: 961.5 pixels
  • cy: 544.2 pixels
  • k1: 0.867
  • k2: -0.037 (slight negative distortion)
  • k3: 8.588
  • k4: -18.758 (strong negative correction)

Wide Mode

camera_parameter_wide.txt
calibration
Standard wide-angle mode with moderate distortion.
camera_parameter_wide.txt
camera_matrix =  [[1.31243683e+03 0.00000000e+00 9.80421992e+02]
 [0.00000000e+00 1.31261251e+03 5.31336901e+02]
 [0.00000000e+00 0.00000000e+00 1.00000000e+00]]
distortion =  [[ 0.14790296]
 [ 1.18643565]
 [-3.77146525]
 [ 5.44358806]]
  • fx: 1312.4 pixels (lower focal length = wider FOV)
  • fy: 1312.6 pixels
  • cx: 980.4 pixels
  • cy: 531.3 pixels
  • k1: 0.148
  • k2: 1.186
  • k3: -3.771 (negative distortion)
  • k4: 5.444

SuperView Mode

camera_parameter_superview.txt
calibration
Maximum field of view with dynamic stretching and highest distortion.
camera_parameter_superview.txt
camera_matrix =  [[1.37477315e+03 0.00000000e+00 9.65037288e+02]
 [0.00000000e+00 1.25389393e+03 3.46383440e+02]
 [0.00000000e+00 0.00000000e+00 1.00000000e+00]]
distortion =  [[  0.43139299]
 [  1.46997173]
 [-22.94272641]
 [ 62.08773762]]
  • fx: 1374.8 pixels
  • fy: 1253.9 pixels (asymmetric due to dynamic stretching)
  • cx: 965.0 pixels
  • cy: 346.4 pixels (shifted principal point)
  • k1: 0.431
  • k2: 1.470
  • k3: -22.943 (very strong negative distortion)
  • k4: 62.088 (very strong positive correction)
SuperView mode has significant distortion (k3 = -22.94, k4 = 62.09) and asymmetric focal lengths. Use with caution for measurement applications.

Using Camera Parameters

Loading Parameters in Python

import numpy as np
import re

def load_camera_params(filename):
    """Load camera matrix and distortion from calibration file."""
    with open(filename, 'r') as f:
        content = f.read()
    
    # Extract camera matrix
    camera_match = re.search(r'camera_matrix = \s*\[(.*?)\]', content, re.DOTALL)
    camera_str = camera_match.group(1).replace('[', '').replace(']', '')
    camera_matrix = np.fromstring(camera_str, sep=' ').reshape(3, 3)
    
    # Extract distortion
    dist_match = re.search(r'distortion = \s*\[(.*?)\]', content, re.DOTALL)
    dist_str = dist_match.group(1).replace('[', '').replace(']', '')
    distortion = np.fromstring(dist_str, sep=' ')
    
    return camera_matrix, distortion

# Load calibration for wide mode
K, D = load_camera_params('calibration/camera_parameters/camera_parameter_wide.txt')

Undistorting Images with OpenCV

import cv2
import numpy as np

# Load calibration
K, D = load_camera_params('calibration/camera_parameters/camera_parameter_wide.txt')

# Load image
img = cv2.imread('gopro_image.jpg')
h, w = img.shape[:2]

# Compute optimal camera matrix
balance = 0.0  # 0.0 = all pixels valid, 1.0 = all source pixels visible
new_K = cv2.fisheye.estimateNewCameraMatrixForUndistortRectify(
    K, D, (w, h), np.eye(3), balance=balance)

# Undistort image
map1, map2 = cv2.fisheye.initUndistortRectifyMap(
    K, D, np.eye(3), new_K, (w, h), cv2.CV_16SC2)
undistorted = cv2.remap(img, map1, map2, cv2.INTER_LINEAR)

Projecting 3D Points to Image

import cv2
import numpy as np

# 3D point in camera frame (meters)
point_3d = np.array([[0.5, 0.3, 2.0]])  # X, Y, Z

# Load calibration
K, D = load_camera_params('calibration/camera_parameters/camera_parameter_wide.txt')

# Project to image using fisheye model
rvec = np.zeros(3)  # No rotation (already in camera frame)
tvec = np.zeros(3)  # No translation

image_points, _ = cv2.fisheye.projectPoints(
    point_3d.reshape(-1, 1, 3), rvec, tvec, K, D)

print(f"Image coordinates: {image_points[0][0]}")

FOV Mode Comparison

Modefx (pixels)fy (pixels)FOV
Narrow1960.31965.1Narrowest
Linear1473.01478.3Medium-narrow
SuperView1374.81253.9Medium-wide
Wide1312.41312.6Widest
Lower focal length = wider field of view.

Calibration Model

The parameters use OpenCV’s fisheye camera model, which is specifically designed for wide-angle and fisheye lenses:
# Fisheye distortion formula
r = sqrt(x² + y²)
θ = atan(r)
θ_d = θ(1 + k1*θ² + k2*θ⁴ + k3*θ⁶ + k4*θ⁸)
x' = (θ_d / r) * x
y' = (θ_d / r) * y
This is different from the standard pinhole distortion model. Use cv2.fisheye.* functions in OpenCV, not the regular cv2.undistort().

File Locations

All camera parameter files are located in:
/calibration/camera_parameters/
├── camera_parameter_linear.txt
├── camera_parameter_narrow.txt
├── camera_parameter_wide.txt
└── camera_parameter_superview.txt

Recommendations

Use Linear or Wide mode:
  • Linear: Best for undistorted viewing and measurement
  • Wide: Good balance of FOV and manageable distortion
Use Wide mode rather than SuperView:
  • SuperView’s extreme distortion can cause artifacts
  • Wide mode provides excellent coverage with moderate distortion
Use Narrow mode:
  • Higher focal length provides better resolution at distance
  • Lower distortion than wide modes

Build docs developers (and LLMs) love