1 | initial version |
your evalData
is growing with any pass
Mat you push to it, so you cannot use
float response = svm.predict(evalData)
if you want to do a single prediction (inside that loop), use:
float response = svm.predict(pass);
if you want to collect your bow vectors, and do a bulk prediction, move it after the loop, and use:
Mat result = new Mat();
svm.predict( evalData, result );
2 | No.2 Revision |
your evalData
is growing with any pass
Mat you push to it, so you cannot use
float response = svm.predict(evalData)
if you want to do a single prediction (inside that loop), use:
float response = svm.predict(pass);
if you want to collect your bow vectors, and do a bulk prediction, move it after the loop, and use:
Mat result = new Mat();
svm.predict( evalData, result );
also:
Mat mat = imdecode(new Mat(bytes), CV_32FC1);
// wrong flag here, should be IMREAD_COLOR or similar