Click here to Skip to main content
15,068,581 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, i am developing a handwritten character recognition system using OpenCV LibSVM. i have extracted 14 features for the feature vector including Hu moments, affine invariant moments, numbers of corners etc. For each character, i use 5 samples( for letter "A", there 5 types of A's). I know 5 samples is not enough, but at the moments i have only 5 samples for each character.

I use the basic LINEAR SVM example in opencv documentation. My problem is, can i use that documentation example as it is, for my purpose. I have read about OCR systems that use multi- class SVMs. Do i need such Multi-Class SVM for my application. I do not understand about this. Please can someone explain ? Here is my code.

float labels[180][1] = {1.0, 2.0, 3.0, 4.0, 5.0, ,,,,, -> 180.0};
Mat matlabesls(180,1, CV_32FC1, labels);

Mat mattrainingDataMat(180, 14, CV_32FC1, ifarr_readtrainingdata);

CvSVMParams params;
params.svm_type    = CvSVM::C_SVC;
params.kernel_type = CvSVM::LINEAR;
params.term_crit   = cvTermCriteria(CV_TERMCRIT_ITER, 100, 1e-6);


Mat matinput(1,14,CV_32FC1,ifarr_testarray);
is_recognizedcharacter= SVM.predict(matinput);

return is_recognizedcharacter;
Updated 26-May-13 2:17am

1 solution

you should contact someone from the OpenCV LibSVM. community.[^]

There is the Q&A Forum and some tutorials - so all you should need to "go ahead"
David Jhones 30-May-13 11:10am
hi Karstenk, thank you for considering my question. i will ask them about this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900