mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 00:02:52 +08:00
Fixed prepchars utility so that it runs even if non-images are in the folder
This commit is contained in:
@@ -98,20 +98,17 @@ int main( int argc, const char** argv )
|
|||||||
|
|
||||||
const int FIXED_CHAR_HEIGHT = 40; // RESIZE all characters to this height
|
const int FIXED_CHAR_HEIGHT = 40; // RESIZE all characters to this height
|
||||||
|
|
||||||
vector<string> files = getFilesInDir(inDir.c_str());
|
vector<string> all_files = getFilesInDir(inDir.c_str());
|
||||||
|
|
||||||
sort( files.begin(), files.end(), stringCompare );
|
sort( all_files.begin(), all_files.end(), stringCompare );
|
||||||
|
|
||||||
for (int i = 0; i< files.size(); i++)
|
vector<string> files;
|
||||||
|
|
||||||
|
for (int i = 0; i< all_files.size(); i++)
|
||||||
{
|
{
|
||||||
if (hasEnding(files[i], ".png") || hasEnding(files[i], ".jpg"))
|
if (hasEnding(all_files[i], ".png") || hasEnding(all_files[i], ".jpg"))
|
||||||
{
|
{
|
||||||
|
files.push_back(all_files[i]);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
std::cerr << "Non-image file detected in this directory. This must be removed first" << std::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user