Ask Your Question

Revision history [back]

You need to use the file's full path, if it is in a separate directory from the program's .exe in windows.

Example

CascadeClassifier face_cascade("C:\opencv\data\haarcascades\haarcascade_frontalface_alt.xml");

This is a C string or a null terminated string, they are used to access files in opencv. In C strings \ equates to "\" one literal backslash.

You need to use the file's full path, if it is in a separate directory from the program's .exe in windows.

Example

CascadeClassifier face_cascade("C:\opencv\data\haarcascades\haarcascade_frontalface_alt.xml");face_cascade("C:\\opencv\\data\\haarcascades\\haarcascade_frontalface_alt.xml");

This is a C string or a null terminated string, they are used to access files in opencv. In C strings \ \\ equates to "\" one literal backslash.