1. A method for generating a master map for a generic class of objects, comprising: a processor generating a template pool containing a plurality of templates of linear edge fragments having a predetermined size and one of a predetermined plurality of different spatial orientation, wherein the template pool is generated from a region stack of images of the generic class of objects; the processor selecting a subset of frequent templates from the template pool having a plurality of templates having various degrees of complexity; and the processor applying a feature selection algorithm to determine a most discriminative template from a pre-selected one of the templates in the template pool; and the processor generating the master map from the formulated feature selection algorithm.