Robot localization has been recognized as one of the most fundamental problems in mobile robotics. Localization can be defined as the problem of determining the position of a robot. More precisely, the aim of localization is to estimate the position of a robot in its environment, given local sensorial data. This information is essential for a broad range of mobile robots tasks; in particular, the robot behavior may depend on its position. This article presents a novel and efficient metric for appearance based robot localization. This metric is integrated in a framework that uses a partially observable Markov decision process as position evaluator, thus allowing good results even in partially explored environments and in highly perceptually aliased indoor scenarios.