# Reference Match Houdini camera lenses to the real world

## Angle of View and Houdini Focal Length

You can obtain a good fit between the Houdini camera and a real world camera by matching a measured lens’s horizontal angle of view, and deriving a Houdini focal length value that reproduces it with the default aperture 41.4214.

This ignores pin-cushion and barrel distortion which must be set using shots of grids and render tests. You should measure the horizontal angle of view with respect to the camera’s TV safe transmitted reticule aperture.

## Scanned Film Images

For scanned film images, you can simply divide the pixel width of the scanned image by the pixels/mm for the scanner, and plug this number into the aperture channel. Then set the focal length to the live action focal length.

## Useful formulas

There are some basic mathematics we can use to relate a real world camera to Houdini cameras. On the following page are some useful formulas.

VariableDefinitionDefault value
fovxfield of view in X-
fovy field of view in Y-
apx aperture in X 41.4214
apy aperture in Y -
focal focal length 50
resx pixel resolution in X 320
resy pixel resolution in Y 243
asp pixel aspect (width/height) 1

Three key relationships:

```fovx = 2 * atn( (apx/2) / focal )
tan(fovy/2) = (apy/2) / focal
apx/apy = (resx * asp) / resy
```

Useful equations derived from the above:

```apy = (resy*apx) / (resx*asp)
fovy = 2*atan( (apy/2) / focal )
```

Solving for the above given Houdini defaults:

```fovx = 2*atan( ( apx / 2 ) / focal ) = 2*atan( ( cam1/aperture / 2 ) / cam1/focal ) = 2*atan( ( 41.4214 / 2 ) / 50 ) = 45˚

apy = (resy * apx) / (resx * asp) = (243 * 41.4214) / (320 * 1) = 31.454376

fovy = 2*atan( (apy/2) / focal ) = 2*atan( (31.454376 / 2) / 50 ) = 34.9213˚
```

fovx is not dependent on resx, resy, or aspect, but fovy is.

You can verify this for yourself by attaching a unit-spaced grid to the camera at the focal length distance and the number of units in the X direction will be exactly equal to the aperture. The number of grid units in the y direction ( apy) will be dependent on resx, resy and aspect.