Objective functions for feature discrimination: applications to semiautomated and automated feature extraction