Bugfix: Skip processing if opencv cannot load image.

This commit is contained in:
Peter Rekdal Sunde
2015-04-16 17:40:11 +02:00
parent 6e204e925b
commit b491f61f01

View File

@@ -123,6 +123,11 @@ int main( int argc, const char** argv )
string fullpath = inDir + "/" + files[i];
cout << fullpath << endl;
frame = imread( fullpath.c_str() );
if(frame.data == NULL)
{
cout << "Unable to read license plate: " << fullpath << endl;
continue;
}
resize(frame, frame, Size(config.ocrImageWidthPx, config.ocrImageHeightPx));
imshow ("Original", frame);