# allyhub scenery solve

> Finds the camera that took a picture, from points of a 3D scenery and the pixels they land on

Source: https://allyhub.com/docs/reference/cli/scenery-solve · AllyHub 0.10.0
Index of all docs: https://allyhub.com/llms.txt

## Usage

```bash
allyhub scenery solve [item] [options]
```

## Arguments

| Argument | Type | What it is |
| --- | --- | --- |
| `<item>` | string | The scenery: its id in allyhub.yaml, or its module's file, listed or not |

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `--times` | list of string |  | Seconds of scenery time for the word and anchor references the scenery's moves and its update (w.time) are timed by, as a video's part gives them: @turn=3.2,@show=5.1 (@turn+0.2 is found from @turn); over --piece's |
| `--piece` | string |  | The video whose scenery layers give those times (default, when one is needed and --times gives none: the one video of the project that draws this scenery) |
| `--points` | string |  | The correspondences, a JSON file: { "size": [w, h], "points": [{ "name", "where", "px": [x, y] }], "lines": [{ "name", "from", "to", "px" }] }; a point is [x, y, z] in metres, { "object": "&lt;name&gt;" } (its box's centre) or { "screen": "&lt;mesh name&gt;", "uv": [u, v] }; pixels from the picture's top left |
| `--size` | string |  | The picture's pixels, WIDTHxHEIGHT, when the file gives no size |
| `--lens` | number |  | The lens, 35 mm-equivalent mm: fixed, or where the solve starts with --free lens (default 26) |
| `--lens-frame` | `diagonal`, `long`, `short`, `phone` |  | What the lens is measured on: diagonal, long, short or phone (default phone) |
| `--free` | list of `x`, `y`, `z`, `yaw`, `pitch`, `roll`, `lens` |  | What is solved for (default x,y,z,yaw,pitch,roll); the rest keep their start |
| `--from` | string |  | A camera of the scenery to start from, by name (default: starts round the points) |
| `--at` | number | `0` | Scenery time to pose the scenery at for named points, s |
| `--out` | string |  | Draw the scenery from the solved camera into this WebP, the measured pixels as yellow rings and where the camera puts them as red dots |

## Global options

`--dir <value>`: the project's folder; default the one around where it is run. `--json`: print the result as JSON.

## Output

With `--json`, the command prints an object with these fields:

| Field | Type | What it is |
| --- | --- | --- |
| `file` | string |  |
| `residuals` | list of values |  |

## Examples

```bash
allyhub scenery solve room --points frame-12.json --out solved.webp
```

## Exit codes

`0` when it succeeds; the others are listed in [Exit codes](https://allyhub.com/docs/reference/cli/exit-codes.md).

## In the work

**3d**: Building a 3D scenery and its cameras

[`add search`](https://allyhub.com/docs/reference/cli/add-search.md) → [`add`](https://allyhub.com/docs/reference/cli/add.md) → [`scenery`](https://allyhub.com/docs/reference/cli/scenery.md) → [`scenery view`](https://allyhub.com/docs/reference/cli/scenery-view.md) → [`scenery map`](https://allyhub.com/docs/reference/cli/scenery-map.md) → [`scenery see`](https://allyhub.com/docs/reference/cli/scenery-see.md) → [`scenery measure`](https://allyhub.com/docs/reference/cli/scenery-measure.md) → [`scenery motion`](https://allyhub.com/docs/reference/cli/scenery-motion.md) → `scenery solve` → [`scenery bake`](https://allyhub.com/docs/reference/cli/scenery-bake.md) → [`inspect fidelity`](https://allyhub.com/docs/reference/cli/inspect-fidelity.md) → [`dev`](https://allyhub.com/docs/reference/cli/dev.md)
