# CameraMatch

> CameraMatch (fSpy-style): drag two lines per vanishing point over edges that are parallel in the scene (red X, green Y, blue Z), put the origin on the ground, optionally a reference distance.

CameraMatch (fSpy-style): drag two lines per vanishing point over edges that are parallel in the scene (red X, green Y, blue Z), put the origin on the ground, optionally a reference distance. The camera solves live from your lines. The solver was written for this app from the published maths (no fSpy code). Mode 1vp uses a known focal length and the horizon; use_vp3 adds a third point to find the principal point. Create Camera makes a Camera node (+ preview render). Wrong way round? Flip VP1 / VP2.

| Node | CameraMatch |
|---|---|
| Menu | Transform › CameraMatch |
| **Names in each format** | |
| .oink comp (JSON) | `"type": "OC_N_cameramatch"` |
| .nk script | none: written as an Oink node |
| Python | `nuke.createNode("OC_N_cameramatch")` |
| Assistant (MCP) | `create_node(type="CameraMatch")` |
| Tab search | `cameramatch`, or its initials `cm` |

![CameraMatch properties](/shots/nodes/cameramatch@2x.webp)

## Inputs and outputs

| Port | Name | Type |
|---|---|---|
| input 0 | Image | image |
| output 0 | Image | image |

## Knobs

Panel tab **Cameramatch**, in panel order.

| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
| `reference_frame` | frame | float | `1` | -100000 to 100000 (integer) |  |  |
| `mode` | mode | menu | `2vp` | 2vp (2 vanishing points), 1vp (1 vanishing point + focal) |  |  |
| `vp1_axis` | VP1 axis | menu | `xp` | xp (+X), xn (-X), yp (+Y), yn (-Y), zp (+Z), zn (-Z) |  |  |
| `vp2_axis` | VP2 axis | menu | `zn` | xp (+X), xn (-X), yp (+Y), yn (-Y), zp (+Z), zn (-Z) |  |  |
| `use_vp3` | VP3 lines (check / refine) | bool | `false` |  |  |  |
| `refine` | refine with all lines | bool | `true` |  |  |  |
| `pp_mode` | principal point | menu | `center` | center (image centre), manual, vp3 (from 3rd vanishing point) |  |  |
| `principal_point` | principal point | vector ×2 | `960, 540` | -10000 to 10000 |  |  |
| `focal_length` | focal length (1 VP, mm) | float | `35` | 1 to 500 |  |  |
| `film_back` | film back | menu | `nuke` | nuke (Nuke default 24.576 x 18.672), ff (Full frame 36 x 24), s35 (Super 35 24.89 x 18.66), alexa_mini_og (Alexa Mini open gate), alexa_mini_16x9 (Alexa Mini 16:9), alexa_lf_og (Alexa LF open gate), alexa35_og (Alexa 35 open gate), red_m... |  |  |
| `haperture` | horiz aperture | float | `24.576` | 0.1 to 100 |  |  |
| `vaperture` | vert aperture | float | `18.672` | 0.1 to 100 |  |  |
| `origin` | origin | vector ×2 | `850.8, 81` | -10000 to 10000 |  |  |
| `ref_enable` | reference distance | bool | `false` |  |  |  |
| `ref_axis` | along axis | menu | `x` | x (X), y (Y), z (Z) |  |  |
| `ref_plane` | starts on plane | menu | `XZ` | XZ (XZ (ground)), XY, YZ |  |  |
| `ref_distance` | distance | float | `2` | 0 to 1000 |  |  |
| `ref_units` | units | menu | `m` | m, cm, mm, ft, in |  |  |
| `show_grid` | grid | bool | `true` |  |  |  |
| `grid_plane` | grid plane | menu | `XZ` | XZ (XZ (ground)), XY, YZ |  |  |
| `grid_spacing` | grid spacing | float | `1` | 0.01 to 100 |  |  |
| `grid_lines` | grid lines | float | `10` | 1 to 100 (integer) |  |  |
| `vp1_line1` | VP1 line 1 | vector ×4 | `978, 133.5, 1433.6, 321.6` | -10000 to 10000 |  |  |
| `vp1_line2` | VP1 line 2 | vector ×4 | `409.3, 392.5, 847, 499.8` | -10000 to 10000 |  |  |
| `vp2_line1` | VP2 line 1 | vector ×4 | `742, 136.5, 358, 332.3` | -10000 to 10000 |  |  |
| `vp2_line2` | VP2 line 2 | vector ×4 | `1401.7, 383.4, 995.4, 498.6` | -10000 to 10000 |  |  |
| `vp3_line1` | VP3 line 1 | vector ×4 | `289.9, 425.5, 265.6, 722.9` | -10000 to 10000 |  |  |
| `vp3_line2` | VP3 line 2 | vector ×4 | `1513.6, 414.7, 1534, 716.6` | -10000 to 10000 |  |  |
| `horizon` | horizon (1 VP) | vector ×4 | `480, 648, 1440, 648` | -10000 to 10000 |  |  |
| `ref_line` | reference line | vector ×4 | `294.9, 364.4, 924.4, 518.7` | -10000 to 10000 |  |  |

### Other knobs (Python, .nk and the assistant; not on the panel)

| Knob | Label | Type | Default | Range / values | .nk knob | Description |
|---|---|---|---|---|---|---|
| `gl_color` | Viewer Controls Color | float ×3 | `0, 0, 0` | 0 to 1 |  |  |
| `postage_stamp_frame` | Static Frame | int | `1` | -2147483648 to 2147483647 |  |  |
| `lifetimeStart` | Lifetime Start | int | `0` | -2147483648 to 2147483647 |  |  |
| `lifetimeEnd` | Lifetime End | int | `100` | -2147483648 to 2147483647 |  |  |
| `useLifetime` | Use Lifetime | boolean | `false` |  |  |  |
| `cached` | Cached | boolean | `false` |  |  |  |
| `bookmark` | Bookmark | boolean | `false` |  |  |  |
| `dope_sheet` | Dope Sheet | boolean | `false` |  |  |  |
| `clone_group` | Clone Group | string |  |  |  |  |
| `link_source` | Link Source | string |  |  |  |  |
| `link_overrides` | Link Overrides | string |  |  |  |  |
| `split_views` | Split Views | string |  |  |  |  |
| `fitted` | Handles fitted to plate | boolean | `false` |  |  |  |


---
Sources: opencomp_core/nodes/tracking/camera_match.py, opencomp_electron/src/components/properties/knobSchema.ts, opencomp_core/nodes/help/cameramatch.md
