When I run the facerec_eigenfaces
demo program from OpenCV 3.1 I receive an unhandled exception:
OpenCV Error: Assertion failed (0 <= i && i < (int)v.size()) in cv::_InputArray::getMat_
This follows a call to _InputArray::getMat(int)
. I reduced the facerec_eigenfaces
program to the following which gives the same error. (I also tried other binary pgm files with the same result.) Can anyone suggest what may be wrong?
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <vector>
int main(int argc, char *argv[])
{
auto m = cv::imread("../att_faces/s1/1.pgm", 0);
std::vector<cv::Mat> imgs;
imgs.push_back(m);
cv::InputArrayOfArrays ia(imgs);
ia.getMat(0); // assertion here
return 0;
}