Error in fisher faces algorithm when using multiple images for a person
Hi,
I'm using fisher faces algorithm and it's working fine when I use one image per person (label). once I'm adding two or more images for the same label I get this error (in the train method): Assertion failed (0 <= _colRange.start && _colRange.start <= _colRange.end && _colRange.end <= m.cols) in cv::Mat::Mat
when I use one label with multiple images it works fine but if I use few labels and one of them has multiple images it failed with this error. I'm using the same pictures size for all of the pictures.
hi, @namlool, good, you made it here.
again, the assertion is thrown because of an invalid (or empty) image region. please check all imread(), resize() calls, if there's facedetection involved, check, if the rects are all inside the image, and show the resp. code around those. there's for sure something wrong in your code, or the way, you handle your data.
"when I use one label with multiple images ... " -- that does not explain anything.
if you want us to reproduce your problem, we need your data, and code for a minimal test case.
@namlool. I used 2 images or more of same person on python 3.5.
This is the code I'm using. 1. few labels with one image each - works. 2. one or two labels with few images each - works 3. 3 labels (or more) with few images on one of them throw the exception
please again, add a check, if imread succeeded (and only then push_back() anything)
also check images.size() == labels.size()
also, just to make sure it's not that -- try without any clr/cli/managed code. (mixing opencv (RAII based) and clr code is a terrible idea)
(*d_model)->train
-- what's d_model ?*d_model = cv::face::createFisherFaceRecognizer(d_num_components, d_threshold);
the EXACT type of d_model, please ?
cv::Ptr<cv::face::facerecognizer>* d_model = new cv::Ptr<cv::face::facerecognizer>();