Ask Your Question

Revision history [back]

How to remove this error in javacv....

OpenCV Error: Assertion failed (s >= 0) in unknown function, file ......\src\opencv\modules\core\src\matrix.cpp, line 116 Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: ......\src\opencv\modules\core\src\matrix.cpp:116: error: (-215) s >= 0

code is:- if(imageFiles.size()==0) { empty=true; } if(!empty) { images = new MatVector(imageFiles.size()); System.out.println(imageFiles.size()); labels = new int[imageFiles.size()];

    for (int x=0;x<imageFiles.size();x++) {
        File image=imageFiles.get(x);
        img = cvLoadImage(image.getAbsolutePath(),CV_LOAD_IMAGE_GRAYSCALE);

        images.put(counter, img);

        labels[counter] = counter;

        counter++;
    }
    faceRecognizer = createLBPHFaceRecognizer(1, 8, 8, 8, 100);//50
    **faceRecognizer.train(images, labels);**(THIS IS THE LINE WHERE I AM GETTING THAT ERROR )