Automatic generation of 3D models from photographs