From 7f1c1c8cd83d36d24c862e51420b8aeff12eaae7 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 6 Apr 2014 11:28:56 -0500 Subject: [PATCH] Sending gray image (rather than color) to platelines --- src/openalpr/licenseplatecandidate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/openalpr/licenseplatecandidate.cpp b/src/openalpr/licenseplatecandidate.cpp index 6fa2b31..5cfb280 100644 --- a/src/openalpr/licenseplatecandidate.cpp +++ b/src/openalpr/licenseplatecandidate.cpp @@ -47,6 +47,10 @@ void LicensePlateCandidate::recognize() Mat plate_bgr = Mat(frame, expandedRegion); 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); if (charRegion.confidence > 10) @@ -55,7 +59,7 @@ void LicensePlateCandidate::recognize() //Mat boogedy = charRegion.getPlateMask(); 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); vector smallPlateCorners = cornerFinder.findPlateCorners();