PyMVG file formatΒΆ

The PyMVG file format specifies a camera system completely. The file is valid JSON. Here is an example that specifies a system of 3 cameras:

{ "__pymvg_file_version__": "1.0",
  "camera_system": [
    {"name": "cam1",
     "width": 640,
     "height": 480,
     "P": [[ 320.0, 0, 319.99999999999994, 0 ],
           [ 0, 320.00000000000006, 240.0, 0 ],
           [ 0, 0, 1.0, 0 ]],
     "K": [[ 320.0, 0, 319.99999999999994 ],
           [ 0, 320.00000000000006, 240.0 ],
           [ 0, 0, 1.0 ]],
     "D": [ 0.2, 0.3, 0.1, 0.1, 0.1 ],
     "R": [[ 1.0, 0, 0 ],
           [ 0, 1.0, 0 ],
           [ 0, 0, 1.0 ]],
     "Q": [[ -1.0000000000000004, 0, 0 ],
           [ 0, 1.0, 0 ],
           [ 0, 0, -1.0000000000000004 ]],
     "translation": [ 0, 0, 0.9000000000000005 ]
    },
    {"name": "cam2",
     "width": 640,
     "height": 480,
     "P": [[ 320.0, 0, 319.99999999999994, 0 ],
           [ 0, 320.00000000000006, 240.0, 0 ],
           [ 0, 0, 1.0, 0 ]],
     "K": [[ 320.0, 0, 319.99999999999994 ],
           [ 0, 320.00000000000006, 240.0 ],
           [ 0, 0, 1.0 ]],
     "D": [ 0, 0, 0, 0, 0 ],
     "R": [[ 1.0, 0, 0 ],
           [ 0, 1.0, 0 ],
           [ 0, 0, 1.0 ]],
     "Q": [[ 0, 0, 0.9999999999999999 ],
           [ 0.847998304005088, 0.5299989400031799, 0 ],
           [ -0.5299989400031798, 0.847998304005088, 0 ]],
     "translation": [ 0, 0, 0.9433981132056602 ]
    },
    {"name": "cam3",
     "width": 640,
     "height": 480,
     "P": [[ 320.0, 0, 319.99999999999994, 0 ],
           [ 0, 320.00000000000006, 240.0, 0 ],
           [ 0, 0, 1.0, 0 ]],
     "K": [[ 320.0, 0, 319.99999999999994 ],
           [ 0, 320.00000000000006, 240.0 ],
           [ 0, 0, 1.0 ]],
     "D": [ 0, 0, 0, 0, 0 ],
     "R": [[ 1.0, 0, 0 ],
           [ 0, 1.0, 0 ],
           [ 0, 0, 1.0 ]],
     "Q": [[ 0, 0, 1.0000000000000002 ],
           [ -0.7071067811865475, 0.7071067811865477, 0 ],
           [ -0.7071067811865478, -0.7071067811865475, 0 ]],
     "translation": [ 0, 0, 0.7071067811865475 ]
    }
  ]
}