mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 07:16:56 +08:00
Moved plate confidence up to pipeline_data
This commit is contained in:
@@ -232,7 +232,7 @@ int main( int argc, const char** argv )
|
||||
double analysisTime = diffclock(startTime, endTime);
|
||||
cout << "\tRegion " << z << ": Analysis time: " << analysisTime << "ms." << endl;
|
||||
|
||||
if (lp.confidence > 10)
|
||||
if (pipeline_data.plate_area_confidence > 10)
|
||||
{
|
||||
lpAnalysisPositiveTimes.push_back(analysisTime);
|
||||
|
||||
|
@@ -196,7 +196,7 @@ void plateAnalysisThread(void* arg)
|
||||
lp.recognize();
|
||||
|
||||
|
||||
if (lp.confidence <= 10)
|
||||
if (pipeline_data.plate_area_confidence <= 10)
|
||||
{
|
||||
// Not a valid plate
|
||||
// Check if this plate has any children, if so, send them back up to the dispatcher for processing
|
||||
|
@@ -39,7 +39,7 @@ void LicensePlateCandidate::recognize()
|
||||
{
|
||||
charSegmenter = NULL;
|
||||
|
||||
this->confidence = 0;
|
||||
pipeline_data->plate_area_confidence = 0;
|
||||
|
||||
int expandX = round(this->pipeline_data->regionOfInterest.width * 0.20);
|
||||
int expandY = round(this->pipeline_data->regionOfInterest.height * 0.15);
|
||||
@@ -55,7 +55,6 @@ void LicensePlateCandidate::recognize()
|
||||
if (charRegion.confidence > 10)
|
||||
{
|
||||
PlateLines plateLines(config);
|
||||
//Mat boogedy = charRegion.getPlateMask();
|
||||
|
||||
plateLines.processImage(pipeline_data->plate_mask, &charRegion, 1.10);
|
||||
plateLines.processImage(pipeline_data->crop_gray, &charRegion, 0.9);
|
||||
@@ -74,7 +73,7 @@ void LicensePlateCandidate::recognize()
|
||||
//this->recognizedText = ocr->recognizedText;
|
||||
//strcpy(this->recognizedText, ocr.recognizedText);
|
||||
|
||||
this->confidence = 100;
|
||||
pipeline_data->plate_area_confidence = 100;
|
||||
}
|
||||
charRegion.confidence = 0;
|
||||
}
|
||||
|
@@ -46,8 +46,6 @@ class LicensePlateCandidate
|
||||
LicensePlateCandidate(PipelineData* pipeline_data);
|
||||
virtual ~LicensePlateCandidate();
|
||||
|
||||
float confidence; // 0-100
|
||||
//vector<Point> points; // top-left, top-right, bottom-right, bottom-left
|
||||
|
||||
void recognize();
|
||||
|
||||
|
@@ -35,13 +35,11 @@ class PipelineData
|
||||
std::string region_code;
|
||||
float region_confidence;
|
||||
|
||||
float overall_confidence;
|
||||
|
||||
float plate_area_confidence;
|
||||
|
||||
std::vector<cv::Rect> charRegions;
|
||||
|
||||
// Plate Lines
|
||||
std::vector<LineSegment> horizontalLines;
|
||||
std::vector<LineSegment> verticalLines;
|
||||
|
||||
|
||||
|
||||
|
@@ -40,10 +40,6 @@ PlateCorners::PlateCorners(Mat inputImage, PlateLines* plateLines, CharacterRegi
|
||||
Point bottomPoint = charRegion->getBottomLine().closestPointOnSegmentTo(topPoint);
|
||||
this->charHeight = distanceBetweenPoints(topPoint, bottomPoint);
|
||||
|
||||
//this->charHeight = distanceBetweenPoints(charRegion->getCharArea()[0], charRegion->getCharArea()[3]);
|
||||
//this->charHeight = this->charHeight - 2; // Adjust since this height is a box around our char.
|
||||
// Adjust the char height for the difference in size...
|
||||
//this->charHeight = ((float) inputImage.size().height / (float) TEMPLATE_PLATE_HEIGHT) * this->charHeight;
|
||||
|
||||
this->charAngle = angleBetweenPoints(charRegion->getCharArea()[0], charRegion->getCharArea()[1]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user