Recognition of Container Code Characters through Gray-Level Feature Extraction and Gradient-Based Classifier Optimization