Ask Your Question

Revision history [back]

When you read data from disk you must check result :

// Read image
Mat img = imread("red_eyes2.jpg",CV_LOAD_IMAGE_COLOR);
if (img.empty())
{
    cout<<" File is empty : check file path\n";
   exit(-1);
}
// Output image
Mat imgOut = img.clone();

// Load HAAR cascade
CascadeClassifier eyesCascade
if( !eyes_cascade.load( "haarcascade_eye.xml" ) )
{
    cout << "--(!)Error loading eyes cascade. Check file path\n";
    return -1;
};

When you read data from disk you must check result :

// Read image
Mat img = imread("red_eyes2.jpg",CV_LOAD_IMAGE_COLOR);
if (img.empty())
{
    cout<<" File is empty : check file path\n";
   exit(-1);
}
// Output image
Mat imgOut = img.clone();

// Load HAAR cascade
CascadeClassifier eyesCascade
eyesCascade;
if( !eyes_cascade.load( "haarcascade_eye.xml" ) )
{
    cout << "--(!)Error loading eyes cascade. Check file path\n";
    return -1;
};

When you read data from disk you must check result :

// Read image
Mat img = imread("red_eyes2.jpg",CV_LOAD_IMAGE_COLOR);
if (img.empty())
{
    cout<<" File is empty : check file path\n";
   exit(-1);
}
// Output image
Mat imgOut = img.clone();

// Load HAAR cascade
CascadeClassifier eyesCascade;
if( !eyes_cascade.load( !eyesCascade.load( "haarcascade_eye.xml" ) )
{
    cout << "--(!)Error loading eyes cascade. Check file path\n";
    return -1;
};