Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i bet, it did not find the cascadefile.

that sample assumes, that lbpcascade_frontalface.xml and lena.png were in the same place, when your ressources got compiled. check that.

alternatively, try an absolute path for resources(images, cascades, etc) like:

CascadeClassifier faceDetector = new CascadeClassifier("/home/opencv/data/lbpcascade_frontalface.xml");

or:

 Mat image = Highgui.imread("c:/folder/lena.png"); // yes, forward slashes, please !

i bet, it did not find the cascadefile.

that sample assumes, that lbpcascade_frontalface.xml and lena.png were in the same place, when your ressources resources got compiled. check that.

alternatively, try an absolute path for resources(images, cascades, etc) like:

CascadeClassifier faceDetector = new CascadeClassifier("/home/opencv/data/lbpcascade_frontalface.xml");

or:

 Mat image = Highgui.imread("c:/folder/lena.png"); // yes, forward slashes, please !