mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-07 04:50:54 +08:00
Ignoring all black/white images in platelines (efficiency)
This commit is contained in:
@@ -41,10 +41,9 @@ void PlateLines::processImage(Mat inputImage, CharacterRegion* charRegion, float
|
|||||||
getTime(&startTime);
|
getTime(&startTime);
|
||||||
|
|
||||||
// Copy the input image over to the "smoothed" image as grayscale
|
// Copy the input image over to the "smoothed" image as grayscale
|
||||||
Mat smoothed;
|
Mat smoothed(inputImage.size(), inputImage.type());
|
||||||
cvtColor(inputImage, smoothed, CV_BGR2GRAY);
|
inputImage.copyTo(smoothed);
|
||||||
|
|
||||||
drawAndWait(&inputImage);
|
|
||||||
// Ignore input images that are pure white or pure black
|
// Ignore input images that are pure white or pure black
|
||||||
Scalar avgPixelIntensity = mean(smoothed);
|
Scalar avgPixelIntensity = mean(smoothed);
|
||||||
if (avgPixelIntensity[0] == 255)
|
if (avgPixelIntensity[0] == 255)
|
||||||
|
Reference in New Issue
Block a user