Fixed state identification missing from output

This commit is contained in:
Matt Hill
2014-10-23 18:24:29 -04:00
parent a831b19c96
commit dc65be8c32
4 changed files with 13 additions and 8 deletions

View File

@@ -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;

View File

@@ -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;
} }
} }

View File

@@ -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;

View File

@@ -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;
} }