Camera calibration is the act of setting up a virtual 3D camera so that its orientation and focal length match a physical camera used to take a given reference photo. Once calibration has been performed, 3D objects can easily be composited into the original photo.

BLAM - the Blender camera calibration toolkit - is an open source add-on for Blender that can be used to calibrate the 3D camera based on reference photos and also to perform automatic reconstruction of geometry with rectangular faces. The source code and a user’s guide are available on GitHub.