Optimization of a fuzzy contrast method for a pattern recognition system