# Match Camera Lenses To The Real World

## Recommended Posts

i am havin problems matching my houdini to a photo that i took, i tried reading the help section about matching a virtual camera to a virtual one:

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 in Houdini

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˚

and i am finding it hard to understand the relationships of the formulas between the virtual camera and the one used to take the picture.

here is the meta info of the picture i am using:

File name : img_2085.jpg

File size : 2434196 bytes

File date : 2007:04:25 12:41:20

Camera make : Canon

Camera model : Canon EOS 350D DIGITAL

Date/Time : 2007:04:24 03:51:41

Resolution : 3456 x 2304

Flash used : No

Focal length : 18.0mm (35mm equivalent: 29mm)

CCD width : 22.20mm

Exposure time: 0.025 s (1/40)

Aperture : f/3.5

ISO equiv. : 100

Whitebalance : Auto

Metering Mode: matrix

Exposure : Manual

Exposure Mode: Manual

Exposure Mode: Auto bracketing

how does this relate to the formulas?

thanks

amir

##### Share on other sites

put "CCD width" to aperture, and "focal length" to "focal length".

you can check

http://en.wikipedia.org/wiki/Angle_of_view

for a literal but yet formal introduction to the concept of angle of view calculations.

from that, it's clear that the too most important datas are the focal length of the lens in use and the size of the sensor (whatever if it's film or some electronics). and this is the point of understanding that what houdini call aperture is the horizontal size of your sensor in milimeters. (in fact the term aperture is more often used for the aperture of the lens (as it happens in your meta data) and not the camera, but that's a different thing. while it's totally correct, it can be a bit misleading)

you can check it if you create a spare attribute on your camera in houdini, call it fov (field of view) and add an expression to it:

2*atan(ch("aperture")/(2*ch("focal")))

(which is the first equation on that page.)

this will calculate the actual field of view (angle of view) of your camera. you can compare the results to the table in the above mentioned page. (set 36 to 'aperture' to get a 35mm film size sensor to check the table, or 22 in your definite case.) the calculated value will be the horizontal fov. the vertical fov can be calculated from the proportions of the resolutions. you can think of it, if that helps, as if you woud have a square sensor with the calculated fov, and a gate before it with the given resolution and proportions.

hope it helps.

bmt

##### Share on other sites

Hi bmt,

Thanks for the great explanation especially with regards to CCD width.

Cheers!

steven

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×