extract features according to template