mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 14:07:39 +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;
|
std::string filename;
|
||||||
while (std::getline(std::cin, filename))
|
while (std::getline(std::cin, filename))
|
||||||
{
|
{
|
||||||
frame = cv::imread( filename );
|
if (fileExists(filename.c_str()))
|
||||||
detectandshow( &alpr, frame, "", outputJson);
|
{
|
||||||
|
frame = cv::imread( filename );
|
||||||
|
detectandshow( &alpr, frame, "", outputJson);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cerr << "Image file not found: " << filename << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (filename == "webcam")
|
else if (filename == "webcam")
|
||||||
|
Reference in New Issue
Block a user