optimize DetectFeature