1 | initial version |
my image loading / preprocessing code looks like this:
Mat load( string imgpath )
{
cv::Mat gray = cv::imread(imgpath , 0); // GRAYSCALE!!
if ( gray.empty() )
return Mat();
Mat gr_eq;
cv::equalizeHist( gray, gr_eq); // maybe not strictly nessecary, but does wonders on the quality!
return gr_eq.reshape(1,1); // flatten it to one row
}
so, to sum things up (for both training and testing!) :