Object Recognition by Combining Appearance and Geometry