From 831bf8bcf01466de18cd9b93d9103a53beb1d7b0 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 6 Apr 2014 11:29:18 -0500 Subject: [PATCH] Ignoring all black/white images in platelines (efficiency) --- src/openalpr/platelines.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/openalpr/platelines.cpp b/src/openalpr/platelines.cpp index 20e5efc..ff66e5e 100644 --- a/src/openalpr/platelines.cpp +++ b/src/openalpr/platelines.cpp @@ -41,10 +41,9 @@ void PlateLines::processImage(Mat inputImage, CharacterRegion* charRegion, float getTime(&startTime); // Copy the input image over to the "smoothed" image as grayscale - Mat smoothed; - cvtColor(inputImage, smoothed, CV_BGR2GRAY); + Mat smoothed(inputImage.size(), inputImage.type()); + inputImage.copyTo(smoothed); - drawAndWait(&inputImage); // Ignore input images that are pure white or pure black Scalar avgPixelIntensity = mean(smoothed); if (avgPixelIntensity[0] == 255)