trying to make face recognition with ANN
Hello, i'm using c++, VS2010, OpenCV 2.4.8. I want to make ANN witch can be trained to separate pictures to different classes (in my case face pictures), and decide if streaming video contains image witch belongs to any class. could you recommend where to start with ANN? how to make training part, or maybe some link to tutoials. i'm using OpenCV face detection program from examples. thank you in advance.
opencv comes with a MLP readymade that you could use.
here is a nice post on how to prepare the data (for an svm, but that step is the same for ANN, too)
apart from that: if you're really into ann's allow some time for this
that post is realy good:) i already made data loading, now just reading the "MLP readymade" to get a grip how its made :)
found an mlp example
can someone explain me why i get memory allocation problem?
(yea, i know, that cv::Mat, cvMat is annoying ...)
is that lithuanian above ;) ?
thank you for quick response. k, ill leave CV_32SC1 part for later. but when i remove & i get "no instance of overloaded function "CvANN_MLP::create"" :( yes :)
damn, works fine here ...
dude, sry my bad.. didn't sow the "cv::Mat" part. now its seams to run :) thank you so much :)
and one again i get memory allocation problem. cv::Mat trainData(17,38416,CV_8UC1)// its 17 rows and 38416 columns of grey images 1 row = image
cv::Mat label= cv::Mat(1,17,CV_32S,temp);// temp is int temp[17]; witch contains {0,0,0,0,0,0,0,1,1,1,1,1,2,2,2,2,2} cv::Mat weights= cv::Mat::ones(1,17,CV_32S); tinklas.train(trainData,label,weights);
i tried cv::Mat new; cvtColor(trainData,new,CV_32S);
http://docs.opencv.org/modules/ml/doc/neural_networks.html#cvann-mlp-train
trainData.convertTo(trainData, CV_32F);
(cvtColor is more for translating from bgr to hsv or such, it does not change the datatype)cv::Mat label= cv::Mat(17,1,CV_32S,temp); // only rows/cols swapped to what you got before
again, don't worry too much. you're doing fine. all that confusion is pretty normal ;)