1 | initial version |
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;
};
2 | No.2 Revision |
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;
};
3 | No.3 Revision |
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;
};