An Overall Real-Time Mechanism for Classification and Quality Evaluation of Rice