3D
FocalFinder: a camera from vanishing lines
FocalFinder finds a camera from a single frame. Draw lines along two perpendicular directions in the picture (floor tiles, a building's edges) and FocalFinder gives you the camera's focal length, orientation and position, ready for projections and 3D.
Steps
- Add the node: add FocalFinder (category 3D) and connect the plate to its img input. - The first output passes the plate through. - The second, yellow output is the camera.
- Open the node (double-click). The viewer shows four lines (1a–1b to 4a–4b) and an origin point. A new node starts with lines on a sample floor. The lines and the origin are moved in the viewer only: their coordinates aren't listed in the settings.
- Draw axis 1: drag lines 1 and 2 along edges that are parallel in the real world.
- Draw axis 2: drag lines 3 and 4 along edges perpendicular to the first. - Draw each line from its a end to its b end in the direction the axis points; swap the ends to flip the axis. - The lines are drawn in their axis colours and extended, dashed, toward their vanishing points.
- Name the axes: set axis 1 (x by default) and axis 2 (z by default, y when Preferences say Z up) to the world axes they run along. The third axis follows, so you can work with y up or z up.
- Place the origin: drag origin onto the point that should be the world's origin.
- Set the scale and lens: - distance to origin: how far the camera is from the origin, in scene units. Lines in a picture give the angles but not the size (a room and a model of it look the same), so this sets the scene's scale: use a distance you know, or adjust it until a known object (a door, 2 m) comes out at its size. - haperture: the film back width (36 mm by default). The focal length in millimetres is worked out from it. - The lines are measured on the plate connected to img, at its own size and pixel aspect, not the project format's (a 5184-pixel photo in an HD project is 5184 wide). Connect another plate and the camera follows. found says which size is used; with nothing connected it is the project format.
- Read the result: under the settings, found shows the focal length, the horizontal field of view and the camera's position, updated as you move the lines. If the lines can't give a camera (an axis' two lines parallel, or the axes not perpendicular), it says so.
- A third axis (optional): turn on axis 3 and drag lines 5 and 6 along the third direction (the one neither axis names: y with x and z). Three vanishing points give the focal length three ways (their mean) and the camera's turn from all three directions; found also shows the principal point they give (the camera keeps the image's centre). It helps most when one axis' lines are nearly parallel on screen, where two axes say little about the lens.
- Use the camera: plug the camera output into RenderScene, Project3D or anything that takes a camera. It is also listed in the 3D viewport's camera menu.
Not yet
- The image centre is assumed to be the lens centre.
- No scale from a known length.
- No button to make a Camera3D from it.
