Ask Your Question

btreecat's profile - activity

2016-08-16 02:00:20 -0600 received badge  Taxonomist
2015-06-07 13:47:02 -0600 received badge  Famous Question (source)
2012-07-13 11:07:10 -0600 commented answer Broken python bindings with createEigenFaceRecognizer

The post comment link was not available till now (With the exception of the one below my own question) which is why I used the reply. Ill take another shot at the guide and get back to you with any questions.

2012-07-12 10:20:56 -0600 received badge  Notable Question (source)
2012-07-11 14:14:33 -0600 received badge  Student (source)
2012-07-11 14:13:52 -0600 received badge  Popular Question (source)
2012-07-11 12:46:23 -0600 answered a question Broken python bindings with createEigenFaceRecognizer

Thanks Phillip! I saw your guild from April but got a little lost with that. Then the release of 2.4.2, I figured we would just go ahead and use the built in functions.

Thank you for the CPP tutorial and we will continue to play with that for the time being until there is a python guide available.

Also, we noticed that the Python bindings seem to be missing from 2.4.2 release which is why we built from SVN.

2012-07-11 11:42:56 -0600 asked a question 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.