Ignore crops that are pure white or pure black with a little leniency

This commit is contained in:
Matt Hill
2015-06-28 11:46:07 -04:00
parent faf8aed33a
commit eb777abe16

View File

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