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. Variable Definition Default value
fovx field 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.

Reference

User interface

• Explains each of the items in the main menus.

• Viewer pane types.

• Documents the options in various panes.

• Documents the options in various user interface windows.

Programming

• Expression functions let you compute the value of parameters.

• Tips and tricks for writing expressions to accomplish various effects.

• How to script Houdini using Python and the Houdini Object Model.

• VEX is a high-performance expression language used in many places in Houdini, such as writing shaders.

• HScript is Houdini’s legacy scripting language.

Command line

• Houdini includes a large number of useful command-line utility programs.

Plugin installation

• Tips for creating an installation package for plugin tools.