I am getting error in EigenFaces.predict() method in java cv face recognition. The error is-
OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number of rows can not be changed) in unknown function, file ......\src\opencv\modules\core\src\matrix.cpp, line 802
my code is-
public static void main(String[] args) {
long size=6;
MatVector imgs=new MatVector(size);
int[] id={0,0,0,0,0,0};
FaceRecognizer fr=opencv_contrib.createEigenFaceRecognizer();
for(int i=0;i<=5;i++)
{
String url="C:/Users/vivek/Documents/NetBeansProjects/Recognizer2/src/a"+(i+1)+".jpg";
IplImage img=opencv_highgui.cvLoadImage(url);
imgs=imgs.put(i,img);
}
fr.train(imgs,id);
IplImage testImage=opencv_highgui.cvLoadImage("C:/Users/vivek/Documents/NetBeansProjects/Recognizer2/src/a3.jpg");
CvMat mat= testImage.asCvMat();
int val=fr.predict(mat);
System.out.println(val);
}