Ask Your Question

hi i have question regarding KNN opencv for character recognition

asked 2017-07-20 02:14:51 -0500

i have been using using knn for my project to detect characters in an image,so is there anyway to get confidence score for KNN?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-07-20 02:24:33 -0500

berak gravatar image

sure there is, look at the docs:

Mat result; // k result ids 
Mat responses; // raw responses
Mat distances; // 1/distance ~ confidence

knn->findNearest(sample, k, result, responses, distances);
edit flag offensive delete link more


btw, ANN or SVM are usually more accurate here, and a cnn will send them all to the ditch.

berak gravatar imageberak ( 2017-07-20 02:46:32 -0500 )edit

hi berak am very very thankful for your answer.......k let me tell you the full problem and the procedure which am following currently in my am currently working on ocr part in which i have to process some claim forms,so in order to extract the data from fields in the form i used this KNN with opencv(character recognition) which i got it from github if i test it with some cropped images i got some output in character wise showing like it creating some bounding boxes for each character in my input image and it displays the character output what i wanted is,i need the confidence score for each individual character/overall word can i do that?

sujithkumar gravatar imagesujithkumar ( 2017-07-20 04:19:52 -0500 )edit

Question Tools

1 follower


Asked: 2017-07-20 02:14:51 -0500

Seen: 164 times

Last updated: Jul 20 '17