Well, I decided to workout myself on my question to solve the above problem. What I wanted is to implement a simple OCR using KNearest or SVM features in OpenCV. And below is what I did and how. (it is just for learning how to use KNearest for simple OCR purposes). 1) My first question was about letter_recognition.data file that comes with OpenCV samples. I wanted to know what is inside that file.