Sending gray image (rather than color) to platelines

This commit is contained in:
Matt Hill
2014-04-06 11:28:56 -05:00
parent 1651601829
commit 7f1c1c8cd8

View File

@@ -47,6 +47,10 @@ void LicensePlateCandidate::recognize()
Mat plate_bgr = Mat(frame, expandedRegion); Mat plate_bgr = Mat(frame, expandedRegion);
resize(plate_bgr, plate_bgr, Size(config->templateWidthPx, config->templateHeightPx)); resize(plate_bgr, plate_bgr, Size(config->templateWidthPx, config->templateHeightPx));
Mat plate_gray;
cvtColor(plate_bgr, plate_gray, CV_BGR2GRAY);
CharacterRegion charRegion(plate_bgr, config); CharacterRegion charRegion(plate_bgr, config);
if (charRegion.confidence > 10) if (charRegion.confidence > 10)
@@ -55,7 +59,7 @@ void LicensePlateCandidate::recognize()
//Mat boogedy = charRegion.getPlateMask(); //Mat boogedy = charRegion.getPlateMask();
plateLines.processImage(charRegion.getPlateMask(), &charRegion, 1.10); plateLines.processImage(charRegion.getPlateMask(), &charRegion, 1.10);
plateLines.processImage(plate_bgr, &charRegion, 0.9); plateLines.processImage(plate_gray, &charRegion, 0.9);
PlateCorners cornerFinder(plate_bgr, &plateLines, &charRegion, config); PlateCorners cornerFinder(plate_bgr, &plateLines, &charRegion, config);
vector<Point> smallPlateCorners = cornerFinder.findPlateCorners(); vector<Point> smallPlateCorners = cornerFinder.findPlateCorners();