From eb777abe16a13180fa6be2ef6273dadc3d51f490 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 28 Jun 2015 11:46:07 -0400 Subject: [PATCH] Ignore crops that are pure white or pure black with a little leniency --- src/openalpr/edges/platelines.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openalpr/edges/platelines.cpp b/src/openalpr/edges/platelines.cpp index ec7aa27..aba0a52 100644 --- a/src/openalpr/edges/platelines.cpp +++ b/src/openalpr/edges/platelines.cpp @@ -52,9 +52,9 @@ namespace alpr // Ignore input images that are pure white or pure black Scalar avgPixelIntensity = mean(inputImage); - if (avgPixelIntensity[0] == 255) + if (avgPixelIntensity[0] >= 252) return; - else if (avgPixelIntensity[0] == 0) + else if (avgPixelIntensity[0] <= 3) return; // Do a bilateral filter to clean the noise but keep edges sharp