mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 18:42:48 +08:00
Added debug flag to binarizefontsheet
This commit is contained in:
@@ -96,6 +96,7 @@ int main(int argc, char** argv) {
|
|||||||
vector<string> font_sheet_files;
|
vector<string> font_sheet_files;
|
||||||
string char_list_file;
|
string char_list_file;
|
||||||
string out_dir;
|
string out_dir;
|
||||||
|
bool debug;
|
||||||
|
|
||||||
|
|
||||||
TCLAP::CmdLine cmd("OpenAlpr OCR Training Font Sheet Prep Utility", ' ', "1.0.0");
|
TCLAP::CmdLine cmd("OpenAlpr OCR Training Font Sheet Prep Utility", ' ', "1.0.0");
|
||||||
@@ -106,6 +107,7 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
TCLAP::ValueArg<std::string> outDirArg("","out_dir","Output directory to put the character images",true, "" ,"output_dir");
|
TCLAP::ValueArg<std::string> outDirArg("","out_dir","Output directory to put the character images",true, "" ,"output_dir");
|
||||||
|
|
||||||
|
TCLAP::SwitchArg debugSwitch("","debug","Enable debug output. Default=off", cmd, false);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -123,6 +125,7 @@ int main(int argc, char** argv) {
|
|||||||
font_sheet_files = fontSheetArg.getValue();
|
font_sheet_files = fontSheetArg.getValue();
|
||||||
char_list_file = charListArg.getValue();
|
char_list_file = charListArg.getValue();
|
||||||
out_dir = outDirArg.getValue();
|
out_dir = outDirArg.getValue();
|
||||||
|
debug = debugSwitch.getValue();
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (TCLAP::ArgException &e) // catch any exceptions
|
catch (TCLAP::ArgException &e) // catch any exceptions
|
||||||
@@ -197,6 +200,8 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
resize(testImg, testImg, Size(700, 1000));
|
resize(testImg, testImg, Size(700, 1000));
|
||||||
|
|
||||||
|
if (debug)
|
||||||
drawAndWait(&testImg);
|
drawAndWait(&testImg);
|
||||||
|
|
||||||
// Adjust the threshold w/ the morphology operation that OpenALPR uses
|
// Adjust the threshold w/ the morphology operation that OpenALPR uses
|
||||||
@@ -238,7 +243,9 @@ int main(int argc, char** argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
show_debug_image(rectangles, thresholds[t]);
|
show_debug_image(rectangles, thresholds[t]);
|
||||||
|
|
||||||
int text_content_length = utf8::distance(text_content.begin(), text_content.end());
|
int text_content_length = utf8::distance(text_content.begin(), text_content.end());
|
||||||
if (rectangles.size() != text_content_length - 1)
|
if (rectangles.size() != text_content_length - 1)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user