An xml file could not be loaded when running the project on Visual Studio but the .exe of the project runs perfectly.
const char cascade_name="output.xml"; int lastX = -1; int lastY = -1; void detect_and_draw( IplImage img ) {
// Create memory for calculations
static CvMemStorage* storage = 0;
// Create a new Haar classifier
static CvHaarClassifierCascade* cascade = 0;
// Sets the scale with which the rectangle is drawn with
int scale = 1;
// Create two points to represent the hand locations
//CvPoint pt1, pt2;
// Looping variable
// int i; // Load the HaarClassifierCascade cascade = (CvHaarClassifierCascade*)cvLoad(cascade_name,0,0,0); // Check whether the cascade has loaded successfully. Else report and error and quit
// Allocate the memory storage
storage = cvCreateMemStorage(0);
// Create a new named window with title: result
cvNamedWindow( "result", 1 );
// Clear the memory storage which was used before
cvClearMemStorage( storage );
if(!cascade)
{
fprintf( stderr, "ERROR: Could not load classifier cascade\n" );
return;
}
can somebody tell me what went wrong?