page updated: 2012.03.20

CAMERA-MATCH tool helps you to adjust camera to your reference pictures.
It is a part of CADtools for Blender 2.49.
You don't need to know camera parameters originally used for.
The tool calculates camera parameters from the picture directly inclusive FocalLength and FocalShift.
It works well for pictures with some orthogonal elements - especially for architectural motives.
Singularity: CAMERA-MATCH tool supports also cropped and shifted images.



Camera-Match feature video (CADtools 0.55 beta - 2010.12.27)

Instruction
To match camera to the reference-image you need to go through these steps:

1. Select Background-Image and Camera
	- Select and activate your Background-Image:
	  You can do this here with Image-menu (CAD-edition only)
	   or manually in 3d-View->View->Background_Image panel.
	- Select any perspective Camera or create a new one and set it as active_camera:
	  You can do this here from within Camera-List (with CAD-edition only)
	  or manually in 3d-View.
	- You can also select an "Image-Camera"-item stored to the List before.

2. Match Camera to Reference Background-Image
	You must manually set vanishing-points for particular directions X,Y,Z.
	Choose one of the methods:
	   a. draw up to 3 vanishing-points directly in camera view plane.
	   b. draw up to 3 pairs of parallel lines, which estimate vanishing-points due crossing on horizon.
	There are three scenarios possible:
	   - draw "one point" for central-perspective (works for pictures taken exactly in front of an object)
	   - draw "two points" for two-vanishing-points-perspective (script assumes the camera focal axis is horizontal)
	   - draw "three points" for three-vanishing-points-perspective (most common case - arbitrary camera position)
	After completing this step the routine updates Camera parameters. The Camera is now calibrated.
	The position of Background-Image in camera view may change for cropped/shifted images.
	An extra object will appear - the reference mesh object "RefCube". It looks like a "house",
	to give you better visual feedback about orientation in space.
	Move or scale it to get impression about correctness of camera calibration.
	To get perfect results in some situations you will need to repeat above procedure.
	
3. Align back Camera/Image to your model/scene
	"RefCube" object will help you to align your calibrated Camera to your model in Blender.
	Follow these steps: 
	a. Transform RefCube to match the context of your Background-Image.
		Use move, scale, mirror and 90-degrees-rotate.
	b. Align RefCube+Camera to your model in Blender.
		The routine will assist you on this way:
		It selects RefCube and Camera and starts for you
		ALIGN-command with RefCube's ObjectMatrix as startMatrix
		and with current UCS as targetMatrix. 
		You can make your own choices: e.g. change targetMatrix.
		After confirmation RefCube and Camera will be rotated and moved to the right location.
	 c. Re-scale RefCube+Camera until the Reference-Image becomes congruent to your model.

4. Finally
	You can store current BackgroundImage+Camera-Set under individual name for future use.
	Delete "RefCube" (it will be recreated automatically next time)
	or rename it and its obData if you want to use it as part of your model.
	Note: "RefCube" name is reserved for camera-match helper object.

Photogrametry
With two pictures of an object you can make photogrametry reconstruction in Blender.
For details look at PHOTOGRAMETRY.


Cropped Images / Shifted Images
The pictures you get as reference may differ from standard optics in many ways.
They may be cropped - it means that portions of an image are cut away.
They may be shifted - a popular method in architectural photography to correct perspective distorsions.
The result is that the optical center is no more identical with the image center.
It is not always easy to recognize it on the first glance (except for experienced photographers perhaps)
and it is almost not possible to estimate the exact optical center by hand.
In Blender you can simulate this with help of camera shift paramaters.
The good news is that CAMERA-MATCH tool calculates and sets them for you automatically.




Copyright © Remigiusz Fiedler, 2009-2012, www.cad4arch.com