mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 02:26:53 +08:00
Changed "template region" to "pattern" Region is an overloaded term
This commit is contained in:
@@ -41,7 +41,7 @@ user@linux:~/openalpr$ alpr --help
|
|||||||
USAGE:
|
USAGE:
|
||||||
|
|
||||||
alpr [-c <country_code>] [--config <config_file>] [-n <topN>] [--seek
|
alpr [-c <country_code>] [--config <config_file>] [-n <topN>] [--seek
|
||||||
<integer_ms>] [-t <region code>] [--clock] [-d] [-j] [--]
|
<integer_ms>] [-p <pattern code>] [--clock] [-d] [-j] [--]
|
||||||
[--version] [-h] <image_file_path>
|
[--version] [-h] <image_file_path>
|
||||||
|
|
||||||
|
|
||||||
@@ -60,8 +60,8 @@ Where:
|
|||||||
--seek <integer_ms>
|
--seek <integer_ms>
|
||||||
Seek to the specied millisecond in a video file. Default=0
|
Seek to the specied millisecond in a video file. Default=0
|
||||||
|
|
||||||
-t <region code>, --template_region <region code>
|
-p <pattern code>, --pattern <pattern code>
|
||||||
Attempt to match the plate number against a region template (e.g., md
|
Attempt to match the plate number against a plate pattern (e.g., md
|
||||||
for Maryland, ca for California)
|
for Maryland, ca for California)
|
||||||
|
|
||||||
--clock
|
--clock
|
||||||
|
@@ -26,8 +26,8 @@ the library, the accuracy for these other countries can be increased.
|
|||||||
.SH "USAGE"
|
.SH "USAGE"
|
||||||
.PP
|
.PP
|
||||||
|
|
||||||
alpr [\-c <country_code>] [\-\-config <config_file>] [\-n <topN>] [\-\-seek
|
alpr [\-c <country_code>] [\-\-config <config_file>] [\-n <topN>] [\-\-seek
|
||||||
<integer_ms>] [\-t <region code>] [\-\-clock] [\-d] [\-j] [\-\-]
|
<integer_ms>] [\-p <pattern code>] [\-\-clock] [\-d] [\-j] [\-\-]
|
||||||
[\-\-version] [\-h] <image_file_path>
|
[\-\-version] [\-h] <image_file_path>
|
||||||
|
|
||||||
|
|
||||||
@@ -46,8 +46,8 @@ Where:
|
|||||||
\-\-seek <integer_ms>
|
\-\-seek <integer_ms>
|
||||||
Seek to the specied millisecond in a video file. Default=0
|
Seek to the specied millisecond in a video file. Default=0
|
||||||
|
|
||||||
\-t <region code>, \-\-template_region <region code>
|
\-p <pattern code>, \-\-pattern <pattern code>
|
||||||
Attempt to match the plate number against a region template (e.g., md
|
Attempt to match the plate number against a plate pattern (e.g., md
|
||||||
for Maryland, ca for California)
|
for Maryland, ca for California)
|
||||||
|
|
||||||
\-\-clock
|
\-\-clock
|
||||||
|
16
src/main.cpp
16
src/main.cpp
@@ -44,7 +44,7 @@ const std::string LAST_VIDEO_STILL_LOCATION = "/tmp/laststill.jpg";
|
|||||||
bool detectandshow(Alpr* alpr, cv::Mat frame, std::string region, bool writeJson);
|
bool detectandshow(Alpr* alpr, cv::Mat frame, std::string region, bool writeJson);
|
||||||
|
|
||||||
bool measureProcessingTime = false;
|
bool measureProcessingTime = false;
|
||||||
std::string templateRegion;
|
std::string templatePattern;
|
||||||
|
|
||||||
// This boolean is set to false when the user hits terminates (e.g., CTRL+C )
|
// This boolean is set to false when the user hits terminates (e.g., CTRL+C )
|
||||||
// so we can end infinite loops for things like video processing.
|
// so we can end infinite loops for things like video processing.
|
||||||
@@ -68,7 +68,7 @@ int main( int argc, const char** argv )
|
|||||||
TCLAP::ValueArg<std::string> countryCodeArg("c","country","Country code to identify (either us for USA or eu for Europe). Default=us",false, "us" ,"country_code");
|
TCLAP::ValueArg<std::string> countryCodeArg("c","country","Country code to identify (either us for USA or eu for Europe). Default=us",false, "us" ,"country_code");
|
||||||
TCLAP::ValueArg<int> seekToMsArg("","seek","Seek to the specied millisecond in a video file. Default=0",false, 0 ,"integer_ms");
|
TCLAP::ValueArg<int> seekToMsArg("","seek","Seek to the specied millisecond in a video file. Default=0",false, 0 ,"integer_ms");
|
||||||
TCLAP::ValueArg<std::string> configFileArg("","config","Path to the openalpr.conf file",false, "" ,"config_file");
|
TCLAP::ValueArg<std::string> configFileArg("","config","Path to the openalpr.conf file",false, "" ,"config_file");
|
||||||
TCLAP::ValueArg<std::string> templateRegionArg("t","template_region","Attempt to match the plate number against a region template (e.g., md for Maryland, ca for California)",false, "" ,"region code");
|
TCLAP::ValueArg<std::string> templatePatternArg("p","pattern","Attempt to match the plate number against a plate pattern (e.g., md for Maryland, ca for California)",false, "" ,"pattern code");
|
||||||
TCLAP::ValueArg<int> topNArg("n","topn","Max number of possible plate numbers to return. Default=10",false, 10 ,"topN");
|
TCLAP::ValueArg<int> topNArg("n","topn","Max number of possible plate numbers to return. Default=10",false, 10 ,"topN");
|
||||||
|
|
||||||
TCLAP::SwitchArg jsonSwitch("j","json","Output recognition results in JSON format. Default=off", cmd, false);
|
TCLAP::SwitchArg jsonSwitch("j","json","Output recognition results in JSON format. Default=off", cmd, false);
|
||||||
@@ -77,7 +77,7 @@ int main( int argc, const char** argv )
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
cmd.add( templateRegionArg );
|
cmd.add( templatePatternArg );
|
||||||
cmd.add( seekToMsArg );
|
cmd.add( seekToMsArg );
|
||||||
cmd.add( topNArg );
|
cmd.add( topNArg );
|
||||||
cmd.add( configFileArg );
|
cmd.add( configFileArg );
|
||||||
@@ -98,7 +98,7 @@ int main( int argc, const char** argv )
|
|||||||
outputJson = jsonSwitch.getValue();
|
outputJson = jsonSwitch.getValue();
|
||||||
configFile = configFileArg.getValue();
|
configFile = configFileArg.getValue();
|
||||||
detectRegion = detectRegionSwitch.getValue();
|
detectRegion = detectRegionSwitch.getValue();
|
||||||
templateRegion = templateRegionArg.getValue();
|
templatePattern = templatePatternArg.getValue();
|
||||||
topn = topNArg.getValue();
|
topn = topNArg.getValue();
|
||||||
measureProcessingTime = clockSwitch.getValue();
|
measureProcessingTime = clockSwitch.getValue();
|
||||||
}
|
}
|
||||||
@@ -117,8 +117,8 @@ int main( int argc, const char** argv )
|
|||||||
if (detectRegion)
|
if (detectRegion)
|
||||||
alpr.setDetectRegion(detectRegion);
|
alpr.setDetectRegion(detectRegion);
|
||||||
|
|
||||||
if (templateRegion.empty() == false)
|
if (templatePattern.empty() == false)
|
||||||
alpr.setDefaultRegion(templateRegion);
|
alpr.setDefaultRegion(templatePattern);
|
||||||
|
|
||||||
if (alpr.isLoaded() == false)
|
if (alpr.isLoaded() == false)
|
||||||
{
|
{
|
||||||
@@ -308,8 +308,8 @@ bool detectandshow( Alpr* alpr, cv::Mat frame, std::string region, bool writeJso
|
|||||||
for (int k = 0; k < results.plates[i].topNPlates.size(); k++)
|
for (int k = 0; k < results.plates[i].topNPlates.size(); k++)
|
||||||
{
|
{
|
||||||
std::cout << " - " << results.plates[i].topNPlates[k].characters << "\t confidence: " << results.plates[i].topNPlates[k].overall_confidence;
|
std::cout << " - " << results.plates[i].topNPlates[k].characters << "\t confidence: " << results.plates[i].topNPlates[k].overall_confidence;
|
||||||
if (templateRegion.size() > 0)
|
if (templatePattern.size() > 0)
|
||||||
std::cout << "\t template_match: " << results.plates[i].topNPlates[k].matches_template;
|
std::cout << "\t pattern_match: " << results.plates[i].topNPlates[k].matches_template;
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user