mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 07:16:56 +08:00
Fixed state identification missing from output
This commit is contained in:
10
src/main.cpp
10
src/main.cpp
@@ -296,11 +296,13 @@ bool detectandshow( Alpr* alpr, cv::Mat frame, std::string region, bool writeJso
|
|||||||
for (int i = 0; i < results.plates.size(); i++)
|
for (int i = 0; i < results.plates.size(); i++)
|
||||||
{
|
{
|
||||||
std::cout << "plate" << i << ": " << results.plates[i].topNPlates.size() << " results";
|
std::cout << "plate" << i << ": " << results.plates[i].topNPlates.size() << " results";
|
||||||
if (measureProcessingTime)
|
if (measureProcessingTime)
|
||||||
std::cout << " -- Processing Time = " << results.plates[i].processing_time_ms << "ms.";
|
std::cout << " -- Processing Time = " << results.plates[i].processing_time_ms << "ms.";
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
if (results.plates[i].regionConfidence > 0)
|
||||||
|
std::cout << "State ID: " << results.plates[i].region << " (" << results.plates[i].regionConfidence << "% confidence)" << std::endl;
|
||||||
|
|
||||||
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;
|
||||||
|
@@ -139,11 +139,11 @@ AlprFullDetails AlprImpl::recognizeFullDetails(cv::Mat img, std::vector<cv::Rect
|
|||||||
|
|
||||||
if (detectRegion)
|
if (detectRegion)
|
||||||
{
|
{
|
||||||
char statecode[4];
|
stateIdentifier->recognize(&pipeline_data);
|
||||||
plateResult.regionConfidence = stateIdentifier->recognize(&pipeline_data);
|
if (pipeline_data.region_confidence > 0)
|
||||||
if (plateResult.regionConfidence > 0)
|
|
||||||
{
|
{
|
||||||
plateResult.region = statecode;
|
plateResult.region = pipeline_data.region_code;
|
||||||
|
plateResult.regionConfidence = (int) pipeline_data.region_confidence;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -288,6 +288,7 @@ RecognitionResult FeatureMatcher::recognize( const Mat& queryImg, bool drawOnIma
|
|||||||
RecognitionResult result;
|
RecognitionResult result;
|
||||||
|
|
||||||
result.haswinner = false;
|
result.haswinner = false;
|
||||||
|
result.confidence = 0;
|
||||||
|
|
||||||
Mat queryDescriptors;
|
Mat queryDescriptors;
|
||||||
vector<KeyPoint> queryKeypoints;
|
vector<KeyPoint> queryKeypoints;
|
||||||
|
@@ -11,6 +11,8 @@ PipelineData::PipelineData(Mat colorImage, Rect regionOfInterest, Config* config
|
|||||||
this->regionOfInterest = regionOfInterest;
|
this->regionOfInterest = regionOfInterest;
|
||||||
this->config = config;
|
this->config = config;
|
||||||
|
|
||||||
|
this->region_confidence = 0;
|
||||||
|
|
||||||
plate_inverted = false;
|
plate_inverted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user