Fast Template Matching For Vision-Based Localization