Learning and example selection for object and pattern detection