Discrimination of similar characters with a nonlinear compound discriminant function