K-Nearest Neighbors implementation on OpenCV 3.0

asked 2016-03-02 03:41:46 -0600

b4r0ck gravatar image

Hi, I'm trying to implement a simple digits recognizer using KNn in OpenCV-CPP, I've got a folder with all images I want to train the classifier, that is ten folders, one for every digits, containing an image of the corresponding digit, but I don't know how to load those in Mat. These are the Mat I'd want to use:

Mat matTrainFeatures(0,number_of_train_elements,CV_32F);

Mat matSample(0,number_of_sample_elements,CV_32F);

Thanks in advice.

edit retag flag offensive close merge delete