Moved plate confidence up to pipeline_data

This commit is contained in:
Matt Hill
2014-07-01 19:30:57 -04:00
parent c8f52ccb48
commit cff0df3648
6 changed files with 6 additions and 15 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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