mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 06:46:53 +08:00
Added check to verify that file exists when input is given on standard in. If not, print an error message
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -116,8 +116,16 @@ int main( int argc, const char** argv )
|
||||
std::string filename;
|
||||
while (std::getline(std::cin, filename))
|
||||
{
|
||||
frame = cv::imread( filename );
|
||||
detectandshow( &alpr, frame, "", outputJson);
|
||||
if (fileExists(filename.c_str()))
|
||||
{
|
||||
frame = cv::imread( filename );
|
||||
detectandshow( &alpr, frame, "", outputJson);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Image file not found: " << filename << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (filename == "webcam")
|
||||
|
Reference in New Issue
Block a user