Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Broken python bindings with createEigenFaceRecognizer

When Trying to use the createEigenFaceRecognizer() and subsequent train(images, lables) method it throws an error:

cv2.error: matrix.cpp:357: error: (-215) r == Range::all() || (0 <= r.start && r.start < r.end && r.end <= m.size[i]) in function Mat

I am using the CPP tutorial as my guide along with the ATT dataset.

Here is a copy of the script I am using to test this.

import cv2,numpy,csv


if __name__ == '__main__':


    inFile = csv.reader(open('att.csv', 'r'), delimiter=';')


    img_dict = {}

    images = []
    lables = []

    for row in inFile:

        image = cv2.imread(row[0])
        lable = int(row[1])
        images.append(image)
        lables.append(lable)


    test_mat = images[-1]
    test_lable = lables[-1]

    images = numpy.array(images[:-1])
    lables = numpy.array(lables[:-1])

    gallery = cv2.createEigenFaceRecognizer()
    gallery.train(images, lables)

I am currently building the opencv package from SVN and this is the build script I am using: https://aur.archlinux.org/packages/op/opencv-svn/PKGBUILD

Any help would be greatly appreciated. Thank you.